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

Please mark the answer correct


Kalaiarasan Pus
Giga Sage

You can write entire scripts within the condition field, provided the script is within the max character limit of the field.



var tenDay = new GlideDateTime(current.start_date.getDisplayValue()); tenDay.addDays(10); var today   = new GlideDateTime(); (tenDay.getDisplayValue() < today.getDisplayValue());


divya mishra
Tera Guru

Hey Ajitha,



Could you please try the below code in your condition area:



current.end_date == gs.daysAgo(-10);



Do check the time field



Please Hit ✅Correct, ��Helpful, or ��Like depending on the impact of the response


Have a lovely day ahead




Regards,


Divya Mishra