- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-24-2023 05:24 AM - edited ‎08-24-2023 12:39 PM
Hi,
I have created a scoped application which does not extend any other table. I have created a read, write, create, and delete ACL to allow roles to perform these actions on records in the application.
I would now like make some of the fields read-only upon submission of a record, I have tried to do this via a Client Script using the below:
function onSubmit() {
g_form.setReadyOnly('short_description', true);
}
However the field doesn't get changed to read only, even if I change it to onLoad it does not work.
I then tried creating a UI Policy and found that the field briefly changes to read-only before quickly changing back to editable, making me think that it is the ACLs that are overwriting the field.
I have a table level write ACL that gives write access to all roles which I suspect is causing the issue however if I remove this then all of the fields become read-only/uneditable.
How can I make it so that my users still have access to all other fields but some are made read-only on submission?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-25-2023 02:33 AM
I found that this issue was being caused by a conflicting data policy that was overwriting the field being set to read-only. I have now addressed this and the above methods work correctly.
Thanks for everyone's help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-24-2023 09:44 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-25-2023 12:11 AM
Hi Maik,
I tried changing g_form.setReadOnly to g_form.setDisabled but nothing changes. I think it must be ACL related.
Rich
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-24-2023 10:15 PM
Hello @Ryax1 ,
There is spelling mistake in code its should 'setReadyOnly', kindly use on load script with following code.
function onLoad() {
//Type appropriate comment here, and begin script below
g_form.setReadOnly('short_description',true);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-25-2023 12:11 AM
Hi Sunny,
Apologies I think that must've been a typo when I created the community post. I double checked the code in my instance and it is set to 'setReadOnly'.
Thanks
Rich