- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2022 08:50 AM
UI Action : Create Button and write as script below code . there are four below scenario explain each scenario with scripting.
- Create one Button the incident form to create a new problem record and copy the short description and description and other field from incident to the problem table.
- Work-In Progress button won’t be visible when the ticket is about to be created. After creation of a record, the button should be visible
- There should be a button on incident form. When user click the button, system should update priority of incident to P1 and do not save the record.
- There should be a button on problem record to create 2 problem tasks automatically associated with the same problem.
Please Advise.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2022 08:12 PM
1. Write below code in UI action
var problemGr = new GlideRecord("problem");
problemGr.initialize();
problemGr.short_description = current.short_description.toString();
problemGr.description = current.description.toString();
//Set all other required fields as short description and description set above
problemGr.insert();
2. Un check the "Show insert" check box to not show the "Work in Progress" button when the ticket is about to create
Please mark as correct answer if this solves your issue.
ServiceNow Community Rising Star, Class of 2023
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2022 01:32 PM
These are pretty straight forward but please post what you attempted/tried and we will try to help you out.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2022 07:55 PM
I attempted all the questions use cases, I resolved 3rd and 4th , Not able solve output for question number 1 and 2.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2022 08:12 PM
1. Write below code in UI action
var problemGr = new GlideRecord("problem");
problemGr.initialize();
problemGr.short_description = current.short_description.toString();
problemGr.description = current.description.toString();
//Set all other required fields as short description and description set above
problemGr.insert();
2. Un check the "Show insert" check box to not show the "Work in Progress" button when the ticket is about to create
Please mark as correct answer if this solves your issue.
ServiceNow Community Rising Star, Class of 2023