}
if (UtilValidate.isNotEmpty(contactMechId) && !contactMechId.equals("_NEW_")) {
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 (tempVal == null) {
newPartyContactMechPurpose = delegator.makeValue("PartyContactMechPurpose",
UtilMisc.toMap("partyId", partyId, "contactMechId", contactMechId, "contactMechPurposeTypeId", contactMechPurposeTypeId, "fromDate", now));
}
}
if (newPartyContactMechPurpose != null) toBeStored.add(newPartyContactMechPurpose);
try {
delegator.storeAll(toBeStored);
} catch (GenericEntityException e) {
