How to run a business process from a Freedom UI page button and pass both selected detail records and current page ID?
Hi Creatio Community,
I’m working on a Freedom UI page in Creatio (v8.2.x) and trying to implement the following scenario:
- I have a detail (DataGrid) with a list of certificates on the Activity page.
- I’ve also added a custom button to the page.
- When the user selects several records from the detail and clicks the button, I want to:
- Get the selected records (certificate IDs),
- Get the ID of the current activity (parent page),
- Pass both as input parameters to a business process (to link the selected certificates to the activity).
Using no-code tools alone, I was only able to pass either the collection or the current page ID, but not both at the same time.
Has anyone implemented a similar case?
Would appreciate any working example or best practices for this scenario.
Thanks in advance!
Like
Віталій Поліщук,
I see. I would assume it's possible to do via code, but I've not looked at how to pass a collection. I'd start with seeing what the request looks like for adding multiple rows to the process from the page designer, then see if you can duplicate that via code, getting the selected rows using:
const selectedIds = (await request.$context.DataTable_SelectionState).selected;
(Change "DataTable" to your list name)
If you pass the collection from the list, you have the parent ID already since it would have to exist in the list data. You should be able to get the parent ID by just reading the child data.
Ryan
Ryan Farley,
Hi Ryan, thank you for your reply!
You're right that if the certificates already had a reference to the activity, I could extract the parent ID from the collection itself.
However, in my case, the selected certificates do not yet have any relationship with the activity. The grid simply displays certificates (filtered by Account), but there’s no link between each certificate and the current activity record.
What I’m trying to do is:
- Let the user select multiple certificates from this grid,
- Then click a button to run a business process that will create the relationship between these certificates and the current activity,
- Which means I need to pass both:
- The selected certificate IDs,
- And the ID of the current activity page (which isn’t available in the certificate records).
So unfortunately, I can’t infer the parent ID from the child records — I need to explicitly pass both.
If you've come across a similar case in Freedom UI (v8.2+) and have any suggestions on how to pass both parameters to the process, I’d really appreciate it!
Thanks again
Віталій Поліщук,
I see. I would assume it's possible to do via code, but I've not looked at how to pass a collection. I'd start with seeing what the request looks like for adding multiple rows to the process from the page designer, then see if you can duplicate that via code, getting the selected rows using:
const selectedIds = (await request.$context.DataTable_SelectionState).selected;
(Change "DataTable" to your list name)
Ryan Farley writes:
Віталій Поліщук,
I see. I would assume it's possible to do via code, but I've not looked at how to pass a collection. I'd start with seeing what the request looks like for adding multiple rows to the process from the page designer, then see if you can duplicate that via code, getting the selected rows using:
const selectedIds = (await request.$context.DataTable_SelectionState).selected;
(Change "DataTable" to your list name)
Hi Ryan,
Thank you so much for your suggestion - that actually helped me better understand how the parent ID can be retrieved from the detail's data context. I'll explore this direction further and adjust my process accordingly. Really appreciate you taking the time to respond!