Question

Joining ARInvoice to MasterInvoice

  • 18 March 2024
  • 9 replies
  • 79 views

Userlevel 1

Hello Community,
i’m working on a customization project and i want a grid to show some results of joining 2 tables, I wanted to ask how to join ARinvoice to MasterInvoice, because when i do it the form shows “ARInvoice duplicated many times in FROM clause”


9 replies

Userlevel 1

Hi @Atiq 
Here is the statment i’m using :
SelectFrom<ARInvoice>
                .LeftJoin<Customer>.On<ARInvoice.customerID.IsEqual<Customer.bAccountID>>
                .Where<ARInvoice.status.IsEqual<ARDocStatus.closed>……..etc 

Userlevel 3
Badge

Based on What you are pulling the data, i mean how are you bringing the data?

Userlevel 1

i’m displaying Tax information; Installments, TaxTotal, amounts, terms and i’m doing calculated fields to calculate installments taxes based on Terms

 

Userlevel 3
Badge

Hi @hmzamr ,

                         Can you please elobarate, what information are you displaying on the grid?

Userlevel 1

in a simple word, i want to join ARInvoice to itself where the masterRefNbr is equal to refNbr.
Is there a way where i can do that?

Userlevel 3
Badge

Hi @hmzamr ,

                           The Master Table for ARInvoice is ARRegister,  and the Relation you are looking for is ARInvoice.RefNbr=ARRegister.refnbr

Is this what you are looking for ?

Userlevel 7
Badge +4

Hi @hmzamr,

I don’t see the MasterInvoice table or DAC. Is it a custom DAC? Can you possibly share a customization package using which we can reproduce the behavior?

Userlevel 1

Hi Vignesh,
i’m making a new form to show a grid showing ARInvoices, i want to join the ARInvoice to it’s MasterInvoice where ARInvoice.masterRefNbr is equal to MasterInvoice.refNbr

SelectFrom<ARInvoice>
                .LeftJoin<MasterInvoice>.On<ARInvoice.masterRefNbr.IsEqual<MasterInvoice.refNbr»

the project was validated and published successfully, but when it comes to show the form or add fields to it, it says ‘Duplicated use of ARInvoice_ARInvoice in one FROM clause ’
because basically MasterInvoice is AR.ARInvoice

Userlevel 7
Badge +4

Hi @hmzamr,

Can you please more details like steps to reproduce, a simple customization package, current behavior and expected behavior? 

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved