- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2024 04:03 AM
scenario on incident form I want to show a pop with OK or Cancel if click on OK, an incident will be created if click on Cancel not able to create an incident what is the approach to achieve this?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2024 07:09 AM
Hi @Anjali yadav1 Use on submit client script you can achieve this functionality
I have tested in my PDI attached screenshot below.
Mark it Helpfull and Accept the Solution . If this helps you to understand.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2024 05:44 AM
Hi @Anjali yadav1 ,
var con = confirm("<Message in your confirm box>");
if (con == true) {
// raise the incident
} else {
//cancel case
return false;
}
Try something like this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2024 02:20 AM
hello thanks for replying,
Should I use the code in the client script or in the script blank (system definition)?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2024 05:52 AM
Hi @Anjali yadav1 ,
You can achieve this by using the 'confirm' in the script of the UI action.
Note: You need to check the client checkbox to true to utilize this.
Sample code is as below:
var ans = confirm('Do you want to create an Incident?');
if (ans == true) {
var newIncRec = new GlideRecord("incident");
newIncRec.initialize();
newIncRec.setValue("caller_id", g_user.getUserID());
// newIncRec.setValue("short_description","TestDescription");
newIncRec.insert();
}
else {
return false;
}
Please mark this as correct answer and helpful if it resolved, or mark this helpful if this help you to reach towards solution.
Mark this as Helpful / Accept the Solution if this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2024 07:09 AM
Hi @Anjali yadav1 Use on submit client script you can achieve this functionality
I have tested in my PDI attached screenshot below.
Mark it Helpfull and Accept the Solution . If this helps you to understand.