- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-02-2015 06:08 AM
Any reason why Mandatory field in UI policy actions is read-only in Scoped applications..
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-09-2015 12:46 AM
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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-02-2015 06:21 AM
Thanks for the update. I can confirm that this is not the OOB behaviour.
Right click on the mandatory field and make sure that it is not set read only from the dictionary.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-02-2015 06:28 AM
I checked in Dictionary, it is not set to read-only.
This is the onload client script written in UI policy action table
function onLoad() {
limitUIPolicyActionsOnLoadOnOutOfScopeTables();
}
function limitUIPolicyActionsOnLoadOnOutOfScopeTables() {
var tableName = g_form.getValue("table");
if(!isTableInScope(tableName)) {
g_form.setReadOnly("mandatory",true);
} else {
g_form.setReadOnly("mandatory",false);
}
}
function isTableInScope(tableName) {
if(tableName == "")
return true;
var allowedTables = g_scratchpad.inScopeTableList;
for(var i = 0;i<allowedTables.length;i++) {
if(allowedTables[i] == tableName) {
return true;
}
}
return false;
}
-------------------------------------------------------------------------------------------------------------
Scratchpad variable is defined in the below script:
var FetchAllowedScopedTables = Class.create();
FetchAllowedScopedTables.prototype = {
initialize: function() {
},
fetchAllowedScopedTables: function () {
var scopedTables = GlideSystemUtilDB.getInScopeTables();
var allowedTables = [];
var numScopedTables = scopedTables.size();
for(var i=0; i<numScopedTables; i++)
allowedTables.push(scopedTables.get(i));
var scopedDBViews = GlideSystemUtilDB.getInScopeDBViews();
var numScopedDBViews = scopedDBViews.size();
for(var i=0; i<numScopedDBViews; i++)
allowedTables.push(scopedDBViews.get(i));
g_scratchpad.inScopeTableList = allowedTables;
g_scratchpad.isGlobalScope = !GlideSystemUtilDB.isScopedApp();
},
type: 'FetchAllowedScopedTables'
};
--------------------------------------------------------------------------------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-02-2015 06:30 AM
In the above script if we see, all the scoped tables are stored in the scratchpad "g_scratchpad.inScopeTableList" .This is not allowing the mandatory field to be editable in UI policy action table.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-02-2015 06:31 AM
I think that's causing the issue: the script. your setting the field values to read only. And your ui pol says to leave it alone.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-02-2015 06:45 AM
These scripts are available in the Fuji instance by default. It is not created by any user.