In an approval workflow I want to set the button text dynamically and set the ‘Stage’ field value depending on the stage I am advancing to:
var stage = fd.field(‘Stage’).value;
switch(stage) {
case ‘Define’:
fd.control(‘Submit’).onclick = ‘fd.field(“Stage”).value = “Research”;fd.save();’;
break;
case ‘Research’:
fd.control(‘Submit’).onclick = ‘fd.field(“Stage”).value = “Conceptualization”;fd.save();’;
break;
case ‘Conceptualization’:
fd.control(‘Submit’).onclick = ‘fd.field(“Stage”).value = “Execution”;fd.save();’;
}
I read the posts on Set Value and then Save
Custom button to change a field and save the form
and ’ Default Column Value not appearing in Form, and unable to run Async PnP in BeforeSave
Tried to do that in spBeforeSave but still no luck.
Any help would be great!