1

I am stumped! On the Account object I have a lookup field to reference other Accounts who may be assisting that Account (Subcontractors, Accountants, etc.)

I also have a Custom object which has a lookup to the Account Object.

There is a formula field on the Custom object which is attempting to return the Account's subcontractor, accountant, etc.

Account__r.Accountant_c brings back just the ID, I need the name. Account__r.Accountant__r.Name bring back nothing, no name.

Guys I am STUMPED. What am I doing wrong here?

  • 1
    Whats the error you are getting ?Check the data again . – Mohith Shrivastava Jan 31 '16 at 21:35
  • @MohithShrivastava There is no error, the formula field returns null when used – Steel Reserve 211 Jan 31 '16 at 21:39
  • 1
    There is not really a lot that can go wrong. You're certain there is a related account? You're certain your account has an Accountant associated? Your formula doesn't have any conditionals or anything? Maybe post the formula, and some screen shots showing the data...Also, is this pre-release maybe? Is it a Salesforce bug? Just throwing all options out there. – pchittum Feb 1 '16 at 0:09
  • 1
    One thing to check is to make sure that your child and parent relationship names don't clash. Make sure that from Account -> Custom Object, you have a plural name. Essentially, make sure you have the names correctly specified. The workbench browser is especially useful for working out this sort of stuff: workbench.developerforce.com/login.php – Caspar Harmer Feb 1 '16 at 2:14
  • 1
    Simply try to execute a query to get this value "Select Account__r.Accountant__r.Name From Account where id='YOUR ACCOUNT ID'". Check if you are getting any result here. – Salesforcesmarty Feb 1 '16 at 2:21
0

I had this issue recently and it was because I had the relationship name wrong. I assumed that the custom object named Status_Report__c would have a relationship named Status_Report__r. When I found the relationship in Workbench it was actually R00N80000002lZ2OEAU__r. To find the relationship, login to workbench.developerforce.com/login.php and hover the "Info" tab in the gray bar at the top of the screen. A list of options will appear. Select the "Standard & Custom Objects" option and select the parent object "Account" and click on the "Child Relationships" folder and find the option that references the Accountant__c relationship. Click on it and it will show a "relationshipName:" value and that value will be what you should use.

| improve this answer | |
  • Thanks for posting this, no luck unfortunately. A Visualforce page with a controller extension sets the relationship of the custom object with the account, I am starting to think that that might somehow affect how that relationship is setup. Any thoughts? – Steel Reserve 211 Feb 1 '16 at 22:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.