How to find account structures for particular main account?

HI All,

I am working on AX 2012 R2.

I have more than 500 main accounts and more than 20 account structures are there.

And all account structures are assigned to various companies.

Now I have 10 list of main accounts and I want to find out the account structures for each main account .

Kindly suggest.

Thanks

Hari

There is an existing method - \Data Dictionary\Tables\DimensionHierarchy\Methods\getAccountStructure
this returns only one account structure related to a main account.
Look into this method. You can reuse the select statement inside it to fulfill your requirement.

Thanks for your Reply,

The above method only retrieve one account structure that too if I provide recid of particular legal entity from ledger table and recid of main account from main account table .

In my case I have only list of main accounts and recid of the main accounts, and I have to find all account structures of the main accounts.

If you have any idea please suggest.

Thanks
Hari

I have already explained the intention of that method.
You need to take the select in that method as reference.
May be you have to convert it into a while select and remove the condition on _ledgerRecId (in the respective where clause)