Author: apatel
Date: Wed Jun 3 06:48:13 2009 New Revision: 781278 URL: http://svn.apache.org/viewvc?rev=781278&view=rev Log: Fixed convertLead process, now creating appropriate relationships. Modified: ofbiz/trunk/applications/marketing/script/org/ofbiz/sfa/account/AccountServices.xml ofbiz/trunk/applications/marketing/script/org/ofbiz/sfa/lead/LeadServices.xml Modified: ofbiz/trunk/applications/marketing/script/org/ofbiz/sfa/account/AccountServices.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/marketing/script/org/ofbiz/sfa/account/AccountServices.xml?rev=781278&r1=781277&r2=781278&view=diff ============================================================================== --- ofbiz/trunk/applications/marketing/script/org/ofbiz/sfa/account/AccountServices.xml (original) +++ ofbiz/trunk/applications/marketing/script/org/ofbiz/sfa/account/AccountServices.xml Wed Jun 3 06:48:13 2009 @@ -20,16 +20,17 @@ <simple-methods xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/simple-methods.xsd"> <simple-method method-name="createAccount" short-description="create Account Group"> - <if-not-empty field="parameters.accountType"> - <set field="accountType" from-field="parameters.accountType"/> - <else> - <set field="accountType" value="GROUP"/> - </else> - </if-not-empty> <set field="parameters.roleTypeId" value="ACCOUNT"/> - <if-compare field="accountType" operator="equals" value="GROUP"> - <call-simple-method method-name="createPartyGroupRoleAndContactMechs" xml-resource="component://party/script/org/ofbiz/party/party/PartySimpleMethods.xml"/> - </if-compare> + <call-simple-method method-name="createPartyGroupRoleAndContactMechs" xml-resource="component://party/script/org/ofbiz/party/party/PartySimpleMethods.xml"/> <field-to-result field="partyId"/> + <set field="createPartyRoleCtx.partyId" from-field="userLogin.partyId"/> + <set field="createPartyRoleCtx.roleTypeId" value="OWNER"/> + <call-service service-name="createPartyRole" in-map-name="createPartyRoleCtx"/> + <set field="partyRelationshipCtx.partyIdFrom" from-field="userLogin.partyId"/> + <set field="partyRelationshipCtx.partyIdTo" from-field="partyId"/> + <set field="partyRelationshipCtx.roleTypeIdFrom" value="OWNER"/> + <set field="partyRelationshipCtx.roleTypeIdTo" value="ACCOUNT"/> + <set field="partyRelationshipCtx.partyRelationshipTypeId" value="ACCOUNT"/> + <call-service service-name="createPartyRelationship" in-map-name="partyRelationshipCtx"/> </simple-method> </simple-methods> Modified: ofbiz/trunk/applications/marketing/script/org/ofbiz/sfa/lead/LeadServices.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/marketing/script/org/ofbiz/sfa/lead/LeadServices.xml?rev=781278&r1=781277&r2=781278&view=diff ============================================================================== --- ofbiz/trunk/applications/marketing/script/org/ofbiz/sfa/lead/LeadServices.xml (original) +++ ofbiz/trunk/applications/marketing/script/org/ofbiz/sfa/lead/LeadServices.xml Wed Jun 3 06:48:13 2009 @@ -118,7 +118,7 @@ <order-by field-name="-fromDate"/> </entity-and> <first-from-list list="partyRelationships" entry="partyRelationship"/> - + <if-not-empty field="partyRelationship"> <set-service-fields service-name="updatePartyRelationship" map="partyRelationship" to-map="deletePartyRelationship"/> <call-service service-name="deletePartyRelationship" in-map-name="deletePartyRelationship"/> @@ -150,6 +150,13 @@ <set field="partyRelationshipCtx.partyRelationshipTypeId" value="EMPLOYMENT"/> <call-service service-name="createPartyRelationship" in-map-name="partyRelationshipCtx"/> + <set field="partyRelationshipCtx.partyIdFrom" from-field="userLogin.partyId"/> + <set field="partyRelationshipCtx.partyIdTo" from-field="partyGroupId"/> + <set field="partyRelationshipCtx.roleTypeIdFrom" value="OWNER"/> + <set field="partyRelationshipCtx.roleTypeIdTo" value="ACCOUNT"/> + <set field="partyRelationshipCtx.partyRelationshipTypeId" value="ACCOUNT"/> + <call-service service-name="createPartyRelationship" in-map-name="partyRelationshipCtx"/> + <set field="updatePartyCtx.partyId" from-field="parameters.partyId"/> <set field="updatePartyCtx.statusId" value="LEAD_CONVERTED"/> <call-service service-name="setPartyStatus" in-map-name="updatePartyCtx"/> |
Free forum by Nabble | Edit this page |