While I am Selecting Calculate Structure Values in Purchase order or Invoice.I am Facing the error

Question Status

Suggested Answer
ramapandian asked a question on 14 Nov 2017 1:13 AM

You cannot base a date calculation on an undefined date.

Date: 0D
Formula: 1M.

While running the Debugger it flows in to GST Management Code Unit 

IF PostingDate < CALCDATE('<1M>',LastClosedDate) THEN
ERROR(
STRSUBSTNO(
PeriodClosedErr,CALCDATE('<-1D>',CALCDATE('<1M>',LastClosedDate)),
CALCDATE('<1M>',LastClosedDate)));
GSTAccountingPeriod.GET("Accounting Period Start Date");
END ELSE
ERROR(AccountingPeriodErr,PostingDate);
END;

Reply
Suggested Answer
Ishan Patel responded on 14 Nov 2017 3:56 AM

Please check if the accounting period for the calculation date is closed?

Reply
Suggested Answer
Robertas Rackauskas responded on 19 Nov 2017 8:21 AM

Hi,

judging by the error it looks like LastClosedDate is blank (0D) and NAV cannot add date formulas to blank dates. I would say it's the issue with the code, as system should check if the LastClsoedDate is not blank before trying to call CALCDATE with it. If that's a standard Codeunit with no mods, it's worth checking for cumulative updates with the fix.

Robertas

Reply
Suggested Answer
Manish Sharma responded on 20 Nov 2017 4:27 AM

You need to create GST accounting period for the previous month and close it.

This is because system is checking for if the gst settlement is posted for the previous month.

Reply
Suggested Answer
Ishan Patel responded on 14 Nov 2017 3:56 AM

Please check if the accounting period for the calculation date is closed?

Reply
Suggested Answer
Robertas Rackauskas responded on 19 Nov 2017 8:21 AM

Hi,

judging by the error it looks like LastClosedDate is blank (0D) and NAV cannot add date formulas to blank dates. I would say it's the issue with the code, as system should check if the LastClsoedDate is not blank before trying to call CALCDATE with it. If that's a standard Codeunit with no mods, it's worth checking for cumulative updates with the fix.

Robertas

Reply
Suggested Answer
Manish Sharma responded on 20 Nov 2017 4:27 AM

You need to create GST accounting period for the previous month and close it.

This is because system is checking for if the gst settlement is posted for the previous month.

Reply