How to check date in input form fields | Community
Skip to main content
Level 3
Jun 3, 2020 2:56 PM UTC
Solved

How to check date in input form fields

Hi all,

I had created custom field in delivery Input form.

While creating delivery if this field is empty , Pop up message should be displayed. I used below code in the input form.

Now I need to display alert message if the smsMessageExpiryDt less than current date.
Could you please suggest me , how to compare smsMessageExpiryDt with current date.

 

Thanks in advance.

 

Thanks,

Ram.

 

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
_Manoj_Kumar_
_Manoj_Kumar_Accepted solution
New Participant
Jun 4, 2020 7:37 AM UTC

Hello @ramprakasht3196 ,

This is the correct syntax,

<leave> <check expr="@smsMessageExpiryDt!='' and @smsMessageExpiryDt &gt;= GetDate() "> <error>Expiry date cannot be empty and should be in future</error> </check> </leave>

 

Testing screenshot here:

 

Thanks

     Manoj     Find me on LinkedIn

7 replies

_Manoj_Kumar_
_Manoj_Kumar_Accepted solution
New Participant
Jun 4, 2020 7:37 AM UTC

Hello @ramprakasht3196 ,

This is the correct syntax,

<leave> <check expr="@smsMessageExpiryDt!='' and @smsMessageExpiryDt &gt;= GetDate() "> <error>Expiry date cannot be empty and should be in future</error> </check> </leave>

 

Testing screenshot here:

 

Thanks

Translate
     Manoj     Find me on LinkedIn
Level 3
Jun 4, 2020 7:57 AM UTC
It is working fine.
Translate
Jyoti_Yadav
Level 8
Jun 4, 2020 12:38 AM UTC

Hi,

 

You can check it using below syntax:

 

<check expr="@smsMessageExpiryDt ='' or @smsMessageExpiryDt &lt; GetDate()"> <error>Expiry date cannot be empty and should be in future</error> </check>

 

 

Translate
_Manoj_Kumar_
New Participant
Jun 3, 2020 4:01 PM UTC

Hello @ramprakasht3196 

 

Try this code:

<check expr="@smsMessageExpiryDt !='' or @smsMessageExpiryDt < getDate()"> <error>Expiry date cannot be empty and should be in future</error> </check>

Let me know if that works 

Translate
     Manoj     Find me on LinkedIn
Level 3
Jun 4, 2020 6:51 AM UTC
I tried. But it doesn't work.
Translate