Restrict Visibility of UI Macro

Ravi56
Giga Contributor

Hi All,


I have created a UI Macro which basically adds an icon   next to reference field on incident form. On click of this icon,user will be redirected to list of change records.Now I want to show/hide this UI macro based on priority of incident.


Any inputs on how to achieve this?

1 ACCEPTED SOLUTION

Gurpreet07
Mega Sage

I hope you have been assigned ids to the HTML elements you created in UI Macro. You could make use of those element ids in an onLoad or onChang priority client script to hide the macro.


gel("element_id").style.display = "none" ;


View solution in original post

7 REPLIES 7

Steven,



  Open your form in chrome, then press cntrl+shift+C and then click on the element you want to inspect as shown below. In the console you will see all the attributes of the elements


find_real_file.png




Thanks,


Abhinay



PS: Hit like, Helpful or Correct depending on the impact of the response


yes, i understand this part,   but i'm not actually finding the element_id


i've tried several things that i thought may be the element id but it's not working.



can you show me part of your script?


Hi Steven,



Here the id of the element is getting generated dynamically and stored in variable jvar_n . What I will suggest is to write the code of your macro inside a <div> and assign id to that div. Now use that id to hide the whole macro.