Create Standard Change from RITM and set Change parent as RITM reference
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2025 10:57 AM
Hello Everyone,
I'm having a requirement to Create Standard Change from RITM and set Change parent as RITM reference.
I did created below UI action which takes me to the standard change templates landing page,
var url = new StdChangeUtils().getURLForTask(current, 'rfc');
url += '&ritm_sys_id=' + current.sys_id;
action.setRedirectURL(url);
In this script, i am injecting ritm_sys_id into the URL and trying extract it & populate the parent field on the change form with the RITM reference.
However the below onLoad client script is not working as expected. Any suggestion/advice are welcome.
Below is the client script i am using to parse the URL,
if (!gForm.isNewRecord()) return;
try {
var fullUrl = window.location.href;
var match = fullUrl.match(/[?&]ritm_sys_id=([0-9a-f]{32})/);
if (match && match[1]) {
var ritmSysId = match[1];
gForm.setValue('parent', ritmSysId);
}
} catch (e) {
console.error('Error extracting ritm_sys_id:', e);
}
Has anyone implemented any similar solution, show some light on this.
Thanks
Arun
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2025 12:23 PM
Check this post - Solved: How to Create Standard Change from RITM and relate... - ServiceNow Community
You just need to scroll a little bit to see the script provided by Author.