• V Subhash
  • NEWBIE
  • 0 Points
  • Member since 2011

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 2
    Replies

Hi,

 

I am doing mass update in a class and while doing mass operation i am checking duplicate record based on some condition for this i am calling a method again and again and getting this error can anyone please help how i can bulkyfy my code.code is below,your help will be really appreciated:

 

public static List<String> checkDuplicatestudentdatamasschange(Student__c studobj){

Date effectiveDate = studobj.Effective_Date__c;
Date expirationDate= studobj.Expiration_Date__c;
List<String> duplicatesS= new List<String>();
String studentrecordid= studobj.Parent_Student__c;
List<Student__c> studsupport= null;
String soql = 'select id,Parent_Student__c,name,Agreement_Number__c from Student__c where (status__c=\'Approved\' OR status__c =\'Awaiting Approval\' OR status__c =\'Awaiting Stu Approval\' OR status__c =\'Conditionally Approved\' OR status__c =\'Rejected by Stud\')';

if (studobj.Supplier_Profile_ID__c!=null)
soql += ' and Student_Profile_ID__c = \''+studobj.Student_Profile_ID__c+'\'';
if (studobj.teacher__c!=null)
soql += ' and teacher___c = \''+studobj.teacher__c+'\'';
System.debug('----------soql-------------------'+soql);

try {
studsupport= Database.query(soql + ' order by Effective_Date__c asc' );
} catch (Exception e) {
ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.ERROR, e.getMessage()));
}
if(studsupport!=null && !studsupport.isEmpty()){

for(Student__c support:studsupport){
duplicatesS.add(support.Agreement_Number__c);
}

}
System.debug('----------duplicates-------------------'+duplicatesPS);
return duplicatesS;
}

 

 

Thanks:))))

  • February 16, 2013
  • Like
  • 0

Hi,

 

I am trying small query but i am getting error while try to display.

 

ERROR-- line 4, column 59: Initial term of field expression must be a concrete SObject: LIST

 

String searchTerm = 'abc';
List<List<Account>> accs =[FIND:searchTerm RETURNING Account(Id,Name)];
for(List<Account> a: accs){
system.debug('**************SOSL Result*****************'+a.Name);
}

 

I want to see the account name.

 

Thanks,

Bujji

  • January 22, 2013
  • Like
  • 0