Show Mandatory fields and alert from UI Action
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2024 04:44 AM
I have a UI Action to cancel record ,that needs to make 2 fields as mandatory[hidden by default] and once they are filled , then show an alert message.Is this possible ? Apart from the clicking of button , there is no other scenario that I can use to do this via UI Policy ?
function cancelTicket() {
g_form.setMandatory('cancelrecord', true);
g_form.setMandatory('closure_comment', true);
var answer = confirm("Confirm you wish to cancel the record");
if (answer == true) {
gsftSubmit(null, g_form.getFormElement(), 'cancel_record'); //MUST call the 'Action name' set in this UI Action
} else
{
return false;
}
}
if (typeof window == 'undefined')
{
current.stage = 'Cancelled';
current.status = 'Closed';
current.update();
//Cancel workflow context
var grWf = new global.Workflow();
grWf.cancel(current);
action.setRedirectURL(current);
gs.addInfoMessage('The current audit request has been cancelled.');
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2024 05:18 AM
Hi,
You can also sue onchange client script to trigger the alert.
in the script check both fields are populated. You will need 2 onchange client scripts (one for each field), in both you will check the value of both fields and if they are both filled in then you trigger the alert.
2 Scripts are needed because you cant be sure what field will the user fill first, so you have to check on both