Announcements
Hello All,
I'm creating a PO thorugh X++, Once the PO line is created, creating the accounting distribution record for the particular PO line.
But, during the creation of accounting distribution, I need to pass the Ledger dimension - Main account column value for accounting distribution, the way standard behaves/works.
It works on certain rules based on Category, Category relation & other records which are available on 'Posting' form for Purchase order.
Does anyone have idea about how do I fetch the main account values the way standard works.
Thanks in advance.
Regards,
Kedar
Hi Manish,
Thanks for your response and help.
During my analysis I found the same and using method present in InventPosting.
Hi Kedar,
you will need Vendor posting profile and Items posting as well I believe.
You can find the main account for Vendor like :
mainAccount = LedgerDimensionFacade::getMainAccountFromLedgerDimension(VendLedgerAccounts::summaryLedgerDimension(VendAccount)).MainAccountId;
Get dimensions :
while select DefaultDimension, DisplayValue, Name from defaultDimensionView where defaultDimensionView.DefaultDimension == purchTable.DefaultDimension { dimValueContract = new DimensionAttributeValueContract(); dimValueContract.parmName(defaultDimensionView.Name); dimValueContract.parmValue(defaultDimensionView.DisplayValue); dimensionList.addEnd(dimValueContract); }
For item posting accounts you can use methods like
InventPosting::findByRelationsFromParameter() or InventPosting::findByAccountTypeAndItemCode()
André Arnaud de Cal...
294,110
Super User 2025 Season 1
Martin Dráb
232,866
Most Valuable Professional
nmaenpaa
101,158
Moderator