• HG
  • NEWBIE
  • 10 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 3
    Replies
Hi all,

I have a custom object called "CO" and having a field called "User".
I am able to get Account ID now, but I would like to get Account Name insted.
Would someone let me know if there is a way to get Account Name from CO?

=================================
CO (CO__c)
----
Id
User (User__c) -> Contact
                            ---------
                            Id
                            Company  (Account) -> Account
                                                               ---------
                                                               Id
                                                               Name
=================================

"User"       : Lookup(Contact)
"Company": Lookup (Account)

This is what I have now.
select User__r.AccountId from CO__c where Id = 'xxxxxxx';

Thank you,
HG
  • July 10, 2018
  • Like
  • 0
Hi all,

I have a custom object called "CO" and having a field called "User".
I am able to get Account ID now, but I would like to get Account Name insted.
Would someone let me know if there is a way to get Account Name from CO?

=================================
CO (CO__c)
----
Id
User (User__c) -> Contact
                            ---------
                            Id
                            Company  (Account) -> Account
                                                               ---------
                                                               Id
                                                               Name
=================================

"User"       : Lookup(Contact)
"Company": Lookup (Account)

This is what I have now.
select User__r.AccountId from CO__c where Id = 'xxxxxxx';

Thank you,
HG
  • July 10, 2018
  • Like
  • 0