/
Master-Child Child-to-Parent Query Example
Master-Child Child-to-Parent Query Example
Contact to Account
SalesforceSession salesforceSession = new SalesforceSession(new LoginDetails("username@example.com", "salesforcePassword")); ContactDataSource contactDataSource = new ContactDataSource(salesforceSession); List<Contact> contacts = contactDataSource.QueryEntities<Contact>( Contact.Fields.Id, Contact.Fields.FirstName, Contact.Fields.Account(Account.Fields.Id, Account.Fields.Name) ); foreach (Contact contact in contacts) { Account account = contact.Account; //get the related Account string accountName = account.Name; }
Related content
Accessing Custom Objects and Custom Fields
Accessing Custom Objects and Custom Fields
Read with this
Create a new Person Account
Create a new Person Account
More like this
Query and Update a Person Account
Query and Update a Person Account
More like this
Searching Salesforce Records
Searching Salesforce Records
More like this
Retrieving a Specific Salesforce Entity
Retrieving a Specific Salesforce Entity
More like this
Methods
Methods
More like this