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
GlennWGlennW 

Clarification on Custom objects

On custom objects is it always the case that:

  • If it is linked to an account object it will contain the field account__c that is a reference to the accountId
  • if it is linked to a contact object it will contain the field contact__c that is a referenc to the contactId
  • depending on the linkage type this field could or could not be updateable

Cheers;

adamgadamg
The foreign key field on a custom object is re-nameable, so that technique is not reliable.

A better approach is to find all custom fields of type reference (ie exclude standard fields like CreatedById and ModifiedById). Put another way, any field of type reference that ends in �__c�
GlennWGlennW

Adam; 

Can a custom object be referenced to more than one table (i.e Account and Contact)?

Cheers;
GlennW

adamgadamg
Yes. A custom object can relationships to mutliple objects (custom and standard.)