Have you experienced when posting, then you got this error?
The Posting Date is not within your range of allowed posting dates.
Usually, this is because the Posting Date in the transaction is falling outside of the Allowed Posting Date.
But in this case, we have checked and confirmed that the Posting Date is OK. So, what is the problem?
Please check the Inventory Setup, for Automatic Cost Adjustment. If it is other than “Never”, then we can be sure that the error message is coming from the Adjust Cost Item Entries (ACIE) process.
So, the solution is to run the ACIE process first, then back to post the transaction again.
But, wait. I don’t know, what Date should I open.
Let’s change some code to better inform that:
Codeunit 21 Item Jnl.-Check Line
LOCAL CheckAllowedPostingDate(ItemJnlLine : Record "Item Journal Line")
... IF ("Posting Date" < AllowPostingFrom) OR ("Posting Date" > AllowPostingTo) THEN ERROR(InformativePostingDateRangeErr, "Posting Date"); //Add this line //FIELDERROR("Posting Date",Text001) //Remove this line
With Text Constant: InformativePostingDateRangeErr: The Posting Date %1 is not within your range of allowed posting dates.
This way, we get the better informative error message:
The Posting Date 28-01-21 is not within your range of allowed posting dates.
Better, isn’t it?
This code is intended for NAV 2018. If you are newer, you can read here.