- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-14-2016 12:19 AM
Hi All,
I have the requirement that : On the incident form their is incident status code as cancelled.
When the user clicks on that i want a pop up saying : " Do you want to cancel this incident " and two buttons should be their i.e., Yes or no.
If user clicks yes the ticket should get cancelled and if he clicks no then it should remain in the same page.
Kindly provide your input.
Regards,
Shristy
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-14-2016 03:09 AM
Hi shrishty,
Try this code
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
var value = g_form.getValue('incident_state');// field name
if(value==12) // field value
{
if(confirm("Do you want to cancel"))
{
g_form.save();
}
else
{
g_form.setValue('incident_state',oldValue);
}
}
}
Regards,
Raveena Bhatia
PS:Mark this answer as correct or useful or hit like
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-14-2016 12:32 AM
Hi Shristy,
This could be done in following steps.
1. Create an onChange Script for 'Incident Status Code' field
2. Display a new GlideDialog window using script .
3. The Dialog window should point to a UI Page having these two buttons.
4. Return false if user select 'No' else return true.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-14-2016 12:33 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-14-2016 12:34 AM
Hi Shristy,
You can write a onChange() client script for that field you should check the value of list is cancelled or not.
You can add the confirm('message to be displayed ') for the popup
Regards,
Raveena Bhatia
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-14-2016 12:34 AM
Hi Shirsty,
You need to write a onchange client script on the incident status field with confirm box. With something like below
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
if(g_form.getValue('u_incident_status_code')=='what ever the status code value for cancel replace it')
{
if(!confirm("Do you want to cancel the ticket"))
g_form.setValue(oldValue);
}
//Type appropriate comment here, and begin script below
}
Thanks
Srinivas