- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-16-2017 05:11 AM
Hi,
I have added a new Choice Field on my Change Request form called Submitted As and is open for users to select a drop down option.
Once the change has been submitted I was this field to become Read Only.
A change would be classed as submitted when the state changes to Open or is Work In Progress.
Any Ideas?
Thanks
Riaz
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-17-2017 04:17 AM
Thanks for all your help.
I ended up with a simple UI Policy which changes it to Read Only when the state is not Draft.
This is fine for us.
Thanks,
Riaz

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-16-2017 05:15 AM
Hi Riaz,
This requires an ACL (security rule)
You can use the GlideRecord method isNewRecord() to determine if the record has been saved or not. In you case, you want to grant the field write permission if current.isNewRecord().
Docs: Access control rules
Docs: Contextual security
Security Best Practices - ServiceNow Wiki

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-30-2018 08:51 AM
I think this is the correct answer. If we look into from the security standpoint, ACL is actually restricting the field from editing in the database, rest all are client side restriction.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-16-2017 05:15 AM
Hi Riaz,
You can use a onLoad Script with conditions,
if(g_form.isNewRecord){
g_form.setReadOnly('field_name',false);
}
else{
g_form.setReadOnly('field_name',true);
}
Regards,
Shariq
Mark correct and helpful if it works

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-16-2017 05:17 AM
Keep in mind that client side security is not secure. A clever user with a minimum of browser knowledge can change a read-only field that has been set with client scripts or UI policies. To ensure compliance, use server side security whenever possible.