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

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

Oivier,

I tried to create an employment for DemoCustAgent, AUTHOR_BIGAL, AcctBuyer (all 
persons) and got these errors


{noformat}
2019-05-15 12:01:33,657 |jsse-nio-8443-exec-8 |GenericDelegator              
|E| Failure in create operation for entity [Employment]: 
org.apache.ofbiz.entity.GenericEntityException: Error while inserting: 
[GenericEntity:Employment][creat
edStamp,2019-05-15 12:01:33.596(java.sql.Timestamp)][createdTxStamp,2019-05-15 
12:01:33.472(java.sql.Timestamp)][fromDate,2019-05-15 
12:01:05.0(java.sql.Timestamp)][lastUpdatedStamp,2019-05-15 
12:01:33.596(java.sql.Timestamp)][lastUpdate
dTxStamp,2019-05-15 
12:01:33.472(java.sql.Timestamp)][partyIdFrom,Enterprise(java.lang.String)][partyIdTo,DemoCustAgent(java.lang.String)][roleTypeIdFrom,INTERNAL_ORGANIZATIO(java.lang.String)][roleTypeIdTo,EMPLOYEE(java.lang.String)]
 (S
QL Exception while executing the following:INSERT INTO OFBIZ.EMPLOYMENT 
(ROLE_TYPE_ID_FROM, ROLE_TYPE_ID_TO, PARTY_ID_FROM, PARTY_ID_TO, FROM_DATE, 
THRU_DATE, TERMINATION_REASON_ID, TERMINATION_TYPE_ID, LAST_UPDATED_STAMP, 
LAST_UPDATED_T
X_STAMP, CREATED_STAMP, CREATED_TX_STAMP) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 
?, ?) (INSERT on table 'EMPLOYMENT' caused a violation of foreign key 
constraint 'EMPLMNT_TPTRL' for key (DemoCustAgent,EMPLOYEE).  The statement has 
been ro

2019-05-15 12:02:33,011 |jsse-nio-8443-exec-6 |GenericDelegator              
|E| Failure in create operation for entity [Employment]: 
org.apache.ofbiz.entity.GenericEntityException: Error while inserting: 
[GenericEntity:Employment][creat
edStamp,2019-05-15 12:02:33.009(java.sql.Timestamp)][createdTxStamp,2019-05-15 
12:02:32.932(java.sql.Timestamp)][fromDate,2019-05-15 
12:01:05.0(java.sql.Timestamp)][lastUpdatedStamp,2019-05-15 
12:02:33.009(java.sql.Timestamp)][lastUpdate
dTxStamp,2019-05-15 
12:02:32.932(java.sql.Timestamp)][partyIdFrom,Enterprise(java.lang.String)][partyIdTo,AUTHOR_BIGAL(java.lang.String)][roleTypeIdFrom,INTERNAL_ORGANIZATIO(java.lang.String)][roleTypeIdTo,EMPLOYEE(java.lang.String)]
 (SQ
L Exception while executing the following:INSERT INTO OFBIZ.EMPLOYMENT 
(ROLE_TYPE_ID_FROM, ROLE_TYPE_ID_TO, PARTY_ID_FROM, PARTY_ID_TO, FROM_DATE, 
THRU_DATE, TERMINATION_REASON_ID, TERMINATION_TYPE_ID, LAST_UPDATED_STAMP, 
LAST_UPDATED_TX
_STAMP, CREATED_STAMP, CREATED_TX_STAMP) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 
?, ?) (INSERT on table 'EMPLOYMENT' caused a violation of foreign key 
constraint 'EMPLMNT_TPTRL' for key (AUTHOR_BIGAL,EMPLOYEE).  The statement has 
been roll
ed back.)). Rolling back transaction.

2019-05-15 12:03:01,726 |jsse-nio-8443-exec-4 |GenericDelegator              
|E| Failure in create operation for entity [Employment]: 
org.apache.ofbiz.entity.GenericEntityException: Error while inserting: 
[GenericEntity:Employment][creat
edStamp,2019-05-15 12:03:01.724(java.sql.Timestamp)][createdTxStamp,2019-05-15 
12:03:01.704(java.sql.Timestamp)][fromDate,2019-05-15 
12:01:05.0(java.sql.Timestamp)][lastUpdatedStamp,2019-05-15 
12:03:01.724(java.sql.Timestamp)][lastUpdate
dTxStamp,2019-05-15 
12:03:01.704(java.sql.Timestamp)][partyIdFrom,Enterprise(java.lang.String)][partyIdTo,AcctBuyer(java.lang.String)][roleTypeIdFrom,INTERNAL_ORGANIZATIO(java.lang.String)][roleTypeIdTo,EMPLOYEE(java.lang.String)]
 (SQL E
xception while executing the following:INSERT INTO OFBIZ.EMPLOYMENT 
(ROLE_TYPE_ID_FROM, ROLE_TYPE_ID_TO, PARTY_ID_FROM, PARTY_ID_TO, FROM_DATE, 
THRU_DATE, TERMINATION_REASON_ID, TERMINATION_TYPE_ID, LAST_UPDATED_STAMP, 
LAST_UPDATED_TX_ST
AMP, CREATED_STAMP, CREATED_TX_STAMP) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 
?) (INSERT on table 'EMPLOYMENT' caused a violation of foreign key constraint 
'EMPLMNT_TPTRL' for key (AcctBuyer,EMPLOYEE).  The statement has been rolled bac
{noformat}

It works for DemoEmployee because s/he is already an employee and the 
payHistory is then updated. So it needs to work also for new employees...

> Unable to create Employments
> ----------------------------
>
>                 Key: OFBIZ-10969
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-10969
>             Project: OFBiz
>          Issue Type: Bug
>          Components: humanres
>    Affects Versions: Trunk
>            Reporter: Arpit Mor
>            Assignee: Jacques Le Roux
>            Priority: Major
>         Attachments: Image1.png
>
>
> Steps to regenerate:
>  # Login to the URL: 
> [https://demo-trunk.ofbiz.apache.org/humanres/control/main]
>  # Click on Employments
>  # Click on New Employments
>  # Click on Create
> Actual: Error message is displayed. Please refer attachment: Image1



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to