- 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:50 AM
Hi srinivas ,
Iapplied your code ,popup is working but when i am checking the ticket again the ticket is not cancelled so help me with this.
It should actually get cancelled when the person clicks on cancel and ok.
Regards,
Shristy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-14-2016 12:55 AM
Hi Shristy,
In the OOB confirmation box you wont get "Yes",and "No" button.You can get "Ok" and "Cancel" button there.
Thanks,
Mihir
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-14-2016 12:36 AM
Hi Shristy,
1.Create a on change client script on the state field.
2.Call a GlideDialogWindow from that script when state change to cancelled.In the GlideDialogWindow call a ui page which has two buttons yes and no.
3.Set value in the state field when user selects yes /no accordingly.You can set value directly from the client script of the UI page.
Please mark it as Helpful/Correct according to its impact.
Thanks,
Mihir
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-14-2016 01:01 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-14-2016 01:37 AM
you need to specify the field name where you want to set the old value
g_form.setValue('field_name',oldValue) ;