Date validation in data contract

Hi when i write contract class with from and todate is it necessary to validate the date coz i get error saying that validate

method is missing.

Is it by default standard funtionality of AX 2012 to validate date parameter if yes how do i by pass it.

I fixed the title of your thread, but unfortunately I still don’t understand your question.

no its not,

when you are getting this error?

I think you have implement SysOperationValidatable interface , thts why you are getting this error

yes kunal you are right it implements SysOperationValidatable then what do i replace it with?

remove it, no need to implement it

Hi Vinesh,

I am not sure what you are asking.

  1. AX validates the entered date is valid or not. Please use the date EDT as the return type of the dialogParmMethod.

For example use TransDate EDT for date param

[DataMemberAttribute(‘TransDate’)]
public TransDate parmTransDate(TransDate _transDate = transDate)
{
transDate = _transDate;
return transDate;
}

  1. If you want to validate the date range like ToDate should be greater than FromDate, override the validate method of the contract class and write the code like below

public boolean validate()
{
boolean isValid = super();
fromDate = this.getValue(#FromDate);
toDate = this.getValue(#ToDate);
if(fromDate && toDate)
{
if(fromDate > toDate)
{
isValid = checkFailed("@SYS120590");
}
}
return isValid;
}

Thanks,

Hari

thank you all for ur lightning fast reply i got what i wanted… have a good day & gr8 weekend!!!

Can you please verify the solution, please? The thread is still shown as open. Thank you.