Hi all,

now I'm trying to add an relationship between two parties, using createPartyRelationship from applications/party/servicedef/services.xml, the description tells:
if partyIdFrom is not specified the partyId of the current userLogin will be used;
so, I'm trying:

Map createPartyRelationshipMap =
       UtilMisc.toMap(
              "roleTypeIdTo", "CUSTOMER",
              "userLogin", context.get("userLogin")
              );
[...]
createPartyRelationshipMap.put("partyIdTo", createPersonResult.get("partyId")); Map createPartyRelationshipResult = dispatcher.runSync("createPartyRelationship", createPartyRelationshipMap);
if (ServiceUtil.isError(createPartyRelationshipResult)) {
throw new GenericServiceException(ServiceUtil.getErrorMessage(createPartyRelationshipResult));
}

and I'm getting:
Failure in create operation for entity [PartyRelationship]: org.ofbiz.entity.GenericEntityException: Error while inserting: [GenericEntity:PartyRelationship][createdStamp,2008-06-06 16:18:44.82(java.sql.Timestamp)][createdTxStamp,2008-06-06 16:18:42.419(java.sql.Timestamp)][fromDate,2008-06-06 16:18:44.811(java.sql.Timestamp)][lastUpdatedStamp,2008-06-06 16:18:44.82(java.sql.Timestamp)][lastUpdatedTxStamp,2008-06-06 16:18:42.419(java.sql.Timestamp)][partyIdTo,10210(java.lang.String)][roleTypeIdFrom,_NA_(java.lang.String)][roleTypeIdTo,CUSTOMER(java.lang.String)] (SQL Exception while executing the following:INSERT INTO public.PARTY_RELATIONSHIP (PARTY_ID_FROM, PARTY_ID_TO, ROLE_TYPE_ID_FROM, ROLE_TYPE_ID_TO, FROM_DATE, THRU_DATE, STATUS_ID, RELATIONSHIP_NAME, SECURITY_GROUP_ID, PRIORITY_TYPE_ID, PARTY_RELATIONSHIP_TYPE_ID, PERMISSIONS_ENUM_ID, POSITION_TITLE, COMMENTS, LAST_UPDATED_STAMP, LAST_UPDATED_TX_STAMP, CREATED_STAMP, CREATED_TX_STAMP) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)(ERROR: null value in column "party_id_from" violates not-null constraint)). Rolling back transaction.
is the description wrong, or my understanding of the description?

Greetings,
Roland

Reply via email to