Current version of data in database has changed since user initiated update process - oracle

I have a Master Detail form in my Oracle APEX application. When I am trying to update data in this form, I am getting below error.
Current version of data in database has changed since user initiated
update process. current row version identifier =
"26D0923D8A5144D6F483C2B9815D07D3" application row version identifier
= "1749BCD159359424E1EE00AC1C3E3FCB" (Row 1)
I have cleared browser cache and try to update. But it not worked.
How can I solve this?

I have experienced similar problem where my detail records set has timestamp fields. By default master detail wizard creates the timestamp fields as date picker type fields. If you set the date format on these, it would resolve the issue.

This blog post tries to address this issue on a Tabular Form (I know that's not what the original issue was with, but thought it might be related). It says the same as #sangam does below.
Short version: If you have an updated field that's timestamp datatype, you should set a date/time format.
http://apexbyg.blogspot.com/2015/05/tabular-form-bug.html
My tabular form has a field that's timestamp datatype, but I had already set a date format, so this didn't help me.

Here's another possibility, which I discovered was the case in my application.
That would be if the data the original checksum was calculated on is truly different than the pre-update checksum calculation, due to a design-flaw in your query!
In my application, the source for one of the updateable fields was COALESCE(name_calced, name_preferred). In the source table, the person's name could already be loaded in the record by an external process and we save it to one field - name_calced. But the end-user can enter a preferred name, which we wanted to save to the name_preferred field. We wanted to initially populate the displayed, updateable tabular form field with name_calced, if one existed, or name_preferred if the user had already provided a preferred name. Then they could change that value and save it back to the database.
I finally discovered that the Save action threw the error message if name_calced was non-null, but name_preferred was null. I realized that the initial checksum was calculated based on name_calced, but the pre-update checksum was based on name_preferred, so the application thought someone had changed the value in the background and showed the error message.
What I don't understand is how this problem didn't show up in the past 3 years the application has been running in production!
My solution is to make the field source only on name_preferred, which immediately solved this problem. I also think the back-end process will also get changed to pre-populate that table field from name_calced, so the user always sees the base value, if there is one.

I just had this issue myself. Now, I realize that tabular forms are deprecated at this time, but I have an application that was developed beforehand and still uses them. This issue occurred and I had to get one of our big guns at Oracle to help me out. I do a lot of DB work and a decent amount of Apex development but I'm more of a Java, WebLogic, etc guy, and I really couldn't figure this one out.
In my case, it turned out to be really simple. One of the columns in my tabular form was a hidden field, generated via a sub query. Being hidden, this column is not editable by the user and should not be part of the MRU update. I had the field set to "Hidden Column (saves states)" and setting its type to "Hidden Column" fixed the issue. So, this leads to sub queries being executed in such a way as to change the checksum for the overall query before hitting submit (save), causing the error.
For those who are continuing to troubleshoot this, look at your query for every field that you have specified and note which columns are editable in the tabular form. All other fields should be set in a way that makes them not save state so that they are not part of the update.

I had this error when I had two update processes processing on submit.
My solution was to add a condition to both processing steps. I had forgotten to do this when I made an additional process for Button A, but I never updated Button B to limit it's behaviors.
Navigation:
Processing -> Processes -> [Your Process Name] -> Server-side Condition -> When Button Pressed = [Your button Name]

In my case I had a column from a secondary table that was not set as Query Only and was being updated! The error would occur trying to save a column not in the table being updated. It took me half a day to figure it out (the column names were the same).

Set your Link column hidden to display only in the form.
Set "Send On Page Submit" to 'No' or disable the link column that is your primary key ( Rownum/rowid/id etc).
Hope it will work for you.

I have noticed this error comes when I was working Tabular Form and has disabled one of the form operations i.e. by setting server-side condition to "Never" for add, apply changes (submit) buttons
When I have restored back to its original state, it worked as expected.
In case you have to hide Add/Update button, use some other option.
https://compknowledgebase.blogspot.com/2018/12/oracle-apex-error-current-version-of.html

Related

Form WHERE clause

I have an APEX form I'm developing for "user settings". I have a table with a sequence as a primary key and the users ID in another column...in addition to a few columns where each users saved settings are stored (things like "N" for do not receive notices).
I haven't used Oracle APEX in a while so excuse this likely newbie question...The insert works fine, but I'm having trouble with making the form only show the current users values. In my Form Region the source is set to my Table, and I have a WHERE clause like this:
USER_ID = 813309
But that's not working (813309 is my id and I'm just hard-coding it for now). The form always comes up with a "New" record.
For a form to load a specific record you can set the primary key page item to the value you need. You can do so in the url using the link builder from another page or you can set a computation on the item. That is what I would try in your case: add a computation to your item P_USER_ID of type "Static Value" with value 813309. Make sure the computation happens before the "Fetch Row" - the value obviously needs to be set before the process runs.
In such cases, I prefer creating a Report + Form combination (using the Wizard, of course): it creates an interactive report (so that you can review data in a table), and a form which is used to add new records or update/delete existing ones.
Doing so, when you pick a user in interactive report and click the icon at the beginning of a row, Apex redirects you to the form page, passing primary key column value to the form which then fetches appropriate data from the table.
Not that it won't work the way you're trying to do it, it's just simpler if you let Apex do everything for you.
So: did you create an automatic row fetch pre-rendering process? If not, do so because - without it - Apex doesn't know what to fetch. Also, if you hardcoded user_id, it won't do much good. Consider storing username into the table so that you could reference it via :APP_USER Apex variable.

