How to find unposted transactions- close a period

Hi guys,

I try to close a period but got below error. I check all the transaction and wouldn’t find any unposted transactions. Is there any clever way to find opentransactions?

I am using AX 2012 Feature Pack

You cannot close financial period Period 7 because it is referenced by open transactions. You must post, delete, or change the transaction date of the open transactions before you can close the financial period.

Cheers

dear suzyan

please open new job and type this code and change the period name from fiscal calender period #

static void LKLGrootboekPeriodeAfsluitingWD(Args _args)

{

AccountingDistribution accountingDistribution;

FiscalCalendar fiscalCalendar;

FiscalCalendarPeriod fiscalCalendarPeriod;

FiscalCalendarPeriod _currentPeriod;

Ledger ledger;

counter teller =0;

counter tellervoor =0;

counter tellerna=0;

;

while select accountingDistribution

{

tellervoor++;

}

select * from _currentPeriod where _currentPeriod.RecId==5637147130; //Replace RecID by FiscalCalendarPeriod recID of affected period

if (_currentPeriod)

{

ttsBegin;

while select forUpdate RecId from accountingDistribution

where accountingDistribution.AccountingDate >= _currentPeriod.StartDate &&

accountingDistribution.AccountingDate <= _currentPeriod.EndDate &&

accountingDistribution.AccountingEvent == 0

exists join ledger

where ledger.PrimaryForLegalEntity == accountingDistribution.AccountingLegalEntity

exists join fiscalCalendar

where fiscalCalendar.RecId == ledger.FiscalCalendar

exists join fiscalCalendarPeriod

where fiscalCalendarPeriod.FiscalCalendar == fiscalCalendar.RecId &&

fiscalCalendarPeriod.RecId == _currentPeriod.RecId

{

//nable the row below to automatically delete the record

AccountingDistribution.doDelete();

teller++;

}

ttscommit;

while select accountingDistribution

{

tellerna++;

}

info(strFmt(“Amount of records before the problem record(s) were deleted from table Accountingdistribution: %1”,tellervoor));

info(strFmt(“Deleted: %1”,teller));

info(strFmt(“Amount of records after the problem record(s) were deleted in table Accountingdistribution: %1”,tellerna));

if(tellervoor-teller==tellerna)

{

info(“Check: OK!”);

}

else

{

info(strFmt(“Check: Error! Before %1 - deleted %2 is not %3 (result after deletion)”,tellervoor,teller,tellerna));