Auto-detect section page + recordId + schema name in Freedom UI and auto-add a button
Hi ,
I am working on a Freedom UI scenario where I need to perform an action on any record edit page (Contacts, Accounts, Leads, custom objects, etc.).
I need some guidance on how to achieve the following:
- Detect when a section record page is opened (Freedom UI)
- Automatically read the current page’s recordId and the entity schema name dynamically
- Automatically show a button in the Page Toolbar (without manually adding it on every section page)
- When the user clicks the button, I just need to call a REST service that uses:
- The requirement is that the user should not write any code and the button should auto-populate for all existing sections that have an detail.
I explored Freedom UI page events, environment context, Remote Modules, and client modules, but I could not find a clear example that lets me get both recordId and schema name dynamically for ANY section (Contacts, Accounts, Leads, custom objects, etc.) or inject a toolbar button programmatically across all pages.
👉 Is there any recommended way in Freedom UI to:
- globally detect the current entity/page context,
- retrieve recordId + schema name,
- and auto-add a custom action/button?
Any examples, API references, or best practices would be very helpful.
Thanks in advance!
Like
Hello Devapooja Manisha,
To obtain the record ID and schema name, you can refer to this community post.
If by "schema name" you mean the name of the page, you can get it using this.source.schemaName.
As for auto-add a custom button, buttons are visual components; there is no supported way to insert them. As a workaround, you can add the button to the base page (PageWithTabsFreedomTemplate). To do so you need to:
1. Enable/add the AllowCreateAngularSchema feature (<your_instance_name>/0/flags);
2. Re-login to your Creatio instance
3. Go to Configuration and create the replacing module for PageWithTabsFreedomTemplate using the "Angular replacing view module" option
There you can add your button, it will be displayed for all schemas that derived from PageWithTabsFreedomTemplate.
To control visibility of the button you can refer to Creatio Documentation.
Also, take a look at this article, it can be useful for your future implementation.