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
tlaurietlaurie 

how to get account data when you have opportunity

 

 

Dim qr As apex.QueryResult = binding.query("Select Name, StageName, ProjectID__c, ID,EngagementStartDate__c, Entity_1__c, owner.name, owner.email, Property_Address__c,Property_City__c,Property_State__c, Property_ZIP_Postal_Code__c,Building_Footprint__c,Partial__c,Number_of_Stories_del__c,Number_of_Buildings__c,Acquisition_Date__c,Construction_1_Date__c,Site_Plans__c,Rent_Roll_Available__c, CloseDate, Client_Req_Comp_Date__c, Amount,Existing_Building_Plans__c,Soft_Cost_Details__c, Depreciation_Schedules__c, Payment_Applications_G702_703__c, Construction_Invoices__c,Construction_1__c,Acquisition__c, Soft_Costs__c, Improvements__c, Land_Cost__c, Comments__c, Portfolio_Name__c, X3115_Report__c, X3115_Fee__c, Property_Size__c, Referral_Name__c, Referral_Fee_Percentage__c, Referral_Amount__c, Property_Types__c from Opportunity Where ID = '" & lbOpportunities.SelectedValue & "'")

 

The above code works just fine, when I try to add "Acccount" in order to get data to create an account object I get the following error:

 

 No such column 'Account' on entity 'Opportunity'.

 

Any ideas?

 

dkadordkador

You can't just ask for the Account object, you have to ask for the fields on the Account you care about.  So for Opportunity, you could do something like:

 

select id, account.name, account.description from opportunity

 

See the section on relationships in our API docs.