How to hide an UI Action once planned start date and time passed

Upender
Giga Expert

Hi,

A field Planned Start date which of datetime field type, Revert Change button are on the form. My requirement is to hide Revert Change button once Planned Start date and time is passed.

I tried this condition

current.start_date <= gs.nowDateTime()

but it is not working.

Any suggestions.

Thanks in advance,

Upender

1 ACCEPTED SOLUTION

Upender
Giga Expert

To hide UI Action when planned start date and time passed.



current.start_date.getDisplayValue()>=gs.nowDateTime()


View solution in original post

8 REPLIES 8

Try this in the UI conditions:


(current.state == -4 || current.state == -2) && (current.type == 'emergency' || current.type == 'normal' || current.type == 'standard') && current.start_date >= gs.nowDateTime()




Andrew,


If you write this condition


current.start_date >= gs.nowDateTime()


1. Button will appear on the form after start date is past


2. Button is hidden from the form if the start date field is empty



current.start_date <= gs.nowDateTime()


1. Button will be hidden on the form even before start date and time is started. Because by the time you select date and time is selected and saved current date and time is passed (as we are using = sign)



2. Button is shown on the form if the start date field is empty



As per my understanding


system is not comparing start date and time and current date and time. It is only checking with current date and time.



My requirement is to hide UI action once start date and time is passed not current date and time passed.


Upender
Giga Expert

To hide UI Action when planned start date and time passed.



current.start_date.getDisplayValue()>=gs.nowDateTime()


Hi Upender

 

The following is my condition as you suggested in UI Action

 

(current.approval=='not requested' || current.approval=='rejected' && gs.hasRole("itil")) && current.start_date.getDisplayValue()>=gs.nowDateTime()

 

However this is not working. Please Suggest