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
Steve CairneySteve Cairney 

Cross Object Formula Syntax

Hi, I have a custom object called MC (for brevity) that has Master Detail relationships with the Account and Opportunity objects.

I have created an email field on the MC object that I would like to populate with an email field from the realted Opportunity object as the default value.

The options on the formula builder for the email field on the MC object are all $Feilds so although that would work initially (the Opp owner created the MC record initially) the field would be updated should someone else edit the MC record.

I've checked Eclipse and the Child Relationship name for the Opportunity is "Opportunities_del__r" and the email field from the Opp I want to present is Manager_Email_OPP__c but the syntax

Opportunities_del__r.Manager_Email_OPP__c throws the following syntax error: " Field Opportunities_del__r does not exist. Check spelling."

Any idea on what I can do here?
Best Answer chosen by Steve Cairney
Steve CairneySteve Cairney
it turns out you can't cross object reference default values. So I created a couple of workflows and it works fine

All Answers

AadryanAadryan
Not sure if you can define this  'default value' while creating the custom field. 
you can try  (1) URL hacking on clicking the NEW button of the Custom Obj; or (2) WF rule & field update on creation
Steve CairneySteve Cairney
Hi, When I refer to the default value I mean as in using a formula to populate the field
AadryanAadryan
Default Value > Show Formula Editor > Select Field Type .... do you get an option to choose your parent object and its fields? I guess "no"
Steve CairneySteve Cairney
Correct, all I see are the $Feilds. 

$Label
$Organization
$Profile

etc.
Steve CairneySteve Cairney
it turns out you can't cross object reference default values. So I created a couple of workflows and it works fine
This was selected as the best answer