UI action conformation

Shabbir1
Tera Contributor

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

 


current.assignment_group.setDisplayValue('404dxxxxxxxxxxxxxxxx');
current.update();
2 REPLIES 2

Karanth
Tera Contributor

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

 

 

SN_Learn
Kilo Patron
Kilo Patron

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);

}

SN_Learn_0-1721283039814.pngSN_Learn_1-1721283053159.png

 

 

Mark this as Helpful / Accept the Solution if this helps

 

----------------------------------------------------------------
Mark this as Helpful / Accept the Solution if this helps.