You need to sign in to do that
Don't have an account?
Tracey
Help Building ID Array
Could somebody please explain to my why this fails?
public static ID[] GetAccountContacts(String AccountId)
{
ID[] iddata = [select id from contact where AccountId];
return iddata;
}
i want to reterive all valuesof a particular field to the .net.....
WebService static Lead[] getfulldetails()
{
Lead[] f =[SELECT State from Lead ];
return f;
}
is it right?plz reply me
Tracey,
The SOQL query is going to return a list of Contact Sobjects. You'll have to convert that list to a Set/List of IDs yourself depending upon your business case. Take a look at the collection documentation.
Your SOQL query should look like the following:
List<Contact> myContacts = [select id from Contact where AccountId = :AccountId];
HTH
Jeff Douglas
Appirio
http://blog.jeffdouglas.com
public static ID[] GetAccountContacts(String AccountId)
{
ID[] iddata;
for(contac c: [select id from contact where AccountId])
{
iddata.add(c.Id) ;
}
return iddata;