Calculate end date from start date and No. of month in nav

Hi team,

I am working on page which contains Start Date, End Date and No. of Month. Am trying to write a code that when I inputted the Start Date (Date), No. of Month (Integer) , it should give End Date.

Start Date - OnValidate()
IF End Date" <> 0D THEN
  VALIDATE( End Date");
  

End - OnValidate()
IF "End Date" > "Start Date" THEN
"No. of Months" := ROUND(("End Date"-"Start Date")/30,1)
ELSE
"No. of Months" := 1;


No. of Month - OnValidate()


The above code worked for the calculate of No. of Month but I need for the End Date.

Thanks

You should use the CALCDATE function for this.

Something in the line of:
“End Date” := CALCDATE(STRSUBSTNO(’<%1M-1D>,“No. of Month”),“Start Date”;

// Alexander

Its working nw

“End Date” := CALCDATE(STRSUBSTNO(’<%1M>’,“No. of Month”), “Start Date”);