Question

Passing the Record Id from edit page to Business process via code

Hi,

facing issue when we Need to pass record id of the Edit page record to a business process on custom button click. we are using Parameter in the business process and passing the record id from JS code. But getting "undefined" when we try to get the Id value.

 

Reference code:

    methods: {

            

                calCulateCRGScore: function() {

                    debugger;

                        var IdParameter = this.get("Id");

                            this.showInformationDialog(IdParameter);

               

                      var args = {

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

                   sysProcessName: "idlcCalculateCRGScore",

                    parameters: {

                        RecordId: IdParameter

                    }

                 };

               ProcessModuleUtilities.executeProcess(args);

               },

 

Like 0

Like

3 comments

Hi,

 

It depends on where the code is implemented (section page or edit page) and on other methods of this page. Please provide more details since the same logic works perfectly on my side

 

1) created a button on the ContactPageV2:

{
                    "operation": "insert",
                    "parentName": "LeftContainer",
                    "propertyName": "items",
                    "name": "TestProcess",
                    "values": {
                        itemType: Terrasoft.ViewItemType.BUTTON,
                        caption: {bindTo: "Resources.Strings.TestProcessButtonCaption"},
                        click: {bindTo: "onTestProcessButtonClick"},
                        "layout": {
                            "column": 1,
                            "row": 6,
                            "colSpan": 1
                        }
                    }
			},

2) added the click event method:

onTestProcessButtonClick: function(){
				var currentRecordId = this.get("Id");
				var args = {
                    sysProcessName: "Process_ebeeaf4",
                    parameters: {
                        ProcessSchemaContactParameter: currentRecordId
                    }
                };
                ProcessModuleUtilities.executeProcess(args);
			},

The result is:

Best regards,

Oscar

Oscar Dylan,

Hi Oscar,

 

Code in the Section page for calling button click: method implementation code in section page:     

 

  Result is :

 Getting "Undefined" when i try to get the id value:

 

BADRI YOGESH,

 

Hi,

 

You've added a button in combined mode. It means that you need to use "ActiveRow" to get the Id of the record you've opened:

And then you can pass this Id to the process call.

 

Best regards,

Oscar

Show all comments