g_form.setDisabled not making checkbox variable grayed out on platform view
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2024 05:53 AM
I have on change catalog client script to make checkbox variable grayed out using g_form.setDisabled function.
Same function making checkbox grayed out in portal view but in internal view not working.
Is there any restriction g_form.setDisabled() function don't work on platform view.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2024 11:07 AM
@shikha Gandhi Did you try g_form.setReadOnly()? please see if it works.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2024 11:38 AM
Hi @shikha Gandhi ,
This method is used to disable the field and make it unavailable when boolean value in true and enable and avaialalbe when boolean value in false.
But, if we want that field only become read only then we can use:
g_form.setReadOnly(string fieldname, booleanvalue);
Please chcek image for reference
Please mark my answer correct and helpful if this works for you
Thanks and Regards
Sarthak
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-20-2024 02:00 AM
Already tried g_form.setReadOnly(), still same issue working in platform view not in internal view.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-17-2024 09:11 AM
Hi @shikha Gandhi,
This can easily be achieved by leveraging the g_form API and .setReadOnly() method.
Use the below syntax as appropriate:
g_form.setReadOnly('field_name', true); //Use true to make the field read only. (Alternatively, swap the value of true to false to make the field editable again)
To help others (or for me to help you more directly), please mark this response correct by clicking on Accept as Solution and/or Kudos.
Thanks, Robbie