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
lsatonylsatony 

Cross Object Auto-Populate Field based on Lookup Selection

Hi there,

 

In my custom object, I'm trying to auto-populate a Contact Email field based on the Contact selected in a loopkup field on the same page.

 

Can anyone please provide an example of how this is accomplished?

 

 

Thanks so much!

Best Answer chosen by Admin (Salesforce Developers) 
lsatonylsatony

aah, now i see it when selecting Advanced Formula...

 

That worked!!

 

Thanks so much for your help!!:)

Message Edited by lsatony on 02-13-2009 09:56 AM

All Answers

shillyershillyer

Since you have a lookup to the Contact Object, you can create a text cross-object formula field on the custom object that is equal to the Contact email. Should look something like this:

 

Custom Formula Field = Contact__r.Email  

 

Hope that helps,

Sati

lsatonylsatony

Thanks!

 

That makes sense, but I can't get it working.

 

On the Step 3. Enter formula page, above the field to enter the code, it shows Contact Email (Text) =

 

I tried entering  Contact__r.Email  there and it says field does not exist.

 

Also, it seems I can only select a few merge fields from my custom object in the dropdown, and none are available from other objects.  

shillyershillyer

You may need to pre-pend a namespace. Instead of typing the field name manually, when editing the Formula Field, click on the Insert Field button and look for "Contact >" after selecting your Custom Object, you should be able to browse to the Email field and insert the correct syntax.

 

Hope that helps,

Sati

lsatonylsatony
Ok, in the insert field dropdown when i choose my custom object, there are only a limited number of fields available there, Contact not being one of them.  It's only showing like 6 fields out of 25 from my custom object.
lsatonylsatony

aah, now i see it when selecting Advanced Formula...

 

That worked!!

 

Thanks so much for your help!!:)

Message Edited by lsatony on 02-13-2009 09:56 AM
This was selected as the best answer
BrianRheaBrianRhea

I am attempting to do the same thing ... however, I do not see the Advanced Formula you're referring to. I have Professional Edition, is it possible it's not available for me?

 

If you could provide me with the raw code that I could put in place, that would be helpful and I will obviously edit it to reflect the fields I'm inserting.

SnehalCSnehalC
I tried to autopopulate lookup field (some person name) based on some other lookup field... this is the formula... Apps__r.Business_person__c
But in the detail page it displays values like: ythhWFv12GD... why so? It should display person name..
Manikanta BaratamManikanta Baratam
He doesn't want the field to be updated after saving the record.... He wants Email field to be auto-populated in the same page... Please suggest a way without code.. I also have the same doubt