diff --git a/src/main/default/classes/ChangeAccountOwner.cls b/src/main/default/classes/ChangeAccountOwner.cls index 61364ccc..b553f72e 100644 --- a/src/main/default/classes/ChangeAccountOwner.cls +++ b/src/main/default/classes/ChangeAccountOwner.cls @@ -123,7 +123,7 @@ public with sharing class ChangeAccountOwner { public static Map> getRelatedBlaRecords(List accountId) { Map> resultMap = new Map>(); - for (BusinessLicenseApplication bla : [SELECT Id, OwnerId, AccountId FROM BusinessLicenseApplication WHERE AccountId IN :accountId AND RecordType.Name='New License' AND Status !='Closed']) { + for (BusinessLicenseApplication bla : [SELECT Id, OwnerId, AccountId FROM BusinessLicenseApplication WHERE AccountId IN :accountId AND RecordType.Name='New License' AND Status !='Closed' AND Status !='Pending Approval']) { if (!resultMap.containsKey(bla.AccountId)) { resultMap.put(bla.AccountId, new List()); } @@ -145,7 +145,7 @@ public with sharing class ChangeAccountOwner { public static Map> getRelatedCaseRecords(List accountId) { Map> resultMap = new Map>(); - for (Case caseRec : [SELECT Id, OwnerId, AccountId FROM Case WHERE AccountId IN :accountId AND Status != 'Closed']) { + for (Case caseRec : [SELECT Id, OwnerId, AccountId FROM Case WHERE AccountId IN :accountId AND Status != 'Closed' AND Status !='Pending Approval']) { if (!resultMap.containsKey(caseRec.AccountId)) { resultMap.put(caseRec.AccountId, new List()); }