Reputation: 7
i'm trying to get the Tax Registration ID from current company logged in Acumatica , i found it in the BAccount table, but to select it i will need the BAccountID. How can i get it ?? BAccount Table
Hope someone can help me! Thanks a lot!
Upvotes: 0
Views: 172
Reputation: 8278
You need to get the Branch of the logged in user instead of the company.
The target field will be in BranchBAccount DAC which inherits from BAccount.
Main setting is per Branch and can be overridden in a cascading fashion in Location/BAccount.
You can use AccessInfo class to get information about logged in user like his Branch.
Example BQL request:
BranchBAccount branchBAccount = PXSelectJoin<BranchBAccount,
LeftJoin<Branch, On<Branch.branchCD, Equal<BranchBAccount.branchBranchCD>>>,
Where<Branch.branchID, Equal<AccessInfo.branchID>>>.Select(this [or] Base);
Upvotes: 0