1

I implemented one trigger in Parent object.I am getting the following error while creating child record.

Error: Invalid Data. Review all error messages below to correct your data. Apex trigger Testorg caused an unexpected exception, contact your administrator: Testorg : execution of AfterUpdate caused by: System.EmailException: SendEmail failed. First exception on row 0; first error: UNKNOWN_EXCEPTION, Subscript is invalid because list is empty: []: Trigger.Testorg:

Code:

String whereCond = ' Where (test_Min__c <='+listmoney +'AND test_Max__c >='+listmoney +
                     ') AND (Minemp__c <='+mmtotal +
                     'AND Maxemp__c >='+mmtotal+') AND'; 
String finalQuery = 'SELECT Id,Name,Email__c FROM Property__c '+ 
                     whereCond +'(Status__c INCLUDES (\'test1\') OR
                                  Status__c INCLUDES (\'test2\'))' + 'LIMIT 3'; 

How can I resolve this?

3
  • 1
    Please provide your code. Jan 23, 2017 at 10:44
  • i am getting error based on this condition: String whereCond = ' Where (test_Min__c <='+listmoney +'AND test_Max__c >='+listmoney +') AND (Minemp__c <='+mmtotal +'AND Maxemp__c >='+mmtotal+') AND'; String finalQuery = 'SELECT Id,Name,Email__c FROM Property__c '+ whereCond +'(Status__c INCLUDES (\'test1\') OR Status__c INCLUDES (\'test2\'))' + 'LIMIT 3';
    – Sfdcprgmr
    Jan 23, 2017 at 10:50
  • 1
    I don't think the error comes from this condition. It seems that you use the SendEmail class in a trigger. Please copy the code in your question. Jan 23, 2017 at 10:54

0

You must log in to answer this question.

Browse other questions tagged .