- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-23-2022 07:36 PM
Hii All,
I have a requirement.
1. Create a new Category 'Service Request'.
2. Create Service Catalog with name 'Service Request for Incidents' with variables - Requestor(Type - Reference), Category (Type - Choice; with same options as in Incident), Short Description(Type - String), Description(Type - String), Currency( Type - Currency).
3. Create UI Action 'Çreate SR' which should be visible only when category is 'Service Request'.
4. On click of this button , it should redirect to catalog created in point no.2 and variables(Caller in Requestor, Category , Currency, SHort Description) should be auto- populated in catalog page with values available in Incident form.
-->I have done 1,2&3 points.
-->im struck at 4th point.
-->please help me in the 4th point how to sort it out.
Thanks,
anjaneyulu.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-24-2022 10:25 AM
Ok thanks - so the reason requester is not getting populated is the name of your variable is actually 'requester', so I updated line 5 of your onLoad 'Incident details' catalog client script accordingly and it is now working:
g_form.setValue('requester', caller);
URL: https://dev89219.service-now.com/sp?id=sc_cat_item&sys_id=75732e4b1b564110dc0f40c6cc4bcb67&sysparm_caller=6fadf5f21bca0110dc0f40c6cc4bcb6b&sysparm_category=Service%20Request&sysparm_shortDescription=wert
Screenshot:
I also went back and set all the choices you created for your Category variable to have Inactive = true since they are no longer needed due to Choice table/field configuration, and this resolved the duplicate Service Request choice issue as well.
If this answer is helpful please mark correct and helpful!
Regards,
Christopher Perry
Regards,
Chris Perry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-23-2022 10:28 PM
Hii Shloke,
I don't Know why ui action is not performing any action & it is not redirecting portal.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-24-2022 04:41 AM
Please refer to my screenshot above. It will work as I have tested it before posting the reply here to make sure it works.
Please do not mix with other responses which you have got. Follow the instruction mentioned by me above and it will work out for you as it is a tested code.
Say if you want this for a particular category then just add the condition in UI Action as below:
current.category == 'Value you want to check'
Regards,
Shloke
Regards,
Shloke

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-24-2022 04:48 AM
Hi Shloke,
My code is tested as well and it works too... we basically have provided the same solution.
Regards,
Chris Perry

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-23-2022 07:45 PM
Hey Anjaneyulu,
Could you please copy and paste the script from your UI action?
Regards,
Christopher Perry
Regards,
Chris Perry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-23-2022 07:57 PM
Hi Christopher Perry,
I have not written any script in ui action.
Thanks,
Anjaneyulu.