Home › Forums › Classic DFFS › How to solve Save conflict error?
- This topic has 9 replies, 3 voices, and was last updated 3 years, 1 month ago by SteveE.
-
AuthorPosts
-
-
July 27, 2021 at 08:47 #34190
While saving the edit form, we are facing a save conflict error, maybe it happened because we have some power to automate flows that change values in columns while the form is in edit mode.
How can I resolve this?Attachments:
-
July 27, 2021 at 09:11 #34193
If you have a FLOW that changes the item after a user has opened editform and before he saves the item he will get a save conflict.
To avoid this you can add a field to your list – for example a boolean field named FLOW_DONE – that you set to true when the FLOW has finished.
Now you can set up a rule in your EditForm that checks this field – and if it is not true, give an alert and tells the user that the item is not yet ready for edit.
Alexander
-
July 27, 2021 at 16:20 #34194
Very useful, Thanks @Alexander
Can you help me with providing steps on how can I set up these rules? -
July 28, 2021 at 08:24 #34196
You must edit your FLOW to write to the FLOW_DONE field when it is done.
In DFFS you just set up a rule that triggers on FLOW_DONE = Unchecked and add a message to the user in the “Alert this message” textarea.
If you want to redirect the user away from EditForm you can leave the “Alert this message” field empty and instead add this to the “Run these functions / evaluate these rules” textarea:
flow_not_ready_redirect
and this to your Custom JS:
function flow_not_ready_redirect(){ spjs.modal.add({ "title": "Item is not ready", "html": "The FLOW has not finished updating this item so you cannot edit it.<br><br>Please try again later.", "showClose": false, "allowMaximize": false, "resizable": false, "ok": function(){ if(GetUrlKeyValue("IsDlg") === "1"){ window.frameElement.commitPopup(); }else{ window.history.back(); } } }); }
Alexander
-
July 28, 2021 at 12:44 #34198
Work exactly the way I want…Thanks, @alexander…!
Regards
Harsh.-
July 29, 2021 at 06:44 #34200
Thank you for the feedback.
Alexander
-
-
October 29, 2021 at 12:37 #34960
I really like this and can get it to work on my test form. However on my production form the “back” history shows the same entry multiple times so it doesn’t redirect. It could be because it takes time to load or there are other timeouts on it. I’ve tried to add a timeout but I don’t think it will matter because the “back” history is loaded with the same form. I guess I could redirect it somewhere else, but is there any way to get it to go back to the view they were at other than the “back” history? Maybe something with the source in the url? Thank you!
-
October 29, 2021 at 14:27 #34962
Can I trigger the cancel button functionality instead?
-
-
AuthorPosts
- You must be logged in to reply to this topic.