How to solve Save conflict error?

Forums Dynamic Forms for SharePoint How to solve Save conflict error?

Viewing 4 reply threads
  • Author
    Posts
    • #34190
      Harsh
      Participant

      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:
    • #34193
      Alexander Bautz
      Keymaster

      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

    • #34194
      Harsh
      Participant

      Very useful, Thanks @Alexander
      Can you help me with providing steps on how can I set up these rules?

    • #34196
      Alexander Bautz
      Keymaster

      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

    • #34198
      Harsh
      Participant

      Work exactly the way I want…Thanks, @alexander…!
      Regards
      Harsh.

Viewing 4 reply threads
  • You must be logged in to reply to this topic.