one filed on RITM Should be visible only while clicking on ui action button

jobin1
Tera Expert

Hi All,

I need to show one field called u_html_message on RITM  only when an ui cation called "View HTML" on RITM is clicked how can this be achieved so rest all the time u_html_message should be hidden

9 REPLIES 9

Allen Andreas
Administrator
Administrator

Hi,

You can create a UI Policy on the catalog item (but select that it only takes effect on the RITM, if that's your use case) with no condition and add that field to your Related UI Policy Actions tab and set Visible to false.

Then, within the UI Action itself, you can utilize client side scripting to then use:

g_form.setDisplay("field_name", true);

to show it, etc.

If your current UI Action was server side only, then here's a link on how to use both client and server side code in your UI Action, if needed: https://servicenowguru.com/system-ui/ui-actions-system-ui/client-server-code-ui-action/ 

 


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

Hi,

I see you're specifically replying to the other person helping, so I'll leave it at that since you may have a good direction you want to go. It was hopeful my reply above would guide you along.

It also seems that you have also added additional requirements that you hadn't mentioned in your original post. If possible, and to assist us all, please try to list everything you need help with regarding this specific question, in your main post above. This helps everyone get the latest information and not rely on reading through comments to find more information.

Take care! 🙂


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

Hi Allen
Thanks for helping marked as helpful. also, i have created a new query for the additional requirement i will mention u there please help.

Sandeep Rajput
Tera Patron
Tera Patron

@jobin1 Create an onLoad client script to hide the field u_html_message using g_form.setDisplay('u_html_message',false); 

Screenshot 2023-11-22 at 12.19.07 AM.png

Create a UI Action with following configuration and in script set g_form.setDisplay('u_html_message',true); 

Screenshot 2023-11-22 at 12.19.24 AM.png

Make sure that Client checkbox is checked on your UI Action.

 

Hope this helps.