Change field value on Save and Redirect
- This topic has 3 replies, 2 voices, and was last updated 5 years, 5 months ago by .
Viewing 3 reply threads
Viewing 3 reply threads
- You must be logged in to reply to this topic.
Home › Forums › General discussion › Change field value on Save and Redirect
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
Hi,
Is this a redirect from NewForm or from EditForm?
Alexander
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"
});
}
I’m glad you figured it out.
Alexander