The CreatorCon Call for Content is officially open! Get started here.

Hide/Show UI Action using UI Policy

Abhijit Das7
Tera Expert

Hi Everyone,

 

I want to hide/show UI Action using UI Policy. If status of record is deleted then it should hide UI action otherwise it should be visible.

 

UI Action:

Name = Knowledge Article

Action Name = instruct_knowledge

 

8881.JPG

 

I used above method, somehow it is not working.

 

cc: @Ankur Bawiskar @kamlesh kjmar 

 

Thanks in advance

16 REPLIES 16

Hi @kamlesh kjmar 

 

I cannot see alert message.

 

Thanks

So the issue is with the condition. Please check your condition of UI action. But at least one alert should have triggered. Did you put alert() in both the scritpt (execute if true amd execute if false) ? 

 

 

 

Hi @kamlesh kjmar 

 

Sorry, Now I am getting alert() in both type of script ( alert('hide') and alert('show')). They are perfectly working according to situation. But button is hiding.

@Abhijit Das7  I saw your previous screen shot, your UI policy was inactive that's why alert would not have triggered. But in case you activeted it and both your script sections are alerting as per condition and still button is not hiding then it would require debugging.

 

I tried same code in my PDI which I advised you and it's working perfectly fine for me:

 

kamleshkjmar_0-1668512912160.png

 

 

kamleshkjmar_0-1668512684118.png

 

 

Rgards,

Kamlesh

@Abhijit Das7 

modify script as this-> use the UI action name to search in the index and not the action name

so use Knowledge Article instead of instruct_knowledge in script

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader