Skip to main content
Solved

Link Account To Batch


Forum|alt.badge.img

Hello Guys 

 

Can you help me with finding a way to link “Account” and “Batch”; I tried using GLTran but I have the same line repeated multiple times 

select * from account INNER join GLTran on Account.AccountID=GLTran.AccountID
INNER join Batch on GLTran.BatchNbr=batch.BatchNbr
order by AccountCD

 

I’m missing something ? 

Best answer by Gabriel Michaud

Acumatica is a multi-tenant system, and most tables in the application contain a field named CompanyID (it would be more appropriate to name it TenantID, but it’s like that for historical reasons). You need to make sure to join and filter on the company ID that you’re looking for.

Next, the Batch and GLTran table have two keys: Module and BatchNbr. This has to be part of your join conditions too.

Finally, keep in mind that a single GL Batch can and will generally contain more than one line (the only exception could be when working with a statistical ledger)

Here’s a working SQL query:

SELECT * FROM Batch
INNER JOIN GLTran ON Batch.CompanyID=GLTran.CompanyID AND Batch.Module=GLTran.Module AND Batch.BatchNbr=GLTran.BatchNbr
INNER JOIN Account ON Batch.CompanyID=Account.CompanyID AND GLTran.AccountID = Account.AccountID
WHERE Batch.CompanyID=2

 

View original
Did this topic help you find an answer to your question?

3 replies

Gabriel Michaud
Captain II
Forum|alt.badge.img+11

Acumatica is a multi-tenant system, and most tables in the application contain a field named CompanyID (it would be more appropriate to name it TenantID, but it’s like that for historical reasons). You need to make sure to join and filter on the company ID that you’re looking for.

Next, the Batch and GLTran table have two keys: Module and BatchNbr. This has to be part of your join conditions too.

Finally, keep in mind that a single GL Batch can and will generally contain more than one line (the only exception could be when working with a statistical ledger)

Here’s a working SQL query:

SELECT * FROM Batch
INNER JOIN GLTran ON Batch.CompanyID=GLTran.CompanyID AND Batch.Module=GLTran.Module AND Batch.BatchNbr=GLTran.BatchNbr
INNER JOIN Account ON Batch.CompanyID=Account.CompanyID AND GLTran.AccountID = Account.AccountID
WHERE Batch.CompanyID=2

 


Forum|alt.badge.img
  • Author
  • Jr Varsity II
  • 32 replies
  • March 2, 2021

@Gabriel Michaud Thank you ; I’ll try the inquiry 

 

Again Thnx for the help :) 

 


Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • 3407 replies
  • March 2, 2021

@NAWRES 

Below attached Generic Inquiry may help you!!

 


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings