+ Start a Discussion
surya74surya74 

Getting error in Code.... Please resolve....

public class con1
{
account a
public account getinfo()
{
a=[select id,name,billingcity,phone from account where id=:apexpages.currentpage().getparameters().get('id')];
return a;
}
}

 

 

Best Answer chosen by Admin (Salesforce Developers) 
rocwilcoxrocwilcox

That was my guess.   See my comment about the missing semi-colon ";" in line 3...

 

Account a;

public.....

All Answers

rocwilcoxrocwilcox

What's the error message.

BTW: put a ; after "account a" for completeness.

surya74surya74

This is the what I got "Error: Compile Error: unexpected token: 'public' at line 4 column 0"

 

Can you please review and advice...

rocwilcoxrocwilcox

That was my guess.   See my comment about the missing semi-colon ";" in line 3...

 

Account a;

public.....

This was selected as the best answer