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
Alex Pearson 26Alex Pearson 26 

Cross-Object formula field not populating

Hi.  I am having problems with a cross-object formula field and its probably because I'm not 100% certain on how lookup relationship fields work.
Here's the scenario: We have a custom object Project__c.  Whenever an Opportunity is set to Closed Won, a record is automatically (via a Flow) created on the Project object.  I have created a Lookup relationship field on the Opportunity to the Project__c object called Related Project.  My cross-object formula field on the Opportunity is Project Number with a formula of
Related_Project__r.Project_Number__c.  The idea is to pull the project number value from the related project record once its entered.  It is not populating.  My questions are:
  1. Does a lookup relationship field automatically get populated with the related record when it is created?  In this case, does the Related Project field on the Opportunity get populated automatically when the project record is created from the Opp?
  2. If the Project Number field on the Project__c record is populated at a later time, will this automatically update on the Opportunity in the formula field if the lookup relationship is working?
Thanks in advance for any help!
Best Answer chosen by Alex Pearson 26
Maharajan CMaharajan C
Hi Alex,

If Project is Created via Flow (when opp is closed) automatically or Manually clicks the new button from Project Tab then it's your job to populate project id in opportunity. Salesforce won't populate the project id's in opportunity record.

Only project id will automatically populate when opportunity is created from project record related list view.

I hope you got my point.

Thanks,
Maharajan.C

All Answers

Maharajan CMaharajan C
Hi Alex,

1. Check in the end of the flow do we have any automation to update the project id in related opportunity. If there is any automation is placed then your formula must generate the value in formula.

2. If there is no auto population is there for project id in Opportunity then for testing purpose you can can poplate that lookup field manully to test your formula is working or not.

3. If the Project Number field on the Project__c record is populated at a later time, will this automatically update on the Opportunity in the formula field if the lookup relationship is working? -  Yes 

Thanks,
Maharajan.C
Alex Pearson 26Alex Pearson 26
Hi Maharajan,

Thanks for the reply!  I decided to just add the update to the project number field to my flow.

A quick question: if I am not setting the lookup relationship field to the project on the opportunity when the project is created (manually or via flow), will that field be set to the related project record that was created automatically? 

 
Maharajan CMaharajan C
Hi Alex,

If Project is Created via Flow (when opp is closed) automatically or Manually clicks the new button from Project Tab then it's your job to populate project id in opportunity. Salesforce won't populate the project id's in opportunity record.

Only project id will automatically populate when opportunity is created from project record related list view.

I hope you got my point.

Thanks,
Maharajan.C
This was selected as the best answer
Maharajan CMaharajan C
Please mark the bes answer if you got the solution !!!
Alex Pearson 26Alex Pearson 26
Got it.  That's exactly what I wanted to know.  Thanks again! :)