Tuesday, October 29, 2019

AX 2012 R3 - Fiscal year closing - Cannot close period when there are source documents remaining to be journalized with an accounting date within the period. Error


When you close a fiscal period from Ledger, an error might come up saying:
Cannot close the period when there are source documents remaining to be journalized with an accounting date within the period.

This error is due to corrupted lines in AccountingDistribution table, where you can filter out the records on the following basis and delete those records for the resolution:

Table: AccountingDistribution 
Range on AccountingDate field: 1/6/2018..30/6/2018 ( date range for fiscal period you are trying to close) 

Range on AccountingEvent : 0 (should be zero for corrupt entry)

AccountingLegalEntity: Should be recId of legal entity of accounting entries.

There must be hundreds of records which will be filtered out in this. You just need to delete these to get rid of corrupted entries.

Now you can proceed with fiscal period and year close, and it should not throw same error again.