Skip to main content
Solved

Adding Opportunity Table to Appointment Details Table, getting duplicates for certain records

  • October 11, 2022
  • 6 replies
  • 161 views

Hey Community!! 

 

I have customized a an out of the box GI (Appointment Details). I have added tables SO order and joined it with Service Order. And joined opportunity table (CR Relation and CR Opportunity) to SO order.

 

This was done to get owner ID of the opportunity.

 

What I can observe is that for certain records only, the lines are duplicating and for others it is fine. Also,  observed this was working fine few days ago but suddenly not sure why it is showing the duplicates.

 

Here is the table joins: 

 

These are the dupe values I am seeing only for certain records: 
 

One thing I noticed is the Owner Field is coming for one line and is not coming for another wherever there are dupes.

 

Attaching xml for the GI.

Best answer by adalvi

Hey @laura01 . It is possible to join SO order Table to CROpportunity table using CRRelation.
Here are the joins: 
 

The issue of getting some duplicates was because some of the opportunities had a Quote on it which was used to create Sales order. So it was showing 2 lines for one Sales Order, one joint with the Quotes and one with the Opportunity.

I put this condition on my query and it removed the dupes that were showing due to the quotes relation.
 

 

The GI works fine now and is giving the result as expected. Thanks :) 

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

6 replies

Laura02
Captain II
Forum|alt.badge.img+19
  • Captain II
  • 3132 replies
  • October 11, 2022

Hello,

Duplicates usually mean something is wrong with the join.  When you join CRRelation to CROpportunity,  the tables’ key fields should be used to join, Possibly Company ID and Relation ID, not NoteID.

CRRelation has two note id fields (TargetNoteID and DocNoteId) though I recommend sticking with key fields when joining tables/classes.


  • Author
  • Jr Varsity II
  • 9 replies
  • October 11, 2022

@laura01 : What would be the key fields For CR Relation to CROpportunity?


  • Author
  • Jr Varsity II
  • 9 replies
  • October 11, 2022

@laura01 : Or is there any other way to get the owner of Opportunity on this GI?


Laura02
Captain II
Forum|alt.badge.img+19
  • Captain II
  • 3132 replies
  • October 11, 2022

Hello,

The Key Fields in CRRelation are Company + Relation ID.  The key fields in Opportunity are Company + Opportunity ID.  Joining on both will only work if Relation ID is the same entity as an Opportunity.  I’m not familiar with what a “Relation ID” is in Acumatica; not sure these tables can be correctly joined on their key fields.

Another idea to remove duplicates:  Maybe try joining Noteid = Noteid… this will work if every note id is unique within Acumatica. Or try CompanyID (this is the same field in both tables) +  noteid fields in the join.

HTH.

 


  • Author
  • Jr Varsity II
  • 9 replies
  • Answer
  • October 18, 2022

Hey @laura01 . It is possible to join SO order Table to CROpportunity table using CRRelation.
Here are the joins: 
 

The issue of getting some duplicates was because some of the opportunities had a Quote on it which was used to create Sales order. So it was showing 2 lines for one Sales Order, one joint with the Quotes and one with the Opportunity.

I put this condition on my query and it removed the dupes that were showing due to the quotes relation.
 

 

The GI works fine now and is giving the result as expected. Thanks :) 


Chris Hackett
Community Manager
Forum|alt.badge.img
  • Acumatica Community Manager
  • 2810 replies
  • October 18, 2022

Thank you for sharing your solution with the community @adalvi !


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