Workflow: prevent from save not working

Hi there,
My version is 2022.9.6 and i try since a few major versions to implement a locking or warning feature for when a record is updated in the background while someone is editing it.

so i tried with trigger ā€œbefore updateā€ and checked in a first attempt if the date has changed in the meantime. the logic is working and it hits the ā€œerrorā€ step in the workflow since my alert message one step before the ā€œErrorā€ step is beeing shown.

But the record is saved regardless, i didnt figgured any way to prevent the save. with ā€œErrorā€ Step i mean the one which says: ā€œThrows error and stops workflow execution, also prevents saving of records triggered with before triggerā€

We had some serious problems in the past with some overwritten values.

Thank you very much in advance

Hey

One possible solution that might work here is to determine when this overwrite might happen(which you already have in place) in that event, use the ā€˜oldRecordā€™ values and set them to the current ā€˜recordā€™ Compose record and save the old values back.

This can be found on the trigger; please see the picture below.

image

I hope this helps.

Kind regards

1 Like

Hey Andre,

Thanks for your answer. Its a interesting approach.

I could do a fresh rec lookup at ā€œbefore updateā€ and if the record has changed in the meantime while editing i can set it to either the old record, or the new (just fetched) one.

But the problem is still that the ā€œerrorā€ step in the WF which should prevent the record save at the end is not preventing the save. it is updated regardless. maybe i missuse the error step somehow?

I do believe if you donā€™t manually intervene with the fields the commit is still executed against the DB.