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
TykeTyke 

Retrieving Child Salesforce Objects from Custom Parent Object

I have created a custom MyOpp object which acts as a parent to Salesforce Contract objects (via a lookup on the Contract record). In VBA how can i retrieve all the Contracts for a given MyOpp?
foghornfoghorn

Simplest is to run a soql query based on the relationship:

 

Select * from contract where <contract parentid> = myOpp.id

TykeTyke
Unfortunately in the Contract record there is no field containing the id of the owning myOpp record. i.e. <contract parentid> doesn't exist.