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
SeanMSSeanMS 

API Question: Related Object Mapping Field Requirement

Hi,

 

I have a Master-Detail relationship defined between object A (Master) and object B (Detail/Child). Creating this relationship forced the requirement of a value for object B's field that maps to object A. In the Salesforce UI, when I manually link an object A record to an object B record, the mapping field is a *standard* object A field (a unique id field that Salesforce creates). When I try to synchronize these records in my integration using the API, I run into an error stating that a value is required for the mapping field of object B. My problem is that I don't know how to obtain the value that I need from that standard field since it doesn't show up for the API object's available fields. What can I do?

 

Thanks in advance!

 

SuperfellSuperfell
You don't know how to find the Id of the master record, or you don't know how to specify it in the insert of the detail record ?
SeanMSSeanMS
Well, I suppose both... through the API, I cannot see/retrieve the *standard* Salesforce Object Id (for my master object) in order to take that value and assign it to the mapping field that exists (and is required) for my child object. :O 
SuperfellSuperfell
Its the Id field, its only every sobject. perhaps you could post some code so we can see where you're going wrong.
SeanMSSeanMS
Thank you, Simon. This was the answer to my issue (using the Id field!). I couldn't see it in my API object list because it was hiding in the base field list of that object. :)