Validation running on all rows when tabbing Oracle ADF

I want a validation to fire after hitting tab on a field. The thing is every time I click on the empty field it runs the validation to all rows. Which causes errors because the other existing rows in the table aren't in the scope of the validation. I am using a back bean function to and can see the validation is called everytime I hit the empty field. I think this has to do with autosubmit being on but how else can I validate on a tab?
I don't know that this will answer your q's but might be a start:
http://www.slideshare.net/stevendavelaar/18-invaluable-lessons-about-adfjsf-interaction
https://docs.oracle.com/cd/E15586_01/web.1111/b31973/af_validate.htm
https://rohanwalia.blogspot.com/2013/10/client-side-validation-in-adf-faces.html
https://www.jobinesh.com/2009/08/how-to-skip-validation.html
Also, if you're doing ADF work definitely get Jobinesh's book as it covers many things in depth: https://www.barnesandnoble.com/w/oracle-adf-real-world-developers-guide-jobinesh-purushothaman/1111982100
Also consider ADF Cookbook.

Microsoft Access 2013 VBA code changes bound control on change of record am getting write conflict

Have just got back into coding in Microsoft Access, so it might be something stupid.
Situation:
Sqlite database linked to Access db via ODBC.
Have created a form which has bound controls from a table.
Due to the way sqlite stores dates, as text, I am not able to use the calendar picker. I thought easy I can create an unbound text box control, set the format to date and then I will have a date picker. Then in VBA just get it to change the value of the bound date control, which would be hidden.
Me.txt_Date_of_birth.Value = Format(Me.Txtdate_of_birth_with_calandar_control.Text, global_date_format)
It works it changes the value of the bound control (which for testing is not hidden).
But when I change records I am getting an error of
Write conflict. This record has been changed by another user since you
started editing it. If you save the record, you will overwrite the
changes the other user made.
From my testing it is being caused by this unbound control updating the bound control. Anyone know a simple fix?
And I would prefer not to get my data from a query that formats the text field into a date field.
And I can confirm that the error does not occur when I create an access table and try to update a bound control.
Try saving the record at once:
Me.txt_Date_of_birth.Value = Format(Me.Txtdate_of_birth_with_calandar_control.Text, global_date_format)
Me.Dirty = False
Does this table have a primary key? - in the eyes of Access - by which I mean when you look at the table in design view with Access.....
If not try adding that.

Check if Associated View is blank in Dynamic CRM Online

In CRM Online on a customer form is there anyway that you can check if the Associated View for Assets is blank? And if its blank change a field value based on it.
Using JavaScript, 2 ways:
The associated grid is showing records related to your primary record. You can perform the same query the grid is doing using REST which will tell you if there are any records. You can then count the records, and change the field value as required. This approach is better if there are records in the database but which aren't shown in the view for some reason, e.g. view filters.
Access the Grid objects data using getRows(). As above you can then count the records, and change the field value as required. The downside of this is I believe those methods only give you access to the records shown on the form (and not any hidden by filters but still in the database) - but I don't think that that will be a problem here.
Worth bearing in mind that this approach only works client side, e.g. someone has to be actually looking at the form.
If you need to cover the a non-client side approach, e.g. workflows creating records, then you should probably look at plugin development so the changes can be performed server side.
As a side if you just want a simple count shown on form you then you should probably look at Calculated Fields and in particular Rollup fields. You might also be able to run further client side JavaScript from the count.

Oracle Forms: Problem with master/detail commit

greetings,I'm facing a problem in Oracle Forms 10g. I created a simple master-detail form where i want to save data only from the detail data block (the master will function more as a browser).
The only solution found till now is to edit the properties of text items in the master block and prevent them from inserting/updating. This comes in conflict with the list of values (LOV) appearing when the user tries to input the app_id, or from a search button (i know that the way is not significant). Is there a way that i can pass values to the primary block and function only as a query?
Any help could save me from lots of trouble!
We can set various properties at the block level using the Block Properties palette. In your case you need to toggle off Delete Allowed, Insert Allowed and Update Allowed. Obviously you will want Query Allowed toggled on.

Resources