Ui Action button show/hide based on condition

Indu14
Giga Contributor

Hi,

I would like add a button using UI action and it should be visible only when end date is Today+10 days.

í�n Detail:

When ever end date is great than 10 days by Today's date.i want to show button on form.

So for this i have written a condition in UI action as below

current.end_date==gs.now+10

Can anyone help me how to write this validation in UI action condition.

Thanks & Regards,

Ajitha I

1 ACCEPTED SOLUTION

HarshTimes
Tera Guru

Hi Ajitha


Try below code. I think this should work. Also, please confirm if the UI action is in global scope or any other scope.If global then below code should work fine. But I am not sure If the below code will work in scoped application. You can try.



current.end_date <= gs.daysAgo(10)


View solution in original post

7 REPLIES 7

preddy
Kilo Guru

Hi Ajitha,



Plesae create Script Include and Call that script include in UI action condition..


Dave Smith1
ServiceNow Employee
ServiceNow Employee

Plesae create Script Include and Call that script include in UI action condition..


That's an overkill.   It simply needs the correct criteria in the "Condition" field to determine if it should be shown or not.



"Simplicity -- the art of maximizing the amount of work not done -- is essential" - from http://agilemanifesto.org/principles.html


HarshTimes
Tera Guru

Hi Ajitha


Try below code. I think this should work. Also, please confirm if the UI action is in global scope or any other scope.If global then below code should work fine. But I am not sure If the below code will work in scoped application. You can try.



current.end_date <= gs.daysAgo(10)


Thanks it is working