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
Koen (BvD)Koen (BvD) 

Finding part child relationship

My question is more general for webservices, but as I am developing in.NET and don't see a specific forum for the webservice, here it goes:

 

With the webservice methods for object description you can find parent child relationships appaerntly only in one direction. For a particular table the describesObject allows to list the childrelationships, so from the Account table I can find its relation to the contacts table. However if I am looking at the child table in the relationship, I don't see how I can find the parent table. So starting with the Contacts table, how can I see that Accounts is its parent table without needing to scan all other tables to see if my current table happens to be in one of the relationships. I see that a fielddescription also holds a property RelationshipName, but this doesn't seem to help you much further as there is still no way to deduce the table from the relationshipname, or is there?

 

Koen.

SuperfellSuperfell
for foreignKey fields the referenceTo property contains the name of the object type its related to (e.g. the AccountId field on contact has a referenceTo of 'Account'), between that and the child relationships, you can determine every relationship that the particular object type has.
Koen (BvD)Koen (BvD)

Thank you very much, somehow I looked over it in the doc.

 

Koen.