if (UtilValidate.isNotEmpty(contactMechId) && !contactMechId.equals("_NEW_")) {
newCc.set("contactMechId", context.get("contactMechId"));
String contactMechPurposeTypeId = "BILLING_LOCATION";
GenericValue tempVal = null;
try {
<BUG>List<GenericValue> allPCMPs = EntityUtil.filterByDate(delegator.findByAnd("PartyContactMechPurpose",

UtilMisc.toMap("partyId", partyId, "contactMechId", contactMechId, "contactMechPurposeTypeId", contactMechPurposeTypeId), null, false), true);
tempVal = EntityUtil.getFirst(allPCMPs);
</BUG>
} catch (GenericEntityException e) {

if (UtilValidate.isNotEmpty(contactMechId) && !contactMechId.equals("_NEW_")) {
newCc.set("contactMechId", context.get("contactMechId"));
String contactMechPurposeTypeId = "BILLING_LOCATION";
GenericValue tempVal = null;
try {
List<GenericValue> allPCWPs = delegator.findByAnd("PartyContactWithPurpose",
UtilMisc.toMap("partyId", partyId, "contactMechId", contactMechId, "contactMechPurposeTypeId", contactMechPurposeTypeId), null, false);
allPCWPs = EntityUtil.filterByDate(allPCWPs, null, "contactFromDate", "contactThruDate", true);
allPCWPs = EntityUtil.filterByDate(allPCWPs, null, "purposeFromDate", "purposeThruDate", true);
tempVal = EntityUtil.getFirst(allPCWPs);
} catch (GenericEntityException e) {
