cortical

scripted record locking/unlocking

Discussion created by cortical on Jun 24, 2016
Latest reply on Dec 7, 2017 by Malcolm

The use scenario is 2 users, and locking an Order record to prevent accidental editing.

 

The routine user can run the script to lock the record.

To unlock that record, requires a file close, and relogin as full access to unlock, then close file and relogin as the routine user, again.

 

It would be preferable to allow the routine user (in this particular instance) to run a script to toggle the record lock status. But this is not working as might be expected.

 

data separation file pair

data table has number field: lock_code

PS (routine_de) configured as records edit: limited : lock_status = 0

 

login in to interface file as routine user: de

if lock_status = 0, record editable as expected

if lock_status = 1, no edit as expected

 

reset lock_status script (interface file), runs with full access privileges:

re-login as full access

if lock_status = 1, reset to 0

 

this throws error message - 'your access privileges do not allow you to perform this action'

 

I have tried commit, flush cache, flush external and other peripheral unlikely variations, to no avail

 

If I login to the file as full access, and run the same script to lock and unlock, it runs without complaint

But if the initial login is DE, the script , despite instantiating a full access account before attempting the change status, baulks

 

So despite the re-login, something is not allowing full access privileges even though the account is now full access

 

If I login as full access, then script relogin as de, then the lock the record, the record remains editable

 

What might I be missing?

Outcomes