Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7915209
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T14:22:54+00:00 2026-06-03T14:22:54+00:00

Hello Folks, I am working on customizing some functionality on the Force.com platform. I

  • 0

Hello Folks,

I am working on customizing some functionality on the Force.com platform. I have a question for you; I am not too sure if this is possible!

What I have? : 2 custom objects – abc and pqr. Abc is the junction object between the Standard object Account and pqr i.e. Account is the parent of abc and then Pqr is the parent of abc. I am retrieving everything through these objects into a List of type Account (i.e. from Account object).

What I need? : I can access the abc object in Apex i.e. the First child of Account. Is there a possibility to access the fields of pqr through account?

What I have tried : Accessing the object through relationship name – Account.abc_r[0].pqr_r[0].FIELDNAME

But it hasnt worked. Could some salesforce/apex developer help me with this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T14:22:57+00:00Added an answer on June 3, 2026 at 2:22 pm

    You should be able to get the information you need using a subquery. The real question here is how your query is setup. Your query will need to access all levels of the data model for it to be available. If you are relying on data returned in a trigger or standard controller then I would recommend requiring the account object to get access to the additional information.

    So I would expect to see something along the lines of:

    List<Account> accounts = [SELECT Id, Name, (SELECT Id, pqr__r.Id, pqr__r.Name FROM abc__r) FROM Account];
    
    for (Account acct : accounts) {
        string someValue = acct.abc__r[0].pqr__r.Name;
    }
    

    Keep in mind though that as a best practice you shouldn’t access the child records the way I did above because if there are no ABC records that object will be null so as a best practice you will want to test for that ahead of time. Same goes for PQR object data.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hello! I'm not even sure if this is possible, but hopefully it is in
Hello folks :) I have a quick question - For the following NSMutableArray: NSMutableArray
Hello fellow developers... just to make sure, I want to ask this question: How
Hey folks, sorry this is a bit of a longer question... I have a
Hello folks, I've got the issue to add a browser event to some input
Introduction Hello folks, I recently learned to program in C! (This was a huge
Hello I have this problem with PyQt4-dev-tools that include: * a user interface compiler
Hello and thank you in advance. I know this is total noob question, and
Hello i have this code var queue = new BlockingCollection<int>(); queue.Add(0); var producers =
Possible Duplicate: Php array_push() vs myArray[] Hello folks. I know some ways to add

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.