alert modal out of box got it button not working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi All,
The alert modal out of box got it button is not working in the UI builder. The behavior is not consistent, I have 3 alerts modals, one for select location, second one for billing profile and third one for network coverage, the configuration and events are same except message. It is working for second and third and first one it is not working. I have created the script to invoke this in the above sequence, it is not working for first one. Following is the script. Below is the script that invoke the alert modal from the button.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago - last edited 3 weeks ago
Hello @ahmed786
helpers.modal.open -> you can only display one modal at a time. If a modal is currently open, opening another hides the previous one: https://www.servicenow.com/docs/r/washingtondc/api-reference/ui-builder-api-reference/helpersAPI.htm...
What happens here is:
helpers.modal.open('select_location'); // alert opens
User clicks Got it
Modal UI disappears
Modal framework still thinks a modal is open
Next time a modal is requested → ignored silently
Why the other two work:
They occur after an emit / rerender
UI Builder context refresh partially resets modal state
So better to use a Confirm Modal as explained here: https://www.servicenow.com/community/next-experience-blog/ui-builder-essentials-modals-and-modeless-...
Hope that helps!