String partyId = (String) context.get("partyId");
Timestamp now = UtilDateTime.nowTimestamp();
// update the contact mech records
try {
delegator.storeByCondition("PartyContactMech", UtilMisc.toMap("partyId", partyIdTo, "thruDate", now),
new EntityExpr("partyId", EntityOperator.EQUALS, partyId));
} catch (GenericEntityException e) {
Debug.logError(e, module);
return ServiceUtil.returnError(e.getMessage());
}