callback function from UI page always returning false
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-30-2024 01:09 AM
Hello All,
I have created a UI page which should open in workspace and on click of cancel button, I need clear all the field and close the current window.
I am using a on change client script for this
Here am getting false always when clicking on cancel and continue button?
How can I get get on click on cancel get false and continue button get true value so that I can do my validation?
g_modal.showFrame({
url: "sn_customerservice_s.do?sysparm_stacks=no&sysparm_workspace=" + true + "&sysparm_sys_id=" + g_form.getValue("u_installed_base_item"),
size: 'lg',
height: '56vh',
title: '',
callback: function(confirmed, data) {
alert(confirmed);
g_form.setValue("account","");
}
});
/* v
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-30-2024 01:48 AM
Did you check any OOB UI actions which invokes modal and uses callback
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-30-2024 01:53 AM
Yes and also go through below two article as well as everywhere its UI action.
I am not getting any result even though used same way.
https://snpro.dev/2023/11/20/workspace-modals-working-with-ui-pages/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-30-2024 01:52 AM
check this link and you will get some clarity on how callback functions work with UI pages in workspace
How to use UI Actions in Workspaces
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-30-2024 01:55 AM
I am not using UI action and its onchange client script.