[ 
https://issues.apache.org/jira/browse/OFBIZ-4691?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13216699#comment-13216699
 ] 

Jacques Le Roux commented on OFBIZ-4691:
----------------------------------------

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:

{code}
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 ---------------------------------------------------------------------

{code}

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...
                
> account_lead relation not expired and lead roles not deleted while converting 
> a lead into contact/account in SFA
> ----------------------------------------------------------------------------------------------------------------
>
>                 Key: OFBIZ-4691
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-4691
>             Project: OFBiz
>          Issue Type: Bug
>          Components: marketing
>    Affects Versions: SVN trunk
>            Reporter: Dimitrios Moustos
>            Priority: Trivial
>              Labels: patch
>         Attachments: LeadServices.xml.patch
>
>
> 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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to