function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
DSIDSI 

How do you deal with multiple master-detail relationships on a custom object?

For instance, an order might be identified by (order no, customer id, product id, salesrep id).  When I do a report on an order, I need to print the customer details (e.g. name, company, title), product details (e.g. product group, product name) and salesrep info (e.g. name, contact info).  Ideally I would like to create three masters (customer, product, salesrep) for one detail (order).  The documentation says I can only specify one master for a given detail table if the detail is a custom object.
 
Lookups allow me to customize the picklists with descriptive information, but this doesn't help me with reports.
 
Any ideas on how I can implement this?  Thanks.
 
 
rpr2rpr2

You're probably going to be able to do this with a custom report type.  Whether or not this works for you depends on how you have your custom order object defined. 

When defining your report, start by selecting your custom order object.  Then for the second selection choose product.  In the next step, Edit the Layout and from that screen, use the function to add fields related via lookup.  If accounts are related to your orders (which I'm assuming they are), you will be able to select from all the account fields to get your customer information.  From the lookup, you will also be able to select from the user fields to get your salesrep info.

DSIDSI
Not really sure what is meant here.  When I created the report type, I have to specify a primary (master) object.  If I choose Product-Order as my master-detail, then on the first screen I will specify Product as my primary object.  Then the next screen will allow me to link Product to Order (as the detail).  My problem is that Account, Salesrep (and other fields) can also be masters of Object (but SF only allows me to create ONE master-detail relationship per custom object).  I have lookup relationships between Order and Account and Order and Salesrep, but it won't pull up those fields to allow me to pick fields off of those objects that I might use for the report (e.g. Account.Company Name).  Those fields are easily included in TABS, but I can't figure out how to do them in REPORTS.
rpr2rpr2
After you specify the Product-Order and the Product objects save your report.  Then go to Edit Layout.  From there, in the right hand portion of the screen, there is a link that you can click that is titled Add fields related via lookup.  That's where you will be able to pick fields from objects that are related through a lookup relationship -- in your case the account and the user.
DSIDSI
It works!  Thanks!
p2gracep2grace
Wow this is exactly what I needed as well, thanks a lot :smileyhappy:
MarkL.ax269MarkL.ax269
This almost solves a problem, but I can't choose Opportunity Products (Line Items) as the primary object.  I wish Salesforce would open up this object to work with the features everything else has!

Mark
JESUtimacoUSJESUtimacoUS
Or contact roles!