GenericValue partyRelationship = delegator.makeValue("PartyRelationship", UtilMisc.toMap("partyIdFrom", party.getString("partyId"), "partyIdTo", affiliateId, "roleTypeIdFrom", "CUSTOMER", "roleTypeIdTo", "AFFILIATE"));
partyRelationship.set("fromDate", UtilDateTime.nowTimestamp());
partyRelationship.set("partyRelationshipTypeId", "SALES_AFFILIATE");
try {
delegator.create(partyRelationship);
if (Debug.infoOn()) Debug.logInfo("Affiliate for user " + party.getString("partyId") + " set to " + affiliateId, module);
} catch (GenericEntityException gee) {
Debug.logWarning(gee, module);
}
} else {