diff --git a/applications/party/src/main/java/org/apache/ofbiz/party/party/PartyServices.java b/applications/party/src/main/java/org/apache/ofbiz/party/party/PartyServices.java index 6aad675385..460a3bd8a3 100644 --- a/applications/party/src/main/java/org/apache/ofbiz/party/party/PartyServices.java +++ b/applications/party/src/main/java/org/apache/ofbiz/party/party/PartyServices.java @@ -2595,6 +2595,7 @@ public class PartyServices { if (currentContactMechPurposeTypeId != null && ("TELECOM_NUMBER".equals(currentContactMechTypeId) || "POSTAL_ADDRESS".equals(currentContactMechTypeId) || "EMAIL_ADDRESS".equals(currentContactMechTypeId))) { partyContactMechPurpose.put("contactMechPurposeTypeId", currentContactMechPurposeTypeId); + partyContactMechPurpose.put("contactMechTypeId", currentContactMechTypeId); partyContactMechPurposeChanged = (lastContactMechPurposeTypeId == null || !lastContactMechPurposeTypeId.equals(currentContactMechPurposeTypeId)) && !telecomNumberChanged && !postalAddressChanged && !emailAddressChanged; @@ -2617,7 +2618,7 @@ public class PartyServices { currentContactMechPurposeTypeId = "GENERAL_LOCATION"; } Map serviceResult = dispatcher.runSync("createPartyContactMech", UtilMisc.toMap("partyId", newPartyId, - "contactMechId", newContactMechId, "contactMechPurposeTypeId", currentContactMechPurposeTypeId, + "contactMechId", newContactMechId, "contactMechTypeId", currentContactMechTypeId, "contactMechPurposeTypeId", currentContactMechPurposeTypeId, "userLogin", userLogin)); if (ServiceUtil.isError(serviceResult)) { return ServiceUtil.returnError(ServiceUtil.getErrorMessage(serviceResult)); @@ -2634,7 +2635,7 @@ public class PartyServices { currentContactMechPurposeTypeId = "PHONE_WORK"; } Map resultMap = dispatcher.runSync("createPartyContactMech", UtilMisc.toMap("partyId", newPartyId, - "contactMechId", newContactMechId, "contactMechPurposeTypeId", currentContactMechPurposeTypeId, + "contactMechId", newContactMechId, "contactMechTypeId", currentContactMechTypeId, "contactMechPurposeTypeId", currentContactMechPurposeTypeId, "userLogin", userLogin)); if (ServiceUtil.isError(resultMap)) { return ServiceUtil.returnError(ServiceUtil.getErrorMessage(result)); @@ -2651,7 +2652,7 @@ public class PartyServices { currentContactMechPurposeTypeId = "PRIMARY_EMAIL"; } Map resultMap = dispatcher.runSync("createPartyContactMech", UtilMisc.toMap("partyId", newPartyId, - "contactMechId", newContactMechId, "contactMechPurposeTypeId", currentContactMechPurposeTypeId, "userLogin", + "contactMechId", newContactMechId, "contactMechTypeId", currentContactMechTypeId, "contactMechPurposeTypeId", currentContactMechPurposeTypeId, "userLogin", userLogin)); if (ServiceUtil.isError(resultMap)) { return ServiceUtil.returnError(ServiceUtil.getErrorMessage(result));