You need to sign in to do that
Don't have an account?
retreive account records
hi
i have method which retreives account records...
how do i retreive account records after the for loop.....
public List<Account> searchPhones(String phone)
{
Account [] acc = [Select FirstName, LastName, MiddleName__pc, PersonMailingCity, PersonMailingState,
PersonHomePhone, PersonMobilePhone, Fax,
PersonBirthdate, PersonMailingPostalCode
// ,
// (Select FirstName__c, LastName__c, MiddleName__c From NameHistories__r)
From Account
where SearchWorkPhone7__c = :phone
or SearchMobilePhone7__c = :phone
or SearchFax7__c = :phone limit 100];
for ( Account account: acc ) {
}
return account;
}
What is your requirement ?your method seems to be working fine .
But why do you want to retrieve it after the for loop ?and do you want to do the same using a APEX trigger ?
Please clarify we'll be able to help you asap .
Hi ram,
I dont get clear thought from your ques. I think the following will help for u.
1. Declare your acc variable as public, then you can access it anywhere in the method.
2. you need to retrive ur child (NameHistories__r) record, just use iteration over a two for loops. first one for parent another one child.
i hope this will help for u.
I think this is even easier than you think --