Show/Hide the choices of the field based on another field value...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2023 09:58 PM - edited 07-02-2023 11:13 PM
Hi Developers,
I need one script for the below requirement.
If the Asset Preservation field Value is empty or if the current user don't have an asset role, then 'Law Hold' option from Substate field should be hidden.
And this Law hold option is visible in ' In stock ' and ' In Transit ' states.
Tried this onChange client script on Asset preservation field..... but it is not working.. as expected
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-03-2023 12:19 AM - edited 07-03-2023 05:22 AM
Hello @Munna1
I think it could be very small thing you are missing. first g_user.hasRoleExactly works for explicit role and not if the user is admin.
also if you are writing on change on Asset Preservation field which has to be empty, the expectation is the user removes the existing option on Asset Preservation? Then substate law hold option to be removed?
refer this doc which explains about similar use case.
please hit the Thumb Icon and mark as Correct based on impact!!
Kind Regards,
Ravi Chandra.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2025 12:28 AM
You can achieve this using JavaScript by leveraging conditional logic based on the Asset Preservation field value and user role. Implementing dynamic field visibility enhances user experience and data integrity. Also, if you're interested in legal data trends, you might find Arrest Information Oregon useful for insights. Let me know if you need further assistance with the script!