How to call a process from a Freedom ListPage with more than one parameter?

Dear colleagues,

 

In a Freedom ListPage, I need to process all the records that a user selects and report the results at the end.

 

I'm having trouble figuring out how to approach this task. Currently, as I understand it, we call a process with the ID of the record to be processed.

 

Is there a way to know when all the selected records have been processed and know which ones?

 

I'm trying to implement a temporary table to insert the IDs of the selected records, but for this, I need to have a unique ID in that temporary table so that if there are multiple users doing the same thing, the current user's records are not mixed up. To do this, I've edited the code of the page where the service call is made to pass a second parameter to the process, an ID that I need to generate, but the generated ID is always the same "00000000-0000-0000-0000-000000000000":

			"parameterMappings": {
				"NotaCreditoID": "Id",
				"ProcesoID": Terrasoft.utils.generateGUID()
			},

 

What am I doing wrong with this approach?

 

Here is an excerpt of the modified code:

 

define("NdosNotasCredyDeb_ListPage", /**SCHEMA_DEPS*/["@creatio-devkit/common"]/**SCHEMA_DEPS*/, function/**SCHEMA_ARGS*/(sdk)/**SCHEMA_ARGS*/ {

 

"operation": "insert",
"name": "Button_ft2cncy",
"values": {
	"type": "crt.Button",
	"caption": "#ResourceString(Button_ft2cncy_caption)#",
	"color": "default",
	"disabled": false,
	"size": "large",
	"iconPosition": "only-text",
	"visible": true,
	"clicked": {
		"request": "crt.RunBusinessProcessRequest",
		"params": {
			"processName": "NdosLiberaDescartaNC_CC",
			"processRunType": "ForTheSelectedRecords",
			"showNotification": true,
			"dataSourceName": "PDS",
			"parameterMappings": {
				"NotaCreditoID": "Id",
				"ProcesoID": Terrasoft.utils.generateGUID()
			},
			"filters": "$Items | crt.ToCollectionFilters : 'Items' : $DataTable_SelectionState | crt.SkipIfSelectionEmpty : $DataTable_SelectionState",
			"sorting": "$ItemsSorting",
			"selectionStateAttributeName": "DataTable_SelectionState"
		}
	},
	"clickMode": "default"
},

 

On the other hand, has anyone done this in any other way? How?

 

Thank you very much

 

Julio

Like 0

Like

1 comments

I'm also tried sdk.generateGuid(), I test it on the console and returns a Guid, but for some reason the parameters is not delivered to the process, what's wrong?

Show all comments