
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-27-2023 12:29 PM
I need a reference field (from a custom table) to be editable on the form only in a new record. After creating this record, the field must be read-only. I tried to do this through a Business Rule but it didn't work. What other way can I solve this problem?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-27-2023 12:35 PM
You can create a on load client script like below
(Modify below script to add backend name of your reference field in place of field_name)
function onLoad() {
var isNewRecord = g_form.isNewRecord(); // Check if the record is new
if (isNewRecord) {
g_form.setReadOnly('field_name', false); // Make the field editable
} else {
g_form.setReadOnly('field_name', true); // Make the field read-only
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-27-2023 12:35 PM
You can create a on load client script like below
(Modify below script to add backend name of your reference field in place of field_name)
function onLoad() {
var isNewRecord = g_form.isNewRecord(); // Check if the record is new
if (isNewRecord) {
g_form.setReadOnly('field_name', false); // Make the field editable
} else {
g_form.setReadOnly('field_name', true); // Make the field read-only
}
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-27-2023 01:10 PM
Hi @Manmohan K , the client script works. Thanks for the help!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-27-2023 01:08 PM
The recommended way is to create a write ACL on that field with this custom script in advanced part of ACL
answer = current.isNewRecord()
Please mark the answer as helpful if it meets your requirement. If you write client script, it can be still edited in list view and with some browser manipulation.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-09-2025 11:35 PM
Thanks , This is the best approach.