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
ppiyushppiyush 

referencing Accountid for Opportunity item

Hi there,

 

I need to reference the AccountId of an opportunity in apex. How do I best do this?

 

Lets say opp is an Opportunity. Is opp.get(Accountid) not valid?

 

It's returning null for me everytime I try.

 

Best regards,

Pranav

Best Answer chosen by Admin (Salesforce Developers) 
Ispita_NavatarIspita_Navatar

Have you tried opp.Accountid?

 

Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved.