OFBiz
  1. OFBiz
  2. OFBIZ-4691

account_lead relation not expired and lead roles not deleted while converting a lead into contact/account in SFA

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Trivial Trivial
    • Resolution: Incomplete
    • Affects Version/s: Trunk
    • Fix Version/s: None
    • Component/s: marketing
    • Labels:

      Description

      leads used to be listed by the ListLeads form even after having been converted. The solution is to delete the lead partyRoles.
      The other problem was that the relationship between the owner of the account lead was not properly expired due to the party Id being taken from an empty variable. The solution was changing the wrong variable: partyGroupPartyId to partyGroupId.

      This is my first contribution to ofbiz, so please do review.

      1. LeadServices.xml.patch
        2 kB
        Dimitrios Moustos

        Activity

        Hide
        Dimitrios Moustos added a comment -

        it does indeed. i will get back after i check it out. One problem which can be solved easily is deleting the party relationship instead of expiring it, that helps you convert a lead created in sfa, but lead sfa102 still does not work. thanks jacques.

        Show
        Dimitrios Moustos added a comment - it does indeed. i will get back after i check it out. One problem which can be solved easily is deleting the party relationship instead of expiring it, that helps you convert a lead created in sfa, but lead sfa102 still does not work. thanks jacques.
        Hide
        Jacques Le Roux added a comment -

        Hi,

        Did you try your changes? I wonder because after applying you changes, I get this error locally (using OOTB Derby)

        The Following Errors Occurred:
        ERROR: Could not complete the Delete a PartyRole file:/D:/workspace/ofbizClean/applications/party/script/org/ofbiz/party/party/PartyServices.xml#deletePartyRole process [problem removing the partyRole value: Exception while deleting the following entity: [GenericEntity:PartyRole][partyId,sfa101(java.lang.String)][roleTypeId,LEAD(java.lang.String)] (SQL Exception while executing the following:DELETE FROM OFBIZ.PARTY_ROLE WHERE PARTY_ID=? AND ROLE_TYPE_ID=? (DELETE on table 'PARTY_ROLE' caused a violation of foreign key constraint 'PARTY_REL_TPROLE' for key (sfa101,LEAD). The statement has been rolled back.))]

        in log:

        2012-02-26 12:29:31,953 (http-bio-0.0.0.0-8443-exec-6) [                Log.java:117:INFO ] [LeadServices.xml#convertLeadToContact line 142] Expiring relationship  {partyIdFrom=DemoLeadOwner, partyIdTo=sfa10
        , roleTypeIdFrom=OWNER, roleTypeIdTo=LEAD, fromDate=2000-01-01 00:00:00.0, thruDate=2012-02-26 12:29:31.906, statusId=null, relationshipName=null, securityGroupId=null, priorityTypeId=null, partyRelationship
        ypeId=LEAD_OWNER, permissionsEnumId=null, positionTitle=null, comments=null, userLogin=[GenericEntity:UserLogin][createdStamp,2012-02-12 13:28:12.234(java.sql.Timestamp)][createdTxStamp,2012-02-12 13:28:12.1
        6(java.sql.Timestamp)][currentPassword,{SHA}47ca69ebb4bdc9ae0adec130880165d2cc05db1a(java.lang.String)][disabledDateTime,null()][enabled,null()][externalAuthId,null()][hasLoggedOut,null()][isSystem,null()][l
        stCurrencyUom,null()][lastLocale,en(java.lang.String)][lastTimeZone,null()][lastUpdatedStamp,2012-02-24 19:22:55.406(java.sql.Timestamp)][lastUpdatedTxStamp,2012-02-24 19:22:55.406(java.sql.Timestamp)][party
        d,admin(java.lang.String)][passwordHint,null()][requirePasswordChange,null()][successiveFailedLogins,null()][userLdapDn,null()][userLoginId,admin(java.lang.String)], locale=en}
        2012-02-26 12:29:32,000 (http-bio-0.0.0.0-8443-exec-6) [   GenericDelegator.java:1100:ERROR]
        ---- exception report ----------------------------------------------------------
        Failure in removeValue operation for entity [PartyRole]: org.ofbiz.entity.GenericDataSourceException: Exception while deleting the following entity: [GenericEntity:PartyRole][partyId,sfa101(java.lang.String)
        [roleTypeId,LEAD(java.lang.String)] (SQL Exception while executing the following:DELETE FROM OFBIZ.PARTY_ROLE WHERE PARTY_ID=? AND ROLE_TYPE_ID=? (DELETE on table 'PARTY_ROLE' caused a violation of foreign k
        y constraint 'PARTY_REL_TPROLE' for key (sfa101,LEAD).  The statement has been rolled back.)). Rolling back transaction.
        Exception: org.ofbiz.entity.GenericDataSourceException
        Message: Exception while deleting the following entity: [GenericEntity:PartyRole][partyId,sfa101(java.lang.String)][roleTypeId,LEAD(java.lang.String)] (SQL Exception while executing the following:DELETE FROM
        OFBIZ.PARTY_ROLE WHERE PARTY_ID=? AND ROLE_TYPE_ID=? (DELETE on table 'PARTY_ROLE' caused a violation of foreign key constraint 'PARTY_REL_TPROLE' for key (sfa101,LEAD).  The statement has been rolled back.)
        
        ---- cause ---------------------------------------------------------------------
        
        

        I tested on an already company assigned lead (Lead, John [sfa101]) and a non assigned (I assigned before converting to "A promising Lead Company [sfa102]")

        So, apart if I missed something, it seems more work is needed...

        Show
        Jacques Le Roux added a comment - Hi, Did you try your changes? I wonder because after applying you changes, I get this error locally (using OOTB Derby) The Following Errors Occurred: ERROR: Could not complete the Delete a PartyRole file:/D:/workspace/ofbizClean/applications/party/script/org/ofbiz/party/party/PartyServices.xml#deletePartyRole process [problem removing the partyRole value: Exception while deleting the following entity: [GenericEntity:PartyRole] [partyId,sfa101(java.lang.String)] [roleTypeId,LEAD(java.lang.String)] (SQL Exception while executing the following:DELETE FROM OFBIZ.PARTY_ROLE WHERE PARTY_ID=? AND ROLE_TYPE_ID=? (DELETE on table 'PARTY_ROLE' caused a violation of foreign key constraint 'PARTY_REL_TPROLE' for key (sfa101,LEAD). The statement has been rolled back.))] in log: 2012-02-26 12:29:31,953 (http-bio-0.0.0.0-8443-exec-6) [ Log.java:117:INFO ] [LeadServices.xml#convertLeadToContact line 142] Expiring relationship {partyIdFrom=DemoLeadOwner, partyIdTo=sfa10 , roleTypeIdFrom=OWNER, roleTypeIdTo=LEAD, fromDate=2000-01-01 00:00:00.0, thruDate=2012-02-26 12:29:31.906, statusId= null , relationshipName= null , securityGroupId= null , priorityTypeId= null , partyRelationship ypeId=LEAD_OWNER, permissionsEnumId= null , positionTitle= null , comments= null , userLogin=[GenericEntity:UserLogin][createdStamp,2012-02-12 13:28:12.234(java.sql.Timestamp)][createdTxStamp,2012-02-12 13:28:12.1 6(java.sql.Timestamp)][currentPassword,{SHA}47ca69ebb4bdc9ae0adec130880165d2cc05db1a(java.lang. String )][disabledDateTime, null ()][enabled, null ()][externalAuthId, null ()][hasLoggedOut, null ()][isSystem, null ()][l stCurrencyUom, null ()][lastLocale,en(java.lang. String )][lastTimeZone, null ()][lastUpdatedStamp,2012-02-24 19:22:55.406(java.sql.Timestamp)][lastUpdatedTxStamp,2012-02-24 19:22:55.406(java.sql.Timestamp)][party d,admin(java.lang. String )][passwordHint, null ()][requirePasswordChange, null ()][successiveFailedLogins, null ()][userLdapDn, null ()][userLoginId,admin(java.lang. String )], locale=en} 2012-02-26 12:29:32,000 (http-bio-0.0.0.0-8443-exec-6) [ GenericDelegator.java:1100:ERROR] ---- exception report ---------------------------------------------------------- Failure in removeValue operation for entity [PartyRole]: org.ofbiz.entity.GenericDataSourceException: Exception while deleting the following entity: [GenericEntity:PartyRole][partyId,sfa101(java.lang. String ) [roleTypeId,LEAD(java.lang. String )] (SQL Exception while executing the following:DELETE FROM OFBIZ.PARTY_ROLE WHERE PARTY_ID=? AND ROLE_TYPE_ID=? (DELETE on table 'PARTY_ROLE' caused a violation of foreign k y constraint 'PARTY_REL_TPROLE' for key (sfa101,LEAD). The statement has been rolled back.)). Rolling back transaction. Exception: org.ofbiz.entity.GenericDataSourceException Message: Exception while deleting the following entity: [GenericEntity:PartyRole][partyId,sfa101(java.lang. String )][roleTypeId,LEAD(java.lang. String )] (SQL Exception while executing the following:DELETE FROM OFBIZ.PARTY_ROLE WHERE PARTY_ID=? AND ROLE_TYPE_ID=? (DELETE on table 'PARTY_ROLE' caused a violation of foreign key constraint 'PARTY_REL_TPROLE' for key (sfa101,LEAD). The statement has been rolled back.) ---- cause --------------------------------------------------------------------- I tested on an already company assigned lead (Lead, John [sfa101] ) and a non assigned (I assigned before converting to "A promising Lead Company [sfa102] ") So, apart if I missed something, it seems more work is needed...

          People

          • Assignee:
            Unassigned
            Reporter:
            Dimitrios Moustos
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development