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
jmarie1228jmarie1228 

Help creating custom objects with header and detail records

Hi - I'm a new admin/developer and am trying to create a relationship between 2 custom objects making one the header and the other the detail of a report.  This report would be submitted by our dealer network and need to be uploaded to SF via the WebAPI.  The webform will allow the user to enter up to 10 records for reporting win/loss data.  It would be much like an invoice header/detail situation, but an occurence of only 1 report per dealer monthly.  Can someone point me in the right direction to an article, webcast, etc?

Many thanks in advance!!
RickyGRickyG
Part of the problem is how to establish a relationship between two objects when loading data.  Normally, the relationship is established between the child record and the Salesforce ID of the parent record.  However, you can define a field in the parent as an external key.  When you go to load the detail records with Data Loader, you will be prompted as to whether you want to establish the relationship based on the default (Salesforce ID) or on any available external key.

In your case, you would use something like a unique dealer ID for both the header and detail records.  Define the header with this ID as the unique identifier, and load the header data.  Once this is accomplished, load the detail records, making sure you identify the proper external key for the relationship.

Hope this helps.