Skip to main content
Solved

CRM Database Schema--How is CRQuote tied to CROpportunity?

  • June 22, 2025
  • 3 replies
  • 97 views

Forum|alt.badge.img+1

I’m trying to put together a SQL View on CRM Quote data.  In the DAC, CRQuote has an OpportunityID field that ties it back to CROpportunity.  It turns out that field isn’t in the database.  I looked at CRRelation (since I know that ties CRQuote back to SOOrder), but I can’t find a common thread in there either.  I picked an opportunity with multiple quotes and tried to find every NoteID field on the Opp on every NoteID field in CRRelation with no luck.

This isn’t an end of the world thing--I can just go back to doing what I’m trying to do with a GI.  But at this point it’s more of a quest--I know that those two tables are somehow related because they get related in the DAC, and I’m really hoping to find out how they are related.

Best answer by darylbowman

You’re missing CROpportunityRevision (which contains OpportunityID) where NoteID matches CRQuote.QuoteID

3 replies

DipakNilkanth
Pro III
Forum|alt.badge.img+13

Hi ​@lairdtim,

Have you looked at the DefQuoteID field in the CROpportunity table? It matches the QuoteID field in the CRQuote table, where you can find the OpportunityID field.

Hope this helps!


Forum|alt.badge.img+1
  • Author
  • Semi-Pro I
  • June 23, 2025

Hi ​@lairdtim,

Have you looked at the DefQuoteID field in the CROpportunity table? It matches the QuoteID field in the CRQuote table, where you can find the OpportunityID field.

Hope this helps!

I have, but I need to be able to find every quote on an opportunity.  I’m actually working backwards, trying to find the opportunity that is tied to a specific quote, and that quote may not be the primary.

I even though I’d just do a grouping on CROpportunityProducts (which contains the quote lines), but even that table is only related to QuoteID, no direct tie back to CROpportunity (outside of the fields added by the DAC).


darylbowman
Captain II
Forum|alt.badge.img+15
  • Answer
  • June 24, 2025

You’re missing CROpportunityRevision (which contains OpportunityID) where NoteID matches CRQuote.QuoteID