Hi all, I have a flag that gets added to my main data table when someone has a record open to alert another user that the record is currently in use. To add the initial flag I use the below code in the Window Manager (WindowManager)/Init Procedure()/Code/Priority 7500 (after the files have been opened).
APP:Status = 1 ! = open for editing
APP:StatusUserId = SI.GetUserName () ! ValuesSystemInformationCode (ABC Free)
Access:AppData.UPDATE()
Once the user closes the record I had the below code in the Window Manager (WindowManager)/Kill Procedure//Priority 5000.
If ThisWindow.Request <> InsertRecord ! added so as to not get An error (Record not Available (33)….
If LocStatusClear = 0
APP:Status = 0 ! = open for editing! Kill the record lock now that the edit is finished
APP:StatusUserId = ''
Access:AppData.UPDATE()
END
END
The above all works as I want it to create the initial flag and clear the flag when exiting etc.
The Issue is…
When a user opens an existing record the flag is applied as expected. When the ?Cancel button is pressed they get the expected message “Are you sure you want to cancel?", they press yes. The flag is cleared as required, but the issue is if the user had made a change to the record it is also now being saved, when they don’t want it being saved.
Any pointers how I can achieve just the file flag being updated on a cancel and no other fields also being saved.
Thanks
Graeme