dffs trigger save

Home Forums Modern DFFS dffs trigger save

Viewing 5 reply threads
  • Author
    Posts
    • #37616
      Bernard Sawma
      Participant

        i have added this customjs JS:

        function saveAndSubmit() {
        setFieldValue(“Submitted”, true);
        dffs_triggerSave(true);
        }

        function save() {
        setFieldValue(“Submitted”, false);
        dffs_triggerSave(true);
        }
        var stage=getFieldValue(“Stage”);

        if(stage==”SendToApprover”)
        {
        document.querySelector(“div[class^=’panelFooterBtnWrap’]”).insertAdjacentHTML(“afterbegin”, “<input type=’button’ value=’Save’ onClick=’save()’>”);
        document.querySelector(“div[class^=’panelFooterBtnWrap’]”).insertAdjacentHTML(“afterbegin”, “<input type=’button’ value=’Save and submit’ onClick=’saveAndSubmit()’>”);
        }
        else if (stage==”Closed”){

        }
        else
        {
        document.querySelector(“div[class^=’panelFooterBtnWrap’]”).insertAdjacentHTML(“afterbegin”, “<input type=’button’ value=’Save’ onClick=’save()’>”);
        }

        Now, i have (save) and (save and submit) buttons, but the problem that when clicking them nothing happens, also i am seeing the following error in the console after clicking on both buttons:

        Uncaught ReferenceError: dffs_triggerSave is not defined
        at save (<anonymous>:8:3)
        at HTMLInputElement.onclick (AllItems.aspx?DFFSID=22&DFFSForm=edit:1:1)
        VM26457:3 Uncaught ReferenceError: dffs_triggerSave is not defined
        at saveAndSubmit (<anonymous>:3:3)
        at HTMLInputElement.onclick (AllItems.aspx?DFFSID=22&DFFSForm=edit:1:1)

      • #37624
        Alexander Bautz
        Keymaster

          Hi,
          Which version of the Modern DFFS are you using?

          Alexander

        • #37625
          Bernard Sawma
          Participant

            v1.0.25.0

          • #37626
            Alexander Bautz
            Keymaster

              OK, then you have to update – the dffs_triggerSave function was added in v1.0.36.0 in October 2023. The current version is now v1.0.53.0.

              Alexander

            • #37627
              Bernard Sawma
              Participant

                How can i update?

              • #37629
                Bernard Sawma
                Participant

                  Thank you

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