- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-16-2023 02:07 PM
Hello SN experts,
I have a very simple request to restrict the 'Urgency' and 'State' fields on the incident form when in Self Service ('ess') view. I have a dictionary override on those fields and also wrote an onLoad client script (unchecking the 'Global' checkbox and on view field = ess) to accomplish this but it is not working. The fields are editable regardless of view. Can someone please tell me what I am doing wrong or if there is a better way to accomplish this. I've also tried to restrict those fields via UI Policy but that had no impact to the fields either.
My Script:
function onLoad() {
//By Default the 'urgency' and 'state' fields can be edited
g_form.setReadOnly('urgency', false);
g_form.setReadOnly('state',false);
//Check current view
var currentView = getView();
//If user is using 'ess' [Self Service] view then make 'urgency' and 'state' fields readonly
if(currentView == 'ess'){
g_form.setReadOnly('urgency',true);
g_form.setReadOnly('state',true);
}
}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-16-2023 03:50 PM
This problem happens because there is another UI Policy running on this table and it is making the fields editable again.
There are two alternatives to deal with this:
1- Check which UI Policy is conflicting and change its conditions.
2- Change the order of your Police UI to a high value like 999999, forcing it to be the last to run and consequently leaving the read-only field.
If my answer helped you, please mark my answer as helpful.
Vanderlei Catione Junior | LinkedIn
Senior ServicePortal Developer / TechLead at The Cloud People
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-31-2024 12:22 PM