HI,
I am using AX CU7. I need to get account category of any given main account Id. I am trying with the following code but its not working. Please give me suggestion/solution for this problem.
Thanks
MainAccount::findByMainAccountId("3715101021000").accountCategory()
*This post is locked for comments
Hi Bhasker,
Actually your line of code have extra "::" after findAccountCategoryRef that's why its was not working. I have remove it now its working.
MainAccountCategory::findAccountCategoryRef::(MainAccount::findByMainAccountId("9012131001000").AccountCategoryRef).accountcategory
Hi Nadeem,
If you want to fetch the accountCategory with respect to main account only why above code is required. above method is edit method, you have to pass accountcategory for same, but u have only main account Id. is it not.
My find method should work, if you have only mainAccount with correct COA.
How it will not work, it is bit difficult to understand. :)
Hi Bhaskar,
Thanks for your response, I have check but its not working. However I have try with following, this line is working but for not all the Main Accounts. When I check this line in a job for the Main Account Id which is not working in a loop then its worked fine . I am trying to dig out the problem.
MainAccount aC;
MainAccount::findByMainAccountId(cashFlowTmp.AccId).accountCategory(false, aC);
Did you check.
MainAccountCategory::findAccountCategoryRef::(MainAccount::findByMainAccountId("3715101021000").AccountCategoryRef).accountcategory
Make sure your main account belongs to current COA.
It is accountcategoryRef field itself in mainAccounttable,
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,232 Super User 2024 Season 2
Martin Dráb 230,064 Most Valuable Professional
nmaenpaa 101,156