Change field value on Save and Redirect

Home Forums General discussion Change field value on Save and Redirect

Viewing 3 reply threads
  • Author
    Posts
    • #33623
      Filipe Ribeiro
      Participant

        Hi Alex,

        Long time I don’t post nothing :). Hope everything is well.

        I’m looking for a solution for this need – Added an Save and Redirect (to DispForm) button but want to change a value of a certain field (dropdown) based on this button click and then move forward to dispform. How can I achieve this?

        Ps.: the regular save button must keep it’s normal function

        Thank you

      • #33635
        Alexander Bautz
        Keymaster

          Hi,
          Is this a redirect from NewForm or from EditForm?

          Alexander

        • #33639
          Filipe Ribeiro
          Participant

            Well I tryed out hiding Edit, Save and Cancel buttons in newForm tab, them added a footer with buttons and wrote their own JS managing field updates and firing spjs.dffs.check_Mandatory(); and spjs.dffs.triggerSave(); worked like a charm

            Hope it help others

            
            
            function NameOfFunction() {
                
                spjs.dffs.alert({
                    "title": "Title",
                    "msg": "Message text",
                    "ok":function(){
                         var allReqFieldsFilled = spjs.dffs.check_Mandatory();
                         if (!allReqFieldsFilled) {
                            spjs.dffs.alert({
                                "title": "Title",
                                "msg": "Message text",
                                "ok": function(){
                                    spjs.dffs.closeDlg(); 
                                },
                                "okBtnLabel":"Button Name",
                            });
                         }
                        else {
                            setFieldValue("FieldName", "Value"); //Dropdown options
                            spjs.dffs.triggerSave();             
                    },
                    "okBtnLabel":"Button label",
                    "cancel":function(){
                        spjs.dffs.closeDlg();
                    },
                    "cancelBtnLabel":"Button Label"
                });
               
            }
          • #33642
            Alexander Bautz
            Keymaster

              I’m glad you figured it out.

              Alexander

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