Thanks for your response. Please don’t follow my code. I just wanted to know how to validate whether selected date is in between two other dates from another table. How to write between operator in AX.
In sql ,I used to write
If( Date 1 >= Date A) && (Date1 < = DateB)
Same way if I write in AX ,
public boolean validateWrite()
startdt = str2Date(“05/01/2016”, 213);
enddt = str2Date(“05/31/2016”,213) ;
ret = super();
select maxof(caeStartDate) from caepr1 where caepr1.Worker == this.Worker && this.caeVoid==0;
if(this.caeVoid == 0)
If (this.caeStartDate < caepr1.caeStartDate)
ret = ret && checkFailed(“Please select the Max Date”);
if((this.caeStartDate >= startdt)&&(this.caestartdate<=enddt))
ret = ret && checkFailed(“Please select the Max Date for void”);
Compilation was successful. When I click on the check box caevoid for the selected date which is NOT inbetween two dates, Still it doesn’t give any validation message.
Data as follows
caestartdate = 04/29/2016
CAEVoid = 1
When the user selects April 29 which is not in between May1st and May 31 and selects caevoid check box, on closing the screen it accepts. But actually it should throw validation message saying "Please select the Max Date for void
For testing purpose I have put the 2 dates hardcoded inside a variable rather than pulling from another table.
With the debug option I have an issue with my system. That’s the reason am not able to check.
I hope my description would b more precise that before. If not let me know.