Autopouplate UI page based on selected RITM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
6 hours ago
Hello Experts,
I want to autopopulate the UI page based on the RITM selection i.e. is a refernce field.
Cost center and Server should be autopopulated from RITM variables.
Below is My UI page.
This Ui page should trigger when Change request's state is Review it should Pop up the UI page on change form and click of Okay it should update description with UI page values.
Below is my HTML and client script.
HTML:
Client Script :
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
5 hours ago
you can do it, use a client script (onChange of the RITM ref field or via UI Action) to get the RITM sys_id, then call something like:
var dialog = new GlideDialogWindow('your_ui_page_name');
dialog.setPreference('ritm_sys_id', g_form.getValue('ritm_ref_field'));
dialog.render();
Inside the UI Page Jelly you grab the sys_id via RP.getWindowProperties().get('ritm_sys_id'), query sc_req_item and its variables via Jelly/GlideRecord to set default server_name & cost_center values, then let the OK button return values back to form via client script in UI Page which sets g_form.setValue on the original form fields....
If you found my response helpful, please mark it as ‘Accept as Solution’ and ‘Helpful’. This helps other community members find the right answer more easily and supports the community.
Kaushal Kumar Jha - ServiceNow Consultant - Lets connect on Linkedin: https://www.linkedin.com/in/kaushalkrjha/