Adding a button that runs a business process in the portal user profile page
I was creating a button that runs a simple business process that sends a mail.
The problem is after altering the schema of the Portal user profile and adding a button the business process doesn't run nor gets mentioned in the process logs for tracing.
here are the codes used in the schema to run a bp in the portal contact page :
define("SspProfileContactPage", ["ProcessModuleUtilities","css!UsrCSSPortalProfile"], function(ProcessModuleUtilities) {
return {
....
methods: {
OnClickTest: function(){
var args = {
sysProcessName: "UsrProcess_e179057",
parameters: {
test: "testing"
}
};
ProcessModuleUtilities.executeProcess(args);
this.showInformationDialog("Busniess process triggered");
},
...
diff...
...
"operation": "insert",
"name": "UpdateButton",
"parentName": "Tabc34c9c60TabLabelGroup654f02cd",
"propertyName": "items",
"values": {
"itemType": Terrasoft.ViewItemType.BUTTON,
"caption": "Update Info",
"style": Terrasoft.controls.ButtonEnums.style.BLUE,
"click": {
"bindTo": "OnClickTest"
},
//"tag": "OnClickTest",
"hint": "TEST BUTTON"
},
Like
Hello,
I've used the same code in the demo application and the process was triggered. Maybe the process is not logged in the process log ("Enable logging" in the process settings in the process designer) or you receive some actual error in the console when starting the process. You need to check if the code of the schema doesn't contain duplicates of methods or errors as well. The complete code from my side:
define("SspProfileContactPage", ["ProcessModuleUtilities", "css!UsrCSSPortalProfile"], function(ProcessModuleUtilities) { return { mixins: {}, entitySchemaName: "Contact", messages: {}, details: /**SCHEMA_DETAILS*/{}/**SCHEMA_DETAILS*/, diff: /**SCHEMA_DIFF*/[ { "operation": "insert", "name": "UpdateButton", "parentName": "GeneralInfoTab", "propertyName": "items", "values": { "itemType": Terrasoft.ViewItemType.BUTTON, "caption": "Update Info", "style": Terrasoft.controls.ButtonEnums.style.BLUE, "click": { "bindTo": "OnClickTest" }, "hint": "TEST BUTTON"} }, ]/**SCHEMA_DIFF*/, attributes: {}, methods: { OnClickTest: function(){ var args = { sysProcessName: "UsrProcess_b0eee32", parameters: { test: "testing" } }; ProcessModuleUtilities.executeProcess(args); this.showInformationDialog("Busniess process triggered"); }, }, rules: {}, userCode: {} }; });
Hey Oleg,
I also made sure that the logging was already enabled and the process did not start.
And made sure that all portal users can run this process from the process properties in the process library.
I am trying to add this button in the portal user profile page. After altering the page it created a schema where the entitySchemaName is empty by default.
...
entitySchemaName: "",
attributes: {},
...
Serge,
When replacing a schema I usually take the content of the original schema and make it empty (mean empty methods, empty attributes and so on). For the SspProfileContactPage the entitySchemaName is Contact and you can see it in the SspProfileContactPage schemas from base packages. This can be also an issue in case you have this entitySchemaName empty. Also try using the code I sent that worked on my side (but modify the process code).
Oleg,
I have used your code and modified the process code
and also tried it a new replacing view model with empty method and empty attributes ...
even used the "debugger;" to check if the code is running and it is.
still the same issue.
I am using Creatio version 8.0.6.3429
what version did you use your code on ?