In SPESQH I have a process that modifies the record of the screen (CUSQUOREF field), which is executed correctly, but after this, if from the same screen the user tries to modify the same record, the capture error occurs.
Which Action are you using to run this process ?
Hi Sadki, from SPE button from the same screen OSQH.
By clicking on the specific button when a change is detected on the screen, the specific processing locks the recording that you have locked with the screen change. This is the reason why the first lock becomes obsolete.
I know, but how I solv this error?
You can use :
ReadLock [F:ZSQH]SQH0 = [M:SQH0]SQHNUM
if !fstat & GREP=''
the processing that follows will only be executed if there is no change detection on the screen.
I have the same error...
Why you don't run the process with APRES_CRE and APRES_MOD actions ?
you've just to add a condition :
if [M:SQH0]CUSQUOREF <> ZCUSQUOREF
If I put the process in APRES_CHOI seems it works, first i refresh de field when the user modify it, and in the APRES_CHOI action y execute de database modification, similar at your solution. Than you very much.
The error is due to a difference between the [F]updTick value on the SQUOTE table and the local variable [L]AUPDTICK managed by the supervisor. When a record is read in the LIENS method the [L]AUPDTICK is set with the [F]updTick value from the table. This ensures that the version on the screen and the version of the original record when read is the same before allowing modification.
Updating the record from any other section of code, requires a refresh of both values. For an example take a look in the label RECOVERED_AUPDTICK from SUBSOHA for how it is managed on the Sales Orders (GESSOH) object.
*Community Hub is the new name for Sage City