Trigger UI Builder Page modal using Client Script[sys_ux_client_script]
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
Hi Team,
I have a quick question, I have created three Modal on the page on click of a button first modal will appear which has choice field based on the choice either modal two or three should popup,
my current approach is i have created a client state parameter which stores the value of choice and trying to popup the modal based on value through the client script but unable to do it.
is there any other way through which we can achieve this like i saw something called conditional trigger through event based I am not sure how do we setup this.
Please let me know if is there a way to call modal using client script or how do i solve this issue
Thank you
Prajwal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
Hi @pgvaishnav ,
Let's create a client script like this,
/**
* @param {params} params
* @param {api} params.api
* @param {any} params.event
* @param {any} params.imports
* @param {ApiHelpers} params.helpers
*/
function handler({
api,
event,
helpers,
imports
}) {
helpers.modal.close();
if (event.payload.value == 'user') {
helpers.modal.open("[component-id$='second_modal']");
//here replace the second_modal with the id of your second modal
} else {
helpers.modal.open("[component-id$='third_modal']");
//here replace the third_modal with the id of your third modal
}
}Execute the above client when choice is selected in first modal,
If my response helped, mark it as helpful and accept the solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
36m ago
Hello @pgvaishnav ,
can you elaborate your issue or share some screenshots ??
In my case I had called client script parameter by updating
As soon as button clicked update the client state parameter by passing the values (sys_id's) :
Then as soon as btn clicked pass the updated client state parameter and update the values :
If my response helped mark as helpful and accept the solution.
