Recently I had a look at an error that occurred on a custom journal posting routine. It was somewhat similar the journal allocations by looking at existing transaction to make adjustment. What I didn’t know is the account structure has changed. An error popped up: Account structure X for the combination x-x-x-x-x, is not valid for the ledger X. When ever using ledger dimensions don’t just stamp the LedgerDimensionRecId. Use this method to resolve the RecId in the current account structure for the current company. toLedgerDimension = DimensionDefaultingService::serviceCreateLedgerDimension(fromLedgerdimension); I had to do a quick unit test to prove this. Below is a job that converts. Code: static void resolveLedgerDimension( Args _args) { //My expected values are //Dimension display value = '1.1.4.2.03--' //Account structure and dimension From RecId - Brazil - 52565566264 //Account structure and dimension Resolved RecId - Brazil SI - 2256553...
All things Microsoft Dynamics 365 Finance and Operations