- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sunday
In serice operation workspace for incident there is a declarative action called
"Create change request" when clicked on it it opens the change rfc page to select which type of change request i want to create either normal or emergency once i select anything and create a change request its parent should get filled as the incident number but it is not doing that ideally this should do right as we are creating the change from the incident.
Declarative action link
https://yourinstance.service-now.com/sys_declarative_action_assignment.do?sys_id=20aec8ab23323010148...
https://yourinstance.service-now.com/sys_ux_form_action.do?sys_id=64639c7a233230101488dc1756bf65f0&s...
@Ankur Bawiskar can you let me know what can be done to fix this issue?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Monday
that's OOTB behavior
g_form object only works if the field is present in that view
You can do this
-> let it be on form view i.e. workspace
-> populate it and then hide it
💡 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
Monday
when I was checking, I found this is the URL
So you can do string manipulation
-> check if the source record is /now/sow/record means it's starting point, then check if URL contains chg_model
-> then do string manipulation and grab the incident sysId which is 32 character
-> also remember the parent field should be on workspace form view so that your client script sets it
💡 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
Monday
Hello @Ankur Bawiskar ,
I have written the below script and it worked.
Let me know if you think this is correct or not.
Regards,
Debasis
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Monday
Glad to know that my approach worked for you.
Looks fine to me, good to go.
💡 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
Monday
Hello @Ankur Bawiskar ,
i have observed one thing.
if the parent field is not added to the form then its setting it as blank.
if the parent field i am adding to the form its working fine.
So i wonder if we do not add the field on the form. How we can achieve this then?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Monday
that's OOTB behavior
g_form object only works if the field is present in that view
You can do this
-> let it be on form view i.e. workspace
-> populate it and then hide it
💡 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
