Skip to main content
Question

Joining ARInvoice to MasterInvoice

  • March 18, 2024
  • 9 replies
  • 88 views

Forum|alt.badge.img

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

Vignesh Ponnusamy
Acumatica Moderator
Forum|alt.badge.img+5

Hi @hmzamr,

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


Forum|alt.badge.img
  • Author
  • Freshman I
  • March 20, 2024

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


Vignesh Ponnusamy
Acumatica Moderator
Forum|alt.badge.img+5

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?


Atiq
Jr Varsity III
Forum|alt.badge.img
  • Jr Varsity III
  • March 22, 2024

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 ?


Forum|alt.badge.img
  • Author
  • Freshman I
  • March 22, 2024

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?


Atiq
Jr Varsity III
Forum|alt.badge.img
  • Jr Varsity III
  • March 22, 2024

Hi @hmzamr ,

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


Forum|alt.badge.img
  • Author
  • Freshman I
  • March 22, 2024

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

 


Atiq
Jr Varsity III
Forum|alt.badge.img
  • Jr Varsity III
  • March 23, 2024

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


Forum|alt.badge.img
  • Author
  • Freshman I
  • March 24, 2024

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