Date Type Variable Format - 3 Months Validation

dharanikumar
Giga Guru

Hi All,

We have two variables on the catalog form Start Date & End Date

Difference between the variables can not be greater than 3 months.

For Example: If Start Date is 17-Jan-2024 then the End Date (I.e.., 16-Apr-2024) should be less than 3 months
If the user enters after 16-Apr-2024 it should throw an error.

ISSUE: Date type variable returns the below value 

dharanikumar_0-1705435750207.png

 

Logs: 

dharanikumar_2-1705435891088.png

 

How can we achieve this using this format.


Thank you!!

 

1 ACCEPTED SOLUTION

So have you looked into no code date validation at all? The article also contains an example of what you are after, only thing is the example is on hours, which you can just choose a different operator for.

View solution in original post

16 REPLIES 16

Hi Mark,

Thanks for the reply!!

My requirement is Start Date and End Date cannot be greater than 3 months.

Example: If Start Date is 17-Jan-2024 then End Date should be less than 16-Apr-2024.

Thank you!!

So have you looked into no code date validation at all? The article also contains an example of what you are after, only thing is the example is on hours, which you can just choose a different operator for.

Hi Atul,

 

There's no reason to script such. What's the reason for sharing a scripted solution and making things unnecessarily complicated and unmanageable?

Hi @Mark Roethof 

 

There are many ways to do a work , I agree scripting is not best always where work can be done without code. Giving option is not a bad choice.