Making a field mandatory in a pop-up

Ear19
Giga Expert

I have a requirement when promoting an incident to major to make both fields on the pop-up mandatory.  When promoting to major there is a UI Button that is selected.  Currently one of the fields work notes is already set as a mandatory field.  I now need the field business impact to also be a required field.  I have looked everywhere in the UI button script and cannot find were the field work_notes was made a mandatory field in the first place to copy that and do the same for the additional field.  Could anyone steer me in the right direction?  I am totally lost.  

 

See UI Button Script: 

function promptForPromoteMIC() {
if (!g_form.getControl('work_notes')) {
getMessage('Cannot promote major incident candidate as "Worknotes" is not visible', function(msg) {
g_form.addErrorMessage(msg);
});
return false;
}

var dialog = new GlideModal('sn_major_inc_mgmt_mim_workbench_promote', false, 848, 350);
getMessage('Promote to Major Incident', function(msg) {
dialog.setTitle(msg);
});
ScriptLoader.getScripts('/scripts/incident/glide_modal_accessibility.js', function() {
dialog.template = glideModalTemplate;
dialog.on('bodyrendered', function(event) {
glideModalKeyDownHandler(event, dialog.getID());
});
dialog.setPreference('WORK_NOTES', g_form.getValue('work_notes'));
dialog.setPreference('BUSINESS_IMPACT', g_form.getValue('business_impact'));
dialog.setPreference("focusTrap", true);
dialog.render();
});
}

if (typeof window == 'undefined')
promoteMIC();

function promoteMIC() {
var mim = new sn_major_inc_mgmt.MajorIncidentTriggerRules(current);
mim.approveMIC();
action.setRedirectURL(current);
}

1 REPLY 1

Vamshi dhar
Kilo Guru

Hi Earl,

var dialog = new GlideModal('sn_major_inc_mgmt_mim_workbench_promote', false, 848, 350);

The above highlighted UI/Portal page is opening when you click on the UI action Button. So open that portal/UI page and check in the client script section. We will doing fields mandatory in Popup's by making use of client script in UI/Portal pages.

 

If your issue is resolved, please don't forget to Accept the solution and mark it as Helpful

 

Thanks

Vamshidhar