Get a first look at what's coming. The Developer Passport Australia Release Preview kicks off March 12. Dive in! 

Error msg "There are multiple UI Policies with the same Order for this field - their run order is not predictable"

jamesgo
Giga Contributor

When I am updating an existing Wizard UI Policy, I got an error msg saying "There are multiple UI Policies with the same Order for this field - their run order is not predictable", it is followed by 3 UI policies with same name(and with same sys_id...) see the screeshot below.

When I click on any one of them, it leads me to an similar UI policy with no table associated with it...

Does anyone have seen this before?

5 REPLIES 5

CapaJ
ServiceNow Employee

Ha, I'll bet someone else fixed it for Catalog UI Policies recently, and either forgot or didn't know about Wizards. Here's the entire modified script I have:



policyActionConflicts = function() {
if (current.active == false)
return "";

if (current.ui_policy.nil())
return "";

var gr = new GlideRecord(current.getTableName());
gr.addNotNullQuery("ui_policy");
if (current.getTableName() == "sys_ui_policy_action") {
gr.addQuery("table", current.table);
gr.addQuery("field", current.field);
}
if (current.getTableName() == "catalog_ui_policy_action") {
gr.addQuery("catalog_item", current.catalog_item);
gr.addQuery("catalog_variable", current.catalog_variable);
}
if (current.getTableName() == "expert_ui_policy_action") {
gr.addQuery("expert", current.expert);
gr.addQuery("expert_variable", current.expert_variable);
}
gr.addQuery("ui_policy.active", "true");
gr.addQuery("ui_policy.order", current.ui_policy.order);
gr.query();
if (gr.getRowCount() <= 1)
return "";

var answer = "";
while (gr.next()) {

if (answer != "")
answer += ", ";
answer += "<a class='web' href='sys_ui_policy.do?sys_id=" + gr.ui_policy.sys_id + "'>";
if (!gr.ui_policy.short_description.nil())
answer += gr.ui_policy.short_description;
else
answer += "(" + gs.getMessage("empty") + ")";
answer += "</a>";
}
return answer;
}