Make a field mandatory based on state & substate on Asset form?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-20-2024 04:25 AM
Hi all,
I am trying to make 'Disposal reason' field mandatory when state is 'Retired' & substate is 'Disposed'. I tried writing an UI policy and client script, unfortunately it dint work not sure why. Attached screenshot for reference. Any guidance would be much appreciated.
As you can see I have written the UI policy and clients script on 'alm_asset' table I even tried on 'alm_hardware' table but no luck.
Thanks
Rini
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-20-2024 04:37 AM - edited ‎11-20-2024 04:40 AM
Hi @Rini1 ,
Update the if condition.
and close the If loading check with "}"
keep the below code out of loading check condition
if(g_form.getValue("substatus") == "disposed" ){
g_form.setMandatory("disposal_reason",true);
}
Reply with full script code if its not working for you, also in client script i don't see any check for retired status.
-Thanks,
AshishKM
Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-20-2024 04:49 AM - edited ‎11-20-2024 04:52 AM
Hello @Rini1
Create a Ui policy on table 'alm_hardware'. Refer the screenshot below for more details:
Screenshot1: Configuration setup of UI policy
Screenshot1: Configuration setup of UI action in UI policy
Result:
Hope this helps!
"If you found my answer helpful, please like and mark it as an "accepted solution". It helps others find the solution more easily and supports the community!"
Thank You
Juhi Poddar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-20-2024 05:00 AM
Hi Rini
make ui policy -- choose the condition state is retired and substate is disposed. after saving the from then you can see below ui policy action. In action you can select disposal reason is mandatory true.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-09-2025 04:16 AM
We had issues with the substates creation on the hardware table and we raised a Hi ticket and they sorted the issue.
Thank you all!