You need to sign in to do that
Don't have an account?
Suresh Raghuram
Invalid bind expression error
Save error: Invalid bind expression type of SOBJECT:AggregateResult for Id field of SObject Contact
List<contact> cnt = new List<Contact>([select id, name, from contact where contact.id =: [select max(id) from contact]]);
Aggregate queries return a list of objects called AggregateResult, you can get a specific field from them using the get() method:
That said, I'm not sure you're approaching your problem the right way. What are you aiming to retrieve, the last contact added to the system?
If that's the case you could use createddate:
Matt
All Answers
Aggregate queries return a list of objects called AggregateResult, you can get a specific field from them using the get() method:
That said, I'm not sure you're approaching your problem the right way. What are you aiming to retrieve, the last contact added to the system?
If that's the case you could use createddate:
Matt
the one with created date is worked rather than the aggretgate function max thank you very much matt could you suggest some sceaniros to write classes and to learn soql quries once agin thank u
I'd highly recommend reading through the Developer Guide, it's pretty hands-on and includes a lot of very useful information!