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
aiyaz_SFDCaiyaz_SFDC 

SOQL - quering Parent (Account) to Child (Bonds__r)

Hi,

 

I am receiving an error in the code  provided

 

Error: Compile Error: unexpected token: return at line 15 column 5

 

but I'm unsure what is causing it.  Can anyone help?

 

public class AccountExtension {

private final Account BondObj;


public AccountExtension(ApexPages.StandardController controller) {
this.BondObj = (Account)controller.getSubject();
}

public Account[] getSecurities(){
Account[] ab =
[SELECT Name, (SELECT AccVol__c FROM Bonds__r) FROM Account]


return ab;
}


}

==================================================================

Error message -> 


Error: Compile Error: unexpected token: return at line 15 column 5

 

 Thanks for any help!
mtbclimbermtbclimber
You are missing a semi-colon after your query on the line preceding 15.