You need to sign in to do that
Don't have an account?
Anvesh Paidakula
Please correct this below code from exception ?
For the below code i am getting Limit exception while deploying into production. I knw more tham 10k records are processed in querry...can anyone correct this ......
@isTest private static void FT_FT()
{
List<Transaction__c> TList = new List<Transaction__c>();
Transaction__c F = GenTransactionForecare(1000, '', FORECARE_CU);
Transaction__c F2 = GenTransactionForecare(1002, '', FORECARE_CU);
TList.add(F);
TList.add(F2);
Test.startTest();
insert TList;
Test.stopTest();
Map<Id, Transaction__c> TMap = new Map<Id, Transaction__c> ([SELECT External_Wholesaler__c, Id FROM Transaction__c WHERE
Id =:F.Id OR Id =:F2.Id]);
//Exception occurerd getting Too Many Soql statements
System.assertEquals(true, TMap.get(F.Id).External_Wholesaler__c != null && TMap.get(F2.Id).External_Wholesaler__c != null,
'TMap.get(F.Id).External_Wholesaler__c: '+TMap.get(F.Id).External_Wholesaler__c+
' . TMap.get(F2.Id).External_Wholesaler__c: '+TMap.get(F2.Id).External_Wholesaler__c);
}
}
@isTest private static void FT_FT()
{
List<Transaction__c> TList = new List<Transaction__c>();
Transaction__c F = GenTransactionForecare(1000, '', FORECARE_CU);
Transaction__c F2 = GenTransactionForecare(1002, '', FORECARE_CU);
TList.add(F);
TList.add(F2);
Test.startTest();
insert TList;
Test.stopTest();
Map<Id, Transaction__c> TMap = new Map<Id, Transaction__c> ([SELECT External_Wholesaler__c, Id FROM Transaction__c WHERE
Id =:F.Id OR Id =:F2.Id]);
//Exception occurerd getting Too Many Soql statements
System.assertEquals(true, TMap.get(F.Id).External_Wholesaler__c != null && TMap.get(F2.Id).External_Wholesaler__c != null,
'TMap.get(F.Id).External_Wholesaler__c: '+TMap.get(F.Id).External_Wholesaler__c+
' . TMap.get(F2.Id).External_Wholesaler__c: '+TMap.get(F2.Id).External_Wholesaler__c);
}
}
If this solves your problem, kindly mark it as the best answer.
Regards,
Magulan
http://www.infallibletechie.com