Is there a way to always retrieve the IDs of all the selected records from a list?
Hi Community,
We have a list of records, and we want to execute a process that receives a list of the IDs of the selected records.
Currently, this logic works as expected when we select a few records, for example, if we select two records, we receive the IDs of those two records.
However, when we select all records, the process does not receive any IDs. After reviewing how the list of IDs is generated, we noticed that when all records are selected, the logic is reversed: only the unselected records have their IDs included in the list.
Is there a way to always retrieve the IDs of the selected records, even when all records are selected?
Thank you.
Best Regards,
Pedro Pinheiro
Like
Hi Community,
I've managed to solve this requirement by following the solution described by Harvey Adcock in the post Getting & Acting on Multi‑select Records in Creatio Freedom UI | Community Creatio.
Basically, the approach involves extracting the filter from the grid detail and using it in a separate query on the same object to retrieve the record IDs.
Best Regards,
Pedro Pinheiro
Retrieving the selected property only works with the loaded records, and records are only loaded in pages of 30 records at a time - so you won't get all.
Instead of retrieving the selected property, you could instead bind to the list's data source and use a collection param in the process to receive the result? See here for no code approach: https://customerfx.com/article/launching-a-process-for-multiple-records…
Or via code, include the following in your request to crt.RunBusinessProcessRequest (make sure your datasource name is PDS or change below, also that the List is named DataTable, or change below). Note: in my process I have a collection parameter named "Accounts" with a single unique identifier property named "AccountId":
"dataSourceName": "PDS", "parameterMappings": { "Accounts.AccountId": "Id" }, "filters": "$Items | crt.ToCollectionFilters : 'Items' : $DataTable_SelectionState | crt.SkipIfSelectionEmpty : $DataTable_SelectionState", "sorting": "$ItemsSorting", "selectionStateAttributeName": "DataTable_SelectionState"

Hi Community,
I've managed to solve this requirement by following the solution described by Harvey Adcock in the post Getting & Acting on Multi‑select Records in Creatio Freedom UI | Community Creatio.
Basically, the approach involves extracting the filter from the grid detail and using it in a separate query on the same object to retrieve the record IDs.
Best Regards,
Pedro Pinheiro