How to Check Multiple Mandatory fields in UI action

RudhraKAM
Tera Guru

I have a use case in UI action if the fields are empty we need to abort the action and display mandatory message  ,, we already has UI policies for making mandatory for those fields , but when i click on UI action it is ignoring the mandatory conditions 

 

function close(){



var dialogClass = window.GlideModal ? GlideModal : GlideDialogWindow;
var gDialog = new dialogClass('close2_record');
gDialog.setTitle('Publish ' + g_form.getValue('display_name') + ' to record Catalog');
gDialog.setPreference('sysparm_sys_id', g_form.getValue());
}