- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-30-2024 01:12 AM - edited 04-30-2024 01:15 AM
Use Case:
I have a UI Action and I want to hide/show it based on a field form value.
OR
How to rename UI Action in client script?
How to do this?
Thanks.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-30-2024 01:34 AM
Hi @ChezAndrewI0898,
Best practice and the easiest way would be to leverage the UI Action 'Condition' field.
A simple example and syntax would be as follows:
current.state == 3 // where the state field value is equal to 3. You can add additional conditions by simply using ''&&' current.fieldname etc
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-30-2024 01:44 AM
I tried this one, in the condition i set g_form.getValue(<fieldName>) == 'true' but both UI Action is displaying.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-30-2024 01:55 AM
As per my response (Robbie), the syntax you require is:
current.fieldname == true;
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
PS - @Anurag Tripathi - I hope you don't mind me replying here, it popped up on my 'activities'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-30-2024 01:57 AM - edited 04-30-2024 01:57 AM
No Worries mate. @Robbie
@ChezAndrewI0898 Just to add. UI Action conditions are always evaluated on the server side. So regardless of whether your ui action is servers side or client side you read the field values using Current.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-30-2024 01:34 AM
Hi @ChezAndrewI0898,
Best practice and the easiest way would be to leverage the UI Action 'Condition' field.
A simple example and syntax would be as follows:
current.state == 3 // where the state field value is equal to 3. You can add additional conditions by simply using ''&&' current.fieldname etc
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-30-2024 01:37 AM
To show/hide UI action you can use your logic in UI action condition ..
You can't rename a UI action in client side, May be you want to rename a field label something like below
g_form.setLabelOf('comments', 'Who is the requested for\'s AVP or VP?');
Please Mark ✅Correct if this solves your query and also mark 👍Helpful if you find my response worthy based on the impact.
Thanks
