I have an requirement like
User will enter the Date Manually in the StartDate Field.
After that he will enter the No of Months in Eff Months field.
In Enddate filed should update automatically based on the start date.
Start date is assume Today :(i.e 05-03-2012)
Eff month is :3
End date should upadate as :16-06-2012(Automatically).
Can any one help me how to achive this functionality.
You can use standard functions such as nextMth, nextQtr, nextYr etc.
You can also use calendar functionality for this purpose. Small code below -
static void testCalendar(Args _args)
while select WorkCalendarDate
if (year(WorkCalendarDate.TransDate) == 2012
&& mthOfYr(WorkCalendarDate.transDate) == 3)
info(strFmt(‘No of days in March 2012 is %1’, noOfDays));
I got the solution,
Transdate calcDate(TransDate _effDate,
int counter = 1;
int mm, dd, yy;
tmpdate = _effdate;
while (counter <= _months)
_effDate = nextMth(_effDate);
mm = mthofyr(_effdate);
yy = year(_effDate);
dd = dayofMth(tmpdate);
_effDate = mkdate(dd, mm, yy) + _days;
return (_effDate - 1);
in the FormDatasource-EffMonths field i have called my method.
TblName.Enddate = element.calcDate(TblName.StartDate,TblName.EffMonths,0);