How to check date in input form fields | Community
Skip to main content
Level 3
June 3, 2020
Solved

How to check date in input form fields

  • June 3, 2020
  • 3 replies
  • 5262 views

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.
Best answer by Manoj_Kumar

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

3 replies

Manoj_Kumar
Community Advisor
Community Advisor
June 3, 2020

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 

Manoj     Find me on LinkedIn
Level 3
June 4, 2020
I tried. But it doesn't work.
Jyoti_Yadav
Level 8
June 4, 2020

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>

 

 

Manoj_Kumar
Community Advisor
Manoj_KumarCommunity AdvisorAccepted solution
Community Advisor
June 4, 2020

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
Level 3
June 4, 2020
It is working fine.