Question

Error in the business process on clicking of active row

I am trying to call a business process on clicking of active row button(Call). I wrote the below code in section schema page.

Code :

define("UsrCandidates1Section", ["UsrCandidates1SectionResources", "terrasoft", "ControlGridModule",

"BaseProgressBarModule", "css!BaseProgressBarModule", "ProcessModuleUtilities","ProcessModuleUtilitiesResources"],

function(resources, Terrasoft, ProcessModuleUtilities)

{

"operation": "insert",

"name": "DataGridActiveRowOpenAction",

"parentName": "DataGrid",

"propertyName": "activeRowActions",

"values": {

"className": "Terrasoft.Button",

"style": Terrasoft.controls.ButtonEnums.style.BLUE,

"caption": "Call",

"tag": "Call",

"click": {

"bindTo": "onOpenPrimaryContactClick"

}

//Add a new swtich case parameter for the new button added on the active row

}

},

onOpenPrimaryContactClick : function()

{

var activeRow =this.get("ActiveRow");

if (activeRow) {

// Determining the base candidate record Id.

var primaryId = this.get("GridData").get(activeRow).get("Id");

alert(primaryId);

if(primaryId)

{

var args = {

// The name of the process that needs to be launched.

sysProcessName: "UsrTest",

// The object with the ContactParameter incoming parameter value for the CustomProcess process.

parameters: {

ProcessSchemaParameter1: primaryId

},

//callback: config.callback,

//scope: config.scope

};

debugger;

alert("test1");

ProcessModuleUtilities.executeProcess(args);

// Launch of the custom business process.

alert("test2");

}

}

},

While clicking on the Call Button the alerts which i kept before ProcessModuleUtilities.executeProcess(args) are getting executed.When alert("test1") got executed i am getting the below error.

 

 

Can you please let us know where the code went wrong.

Like 0

Like

1 comments

Dear Hemalatha,

The method you have indicated in the button click property does not get executed. This is due to the architecture of active row action buttons. In order fro the button to trigger your custom process you need to override the basic onActiveRowAction function on the section schema. 

Also, in order to distinguish your button from others add tag  property for the button and in the onActiveRowAction add if clause.

				onActiveRowAction: function(buttonTag, primaryColumnValue) {
						if (buttonTag === "myAction") {
							var activeRow = this.getActiveRow();
							var activeRowId = activeRow.get("Id");
							console.log(primaryColumnValue);
							console.log(activeRowId);
//add custom logic
						}
				},

Regards, 

Anastasia

Show all comments