Why is Mandatory field in UI policy actions read-only in Scoped application?

Priya Shekar
Giga Guru

Any reason why Mandatory field in UI policy actions is read-only in Scoped applications..

1 ACCEPTED SOLUTION

Hi All,



Got solution for this issue.


1. We can make a field mandatory created within the scoped app thro client scripts, regardless the table created within the scope or not.


2. We can make a field mandatory created within the scoped app thro UI Policies, only when the table is also created within the scope.



Thanks,


Priya


View solution in original post

15 REPLIES 15

Hi Priya,



Thanks for the update.Can you point me to the instance so that I can debug further. Also please confirm can I hop(with extra permissions) to your instance to debug it.


Hi Pradeep,



You can find the below scripts in all Fuji instance, it is available in the personal developer instance as well.



Client Script         : disable mandatory onload for outofscope


Business Rule : FetchAllowedScopedTables


Script Include   : FetchAllowedScopedTables



Thanks,


Priya


Hi Priya,



Thanks for the update. Can you point me to the instance where you are able to reproduce this behavior.


Hi Priyadarshini,



Its by design. After all scoped apps are meant to run with in their boundaries. They should not impact any existing functionality.



Even you cannot write, g_form.setMandatory on a field that is not part of your scope. look at what i got when i tried attempting it.




Screen Shot 2015-09-03 at 7.08.16 pm.JPG


You might have read this Creating a UI Policy - ServiceNow Wiki already. Below are the lines I am copy pasting from there directly.


----------


Create UI policies to dynamically change information on a form. You can create UI policies for tables and database views that are in the same scopeas the UI policy and for other tables that have at least one field in the same scope as the UI policy (starting with the Fuji release). For tables that are in a different scope than the UI policy record, you can create UI policy actions only for fields in the same scope as the UI policy, and you cannot make a field mandatory or define scripts.


------------


Hi Srinivas,



I am trying to make a field mandatory which is created within the scope.


Its not allowing for that as well, that's my issue.



Thanks,


Priya