Home › Forums › General discussion › Change field value on Save and Redirect
- This topic has 3 replies, 2 voices, and was last updated 4 years, 8 months ago by
Alexander Bautz.
-
AuthorPosts
-
-
May 26, 2021 at 16:26 #33623
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
-
May 27, 2021 at 16:48 #33635
Hi,
Is this a redirect from NewForm or from EditForm?Alexander
-
May 27, 2021 at 16:53 #33639
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" }); }-
This reply was modified 4 years, 8 months ago by
Filipe Ribeiro.
-
This reply was modified 4 years, 8 months ago by
-
May 27, 2021 at 18:21 #33642
I’m glad you figured it out.
Alexander
-
-
AuthorPosts
- You must be logged in to reply to this topic.