Skip to content

Instantly share code, notes, and snippets.

@kbs5280
Last active May 23, 2019 17:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kbs5280/dca0ecb5c94ecf366aa018d470ee000e to your computer and use it in GitHub Desktop.
Save kbs5280/dca0ecb5c94ecf366aa018d470ee000e to your computer and use it in GitHub Desktop.
List<String> notSendableResults = new List<String>{Constants.DoctorDeclined, Constants.NotCandidate, Constants.ReceivedElsewhere};
Boolean isTestRecord = account.PersonEmail != null ? account.PersonEmail.contains('+ostest') : false;
if((account.PersonEmail != null ||
Utilities.hasPhysicalAddress(account.BillingStreet, account.BillingCity, account.BillingState, account.BillingPostalCode)) &&
(account.CreatedDate >= Datetime.now().AddYears(-3) ||
scheduledAccountIds.contains(account.Id)) &&
!isTestRecord &&
!notSendableResults.contains(account.Consult_Result__c)) {
return true;
}
return false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment