- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-05-2024 03:47 AM
Hello,
I am trying to prevent users from editing their records after they were submitted.
Here is a preview of the record:
All the fields should be read-only:
Here is the client script I have created but it does not work as expected:
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-05-2024 03:54 AM
So on existing record they should not be allowed to edit?
then simply update the IF statement as this -> use ! so that the IF runs for existing record and makes fields readonly
if(!g_form.isNewRecord()){
// your code
}
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-05-2024 03:54 AM
So on existing record they should not be allowed to edit?
then simply update the IF statement as this -> use ! so that the IF runs for existing record and makes fields readonly
if(!g_form.isNewRecord()){
// your code
}
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader