We've updated the ServiceNow Community Code of Conduct, adding guidelines around AI usage, professionalism, and content violations. Read more

UI Action Fix UI Model sometimes popup it's not opening properly

Not applicable

Sometimes it's opening like this:

AbdulKhader_2-1712059940319.png

Default it will be like this:

AbdulKhader_3-1712059972530.png

Ui action script:

function onFix() {
if (g_form && g_form.mandatoryCheck()) {
ScriptLoader.getScripts("ProblemModalUIHelpers.jsdbx", function() {
ProblemModalUIHelpers.onFix();
});
}
}

Ui page function script:

ProblemModalUIHelpers.onFix = function() {
var view = g_form.getViewName();
if (!g_form.hasField("state")) {
getMessage('Cannot proceed to fix the Problem as \'State\' is not visible', function(msg) {
g_form.addErrorMessage(msg);
});
return false;
}

g_form.setValue("state", g_scratchpad.STATE.FIX_IN_PROGRESS);
if (g_form.mandatoryCheck()) {
g_form.save();
return;
}

g_form.clearMessages();
var sysId = g_form.getUniqueValue();
var ob = new ProblemModalUIHelpers();

var formValues = {
state: g_scratchpad.STATE.FIX_IN_PROGRESS
};
ob.openModal('start_fix_dialog_form_view', getMessage('Fix'), 850, formValues, "move_to_fix_in_progress");
};

0 REPLIES 0