- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-22-2014 08:31 PM
Hi SN folks,
What can I use to configure a confirm pop up - when clicking cancel button on the change form. If user press cancel - It will ask confirmation, if press OK - cancel change- if cancel It must return to change form without cancelling the record.
Thanks for your help.
Solved! Go to Solution.
- Labels:
-
Service Mapping
- 56,673 Views
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-23-2014 08:50 PM
attachment seems not be working for me ....
this is the code ...
Note : check the 'client' checkbox and in 'onlick' field , paste this cancelTicket();
function cancelTicket(){
var answer=confirm("Are you sure you want to cancel this record?");
if (answer==true)
{
gsftSubmit(null, g_form.getFormElement(), 'cancel_change'); //MUST call the 'Action name' set in this UI Action
}
else
{
return false;
}
}
if(typeof window == 'undefined')
{
current.state = 8;
current.update();
action.setRedirectURL(current);
gs.addInfoMessage('The current change request has been cancelled.');
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-23-2014 09:19 PM
this should be a BR issue.. try activating debug and find the BR causing this .....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-23-2014 09:29 PM
Kalaiarasan,
Can you please explain this sentence?
if(typeof window == 'undefined')
What it supposes to do?
Thanks for all your help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-23-2014 09:38 PM
it is supposed to hold your server side script when you want to use both, client side and server side code to be executed by a UI action
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-20-2014 12:09 PM
Hello,
I have used some of the examples here on the Copy UI Action. Any idea why the code in answer=true would not work?
function copyTicket(){
var answer=confirm("Are you sure you want to copy this record?");
if (answer==true)
{
var chgID = current.sys_id.toString();
var newChange = new GlideRecord('change_request');
newChange.initialize();
newChange.requested_by = current.requested_by;
newChange.cmdb_ci = current.cmdb_ci;
newChange.type = current.type;
newChange.assignment_group = current.assignment_group;
newChange.assigned_to = current.assigned_to;
newChange.short_description = current.short_description;
newChange.description = current.description;
newChange.impact = current.impact;
newChange.priority = current.priority;
newChange.change_plan = current.change_plan;
newChange.test_plan = current.test_plan;
newChange.backout_plan = current.backout_plan;
newChange.u_reason_for_change = current.u_reason_for_change;
newChange.u_implementation_effect = current.u_implementation_effect;
newChange.u_verification_plan = current.u_verification_plan;
newChange.insert();
}
else
{
return false;
}
}
if (typeof GlideSysAttachment != 'undefined'){
GlideSysAttachment.copy('change_request', chgID, 'change_request', newChange.sys_id);}
else{
Packages.com.glide.ui.SysAttachment.copy('change_request', chgID, 'change_request', newChange.sys_id);
copychg();
gs.addInfoMessage('Change ticket ' + newChange.number + ' created.');
action.setRedirectURL(newChange);}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-20-2014 07:01 PM
first question, i haven't looked at the code yet.. but is the 'client' checkbox selected in the ui action????