- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
I have a UI button with the following code in the client_script_v2
function onClick(g_form) {
g_modal.showFrame({
title: 'Select users to send the survey',
url: '/nothemeportal?id=bulk_send_onboarding_survey&workspace=true&sys_id=' + g_form.getValue('request_item'),
size: 'xl',
height: 500,
hasLoadingMessage: true,
autoCloseOn: 'URL_CHANGED'
});
}
Right now in the script i am calling a UI page which does exactly the same things the widget does in the portal page
function sendSurvey() {
var dialog = new GlideDialogWindow('customer_onboarding_send_survey'); //Ui Page
dialog.setTitle('Select Options');
dialog.setWidth(400);
dialog.setPreference('sysparm_reqItemSysID', g_form.getValue('request_item'));
dialog.render();
}
I want to avoid the duplication and call the portal page in the backend too (not in the workspace but directly in the table - form). How can I do this?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @vidhya_mouli ,
I have did similar requirement in my pdi , please review below points-
1. Created UI action Button- (In incident form)- Checklist- for example and i'm calling Ui page using Glide Model here is the screenshot and code-
Example Code-
function openShow(){
var id= g_form.getUniqueValue();
var dialog = new GlideModal("nksmwidgetcalling");
dialog.setTitle('Audit test');
dialog.setPreference("sysparam_id", id);
dialog.setPreference("sysparam_page" ,"testpage");
dialog.setBackdropStatic(true);
dialog.render();
}
2. Ui Page screenshot and code-
Code-
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<j:set var="jvar_pref" value="${sysparam_id}" />
<j:set var="jvar_page" value="${sysparam_page}" />
<div>
<iframe id="test" src="ithub?id=testpage" width="550" height="550"></iframe>
</div>
</j:jelly>Here i'm calling portal page to show in my model when user clicked on the ui action button
3 Output screenshot-
In this way you can call portal pages and it;s widget in backend as per your requirement
Hope this will help you !!
If you found my response helpful, please mark it as helpful and accept it as the solution.
Thank you
Nawal Singh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
in server side you can grab the URL and then extract the url parameter value
var ritmSysId = $sp.getParameter('ritm_sys_id');
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @vidhya_mouli ,
you are very close, here is the few points that you need to change-
1. pass the dynamic value from ui action(from i'm calling)
Code example -
Thank you
Nawal Singh