Is there a bug in BankAccountStatement.openingBalance()

Is there a bug in BankAccountStatement.openingBalance()

Post by dm1hcmlub3 » Fri, 01 May 2009 17:54:01


We are using Dynamics AX 4.0 SP2 for Eastern Europe.

In the BankReconciliation_RU form the openningBalance field get its value from
the openningBalance() display method in the BankAccountStatement table.

This is the code in the display method:

//BP Deviation Documented
display AmountCur openingBalance()
{
BankAccountStatement bankAccountStatement;
AmountCur openingBalance;
;

if (!hasFieldAccess(tablenum(BankAccountStatement),
fieldnum(BankAccountStatement, EndingBalance), AccessType::View))
throw error("@SYS57330");

select reverse EndingBalance from bankAccountStatement
order by AccountStatementDate, AccountStatementNum
where bankAccountStatement.AccountId == this.AccountId
&&
bankAccountStatement.AccountStatementDate <=
this.AccountStatementDate &&
bankAccountStatement.RecId != this.RecId;
if (bankAccountStatement.AccountStatementDate ==
this.AccountStatementDate)
{
while (bankAccountStatement.AccountStatementNum >
this.AccountStatementNum)
{
next bankAccountStatement;
}
}
if (bankAccountStatement)
{
openingBalance = bankAccountStatement.EndingBalance;
}

return openingBalance;
}


I believe it should be:

select reverse bankAccountStatement

instead of

select reverse EndingBalance from bankAccountStatement
 
 
 

Is there a bug in BankAccountStatement.openingBalance()

Post by dm1hcmlub3 » Fri, 01 May 2009 21:20:01

I figured it out. The code is OK.
It was problem with the test data.