I am writing a job to create a depreciation journal for a fixed asset . So while inserting values for offset account i am getting the following error!
offsetLedgerDim = DimensionStorage::getDynamicAccount(“607200”,LedgerJournalACType::Bank);
jourTrans.OffsetLedgerDimension = offsetLedgerDim;
can anyone help me to resolve the error.
You might have selected the account that doesn’t exists. Does the bank account 607200 exists?
The account that i specified exist in bank account !!!
But it is not retrieving !!!
If so, try to debug this part DimensionStorage::getDynamicAccount(“607200”,LedgerJournalACType::Bank);
and see why the error comes.
The error doesn’t say that the bank account doesn’t exist, it says it doesn’t exists as a dimension value. If the account wasn’t ever used as a dimension value, there is no record for it in DimensionAttributeValue table. Nevertheless I see that getDynamicAccount() (at least in my version) already calls findByDimensionAttributeAndValue() with _createIfNecessary set to true, therefore it should be created automatically - and debugging will show you why it doesn’t work.
It may not mean it, but if you use an account that doesn’t exists will result the same error.
thank you everyone I found the solution
ledgerDimension = AxdDimensionUtil::getMultiTypeAccountId(enumNum(LedgerJournalACType),LedgerJournalACType::Ledger,[607200,607200]);