UI action conformation
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2024 10:22 PM
Hi Team
Our requirement is- if user clicks on the Ui action button ("change group) on the RITM form we have to update assignment group to "Desk floor" ..i have created the UI action button it is working fine but how to show confirmation message "sure you want change the group" if yes action needs to trigger if no action need to stop can anyone help me in the script. I have used below script in ui action to update the group
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2024 10:47 PM
Hi @Shabbir1
Please see below and update the code in ui action
function resolveIncidents() {
var answer = confirm("Please ensure workaround field has been updated before resolving related incidents.");
if (answer == true) {
gsftSubmit(null, g_form.getFormElement(), 'resolveincidents');
} else {
return false;
}
}
if (typeof window == 'undefined')
resolveIncidentFunction();
function resolveIncidentFunction() {
current.assignment_group = "sysid"; //sysid fo the group
current.update();
action.setRedirectURL(current);
}
If my response proves useful, please indicate its helpfulness by selecting "Accept as Solution" and " Helpful."
Thanks,
Bhavya
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2024 11:11 PM
Hi @Shabbir1 ,
Please try the below, tested and working in PDI
function confirmAssign() { // this is function name called on the "onClick" field of UI action
if (confirm(getMessage("Sure you want change the group?"))) {
gsftSubmit(null, g_form.getFormElement(), 'update_assignment_grp'); // this is the "Action name" on UI Action
} else {
return false;
}
}
if (typeof window == 'undefined')
updatingAssignmentGrp();
function updatingAssignmentGrp() {
current.setValue('assignment_group','b85d44954a3623120004689b2d5dd60a'); //sysID of CAB approval, replace it with the Desk floor grp sysid
current.update();
action.setRedirectURL(current);
}
Mark this as Helpful / Accept the Solution if this helps
Mark this as Helpful / Accept the Solution if this helps.