Hello,
I would like create multiple buttons that call a business process. Due to the number of buttons in my page, I would like to create a single button click method. This method would receive a parameter that would tell it which button was called. The parameter would then determine which field would be read.
My button method should look something like this:
onButtonClick: function(clickedButton){
var recordId = this.get("Id");
var readField = "Error"; //This value should change later, will show error otherwise
switch(clickedButton){
case "Button1":
readField = this.get("Field1");
break;
case "Button2":
readField = this.get("Field2");
break;
/*More Cases
.
.
.
*/
default:
console.log(readField);
break;
}
var config = {
sysProcessName: "UsrBpToCall",
parameters: {
CurrentRecordId: recordId,
ReadField: readField,
}
};
ProcessModuleUtilities.executeProcess(config);
}
I assume the parameter would appear in the diff section, but I do not know how to implement this functionality.
I appreciate your help!
Kind Regards,
Firas