cancel
Showing results for 
Search instead for 
Did you mean: 

Add Party to Lead Error: Party inconsistent due to "Employee does not exist in master data"

ThomasZwerg
Participant
891

Add Party to Lead Error: Party inconsistent due to "Employee does not exist in master data" although it is there

Hello,

I have a problem when adding employees to the "sales & marketing team" of a Lead or "sales team" of an opportunity.

Usecase:

Based on some logic a subset of employees is determined from the Account-Team of the Lead-underlying account. These employees should all be added to the lead's "sales & marketing team".

Implementation(s):

We tried more or less the same in Lead and opportunity, therefore I'll only focus on the lead for now:

foreach(var oAccountEmployee in cAccountEmployees){
			
	// ... retreive BP from Employee -> oBP

	if(oBP.IsSet()){

		var oSalesEmployeePartyValues :elementsof oLead.Party;
		oSalesEmployeePartyValues.RoleCode = "ZSM";
		oSalesEmployeePartyValues.PartyKey.PartyID.content = oBP.InternalID; 
			// third try: using Employee - ID
		//oSalesEmployeePartyValues.PartyKey.PartyID.content = oAccountEmployee.EmployeeID.content;
		oSalesEmployeePartyValues.PartyKey.PartyTypeCode = "167";	// 167 - Employee 
		
		oLead.SalesEmployeeParty.Create(oSalesEmployeePartyValues);
			// second try: adding as "Party"
		//oLead.Party.Create(oSalesEmployeePartyValues);
	}

}

After getting the error, we tried different approaches marked as second try and third try above. But we always get below error messages.

Error:

Error: Please report an incident. Party instance is inconsistent.

Warning: Please enter another party ID. <RoleName> 8000000093 (<FirstName> <LastName>) does not exist in master data.

Issue:

  1. We did some similar implementation a year ago for an other customer and it worked without any problems. Have there been any changes since then?
  2. I see that the party is inconsistent as long as the employee (or BP) is is not present. This is underlined by the fact that there is only the role added but no Employee.
  3. What we do not understand is the warning, as the warning itself includes the full name of the employee. If it is possible in case of the warning to retrieve the BP details, I assume it is present in master data.
  4. Further I can add the very same employee with the same roles manually.
  5. And if I debug before and after the above coding I can see that there are all fields of the party filled properly.

Before our logic:

Lead.Party

08:28:35 [1:I] Trace       - - - - - - - - - - - - - - - - - - - - -
08:28:35 [1:I] Trace       PartyID 000000000000000000000000000000000000000000000000000000318454
08:28:35 [1:I] Trace       PartyTypeCode 159
08:28:35 [1:I] Trace       RoleCategoryCode 31
08:28:35 [1:I] Trace       RoleCode 31
08:28:35 [1:I] Trace       - - - - - - - - - - - - - - - - - - - - -
08:28:35 [1:I] Trace       - - - - - - - - - - - - - - - - - - - - -
08:28:35 [1:I] Trace       PartyID 000000000000000000000000000000000000000000000000008000000032
08:28:35 [1:I] Trace       PartyTypeCode 167
08:28:35 [1:I] Trace       RoleCategoryCode 46
08:28:35 [1:I] Trace       RoleCode ZSM
08:28:35 [1:I] Trace       - - - - - - - - - - - - - - - - - - - - -
08:28:35 [1:I] Trace       - - - - - - - - - - - - - - - - - - - - -
08:28:35 [1:I] Trace       PartyID 000000000000000000000000000000000000000000000000008000000093
08:28:35 [1:I] Trace       PartyTypeCode 167
08:28:35 [1:I] Trace       RoleCategoryCode 46
08:28:35 [1:I] Trace       RoleCode ZSR
08:28:35 [1:I] Trace       - - - - - - - - - - - - - - - - - - - - -
08:28:35 [1:I] Trace       - - - - - - - - - - - - - - - - - - - - -
08:28:35 [1:I] Trace       PartyID 000000000000000000000000000000000000000000000000008000000003
08:28:35 [1:I] Trace       PartyTypeCode 167
08:28:35 [1:I] Trace       RoleCategoryCode 46
08:28:35 [1:I] Trace       RoleCode 46
08:28:35 [1:I] Trace       - - - - - - - - - - - - - - - - - - - - -
08:28:35 [1:I] Trace       - - - - - - - - - - - - - - - - - - - - -
08:28:35 [1:I] Trace       PartyID 000000000000000000000000000000000000000000000000008000000003
08:28:35 [1:I] Trace       PartyTypeCode 167
08:28:35 [1:I] Trace       RoleCategoryCode 39
08:28:35 [1:I] Trace       RoleCode 39
08:28:35 [1:I] Trace       - - - - - - - - - - - - - - - - - - - - -
Lead.SalesEmployeeParty

08:28:35 [1:I] Trace       - S - - - - - - - - - - - - - - - - - - -
08:28:35 [1:I] Trace       PartyID 000000000000000000000000000000000000000000000000008000000032
08:28:35 [1:I] Trace       PartyTypeCode 167
08:28:35 [1:I] Trace       RoleCategoryCode 46
08:28:35 [1:I] Trace       RoleCode ZSM
08:28:35 [1:I] Trace       - - - - - - - - - - - - - - - - - - - - -
08:28:35 [1:I] Trace       - S - - - - - - - - - - - - - - - - - - -
08:28:35 [1:I] Trace       PartyID 000000000000000000000000000000000000000000000000008000000093
08:28:35 [1:I] Trace       PartyTypeCode 167
08:28:35 [1:I] Trace       RoleCategoryCode 46
08:28:35 [1:I] Trace       RoleCode ZSR
08:28:35 [1:I] Trace       - - - - - - - - - - - - - - - - - - - - -
08:28:35 [1:I] Trace       - S - - - - - - - - - - - - - - - - - - -
08:28:35 [1:I] Trace       PartyID 000000000000000000000000000000000000000000000000008000000003
08:28:35 [1:I] Trace       PartyTypeCode 167
08:28:35 [1:I] Trace       RoleCategoryCode 46
08:28:35 [1:I] Trace       RoleCode 46
08:28:35 [1:I] Trace       - - - - - - - - - - - - - - - - - - - - -

after our logic:

Lead.Party

08:29:57 [1:I] Trace       2 - - - - - - - - - - - - - - - - - - - -
08:29:57 [1:I] Trace       PartyID 000000000000000000000000000000000000000000000000000000318454
08:29:57 [1:I] Trace       PartyTypeCode 159
08:29:57 [1:I] Trace       RoleCategoryCode 31
08:29:57 [1:I] Trace       RoleCode 31
08:29:57 [1:I] Trace       - - - - - - - - - - - - - - - - - - - - -
08:29:57 [1:I] Trace       2 - - - - - - - - - - - - - - - - - - - -
08:29:57 [1:I] Trace       PartyID 000000000000000000000000000000000000000000000000008000000003
08:29:57 [1:I] Trace       PartyTypeCode 167
08:29:57 [1:I] Trace       RoleCategoryCode 46
08:29:57 [1:I] Trace       RoleCode 46
08:29:57 [1:I] Trace       - - - - - - - - - - - - - - - - - - - - -
08:29:57 [1:I] Trace       2 - - - - - - - - - - - - - - - - - - - -
08:29:57 [1:I] Trace       PartyID 000000000000000000000000000000000000000000000000008000000003
08:29:57 [1:I] Trace       PartyTypeCode 167
08:29:57 [1:I] Trace       RoleCategoryCode 39
08:29:57 [1:I] Trace       RoleCode 39
08:29:57 [1:I] Trace       - - - - - - - - - - - - - - - - - - - - -
08:29:57 [1:I] Trace       2 - - - - - - - - - - - - - - - - - - - -
08:29:57 [1:I] Trace       PartyID 000000000000000000000000000000000000000000000000008000000093
08:29:57 [1:I] Trace       PartyTypeCode 167
08:29:57 [1:I] Trace       RoleCategoryCode 46
08:29:57 [1:I] Trace       RoleCode ZSR
08:29:57 [1:I] Trace       - - - - - - - - - - - - - - - - - - - - -
08:29:57 [1:I] Trace       2 - - - - - - - - - - - - - - - - - - - -
08:29:57 [1:I] Trace       PartyID 000000000000000000000000000000000000000000000000008000000032
08:29:57 [1:I] Trace       PartyTypeCode 167
08:29:57 [1:I] Trace       RoleCategoryCode 46
08:29:57 [1:I] Trace       RoleCode ZSM
08:29:57 [1:I] Trace       - - - - - - - - - - - - - - - - - - - - -
08:29:57 [1:I] Trace       2 - - - - - - - - - - - - - - - - - - - -
08:29:57 [1:I] Trace       PartyID 000000000000000000000000000000000000000000000000008000000151
08:29:57 [1:I] Trace       PartyTypeCode 167
08:29:57 [1:I] Trace       RoleCategoryCode 46
08:29:57 [1:I] Trace       RoleCode ZSM
08:29:57 [1:I] Trace       - - - - - - - - - - - - - - - - - - - - -
08:29:57 [1:I] Trace       2 - - - - - - - - - - - - - - - - - - - -
08:29:57 [1:I] Trace       PartyID 000000000000000000000000000000000000000000000000008000000040
08:29:57 [1:I] Trace       PartyTypeCode 167
08:29:57 [1:I] Trace       RoleCategoryCode 46
08:29:57 [1:I] Trace       RoleCode ZSM
08:29:57 [1:I] Trace       - - - - - - - - - - - - - - - - - - - - -
Lead.SalesEmployeeParty

08:29:57 [1:I] Trace       2 S - - - - - - - - - - - - - - - - - - -
08:29:57 [1:I] Trace       PartyID 000000000000000000000000000000000000000000000000008000000003
08:29:57 [1:I] Trace       PartyTypeCode 167
08:29:57 [1:I] Trace       RoleCategoryCode 46
08:29:57 [1:I] Trace       RoleCode 46
08:29:57 [1:I] Trace       - - - - - - - - - - - - - - - - - - - - -
08:29:57 [1:I] Trace       2 S - - - - - - - - - - - - - - - - - - -
08:29:57 [1:I] Trace       PartyID 000000000000000000000000000000000000000000000000008000000093
08:29:57 [1:I] Trace       PartyTypeCode 167
08:29:57 [1:I] Trace       RoleCategoryCode 46
08:29:57 [1:I] Trace       RoleCode ZSR
08:29:57 [1:I] Trace       - - - - - - - - - - - - - - - - - - - - -
08:29:57 [1:I] Trace       2 S - - - - - - - - - - - - - - - - - - -
08:29:57 [1:I] Trace       PartyID 000000000000000000000000000000000000000000000000008000000032
08:29:57 [1:I] Trace       PartyTypeCode 167
08:29:57 [1:I] Trace       RoleCategoryCode 46
08:29:57 [1:I] Trace       RoleCode ZSM
08:29:57 [1:I] Trace       - - - - - - - - - - - - - - - - - - - - -
08:29:57 [1:I] Trace       2 S - - - - - - - - - - - - - - - - - - -
08:29:57 [1:I] Trace       PartyID 000000000000000000000000000000000000000000000000008000000151
08:29:57 [1:I] Trace       PartyTypeCode 167
08:29:57 [1:I] Trace       RoleCategoryCode 46
08:29:57 [1:I] Trace       RoleCode ZSM
08:29:57 [1:I] Trace       - - - - - - - - - - - - - - - - - - - - -
08:29:57 [1:I] Trace       2 S - - - - - - - - - - - - - - - - - - -
08:29:57 [1:I] Trace       PartyID 000000000000000000000000000000000000000000000000008000000040
08:29:57 [1:I] Trace       PartyTypeCode 167
08:29:57 [1:I] Trace       RoleCategoryCode 46
08:29:57 [1:I] Trace       RoleCode ZSM
08:29:57 [1:I] Trace       - - - - - - - - - - - - - - - - - - - - -

Do you see the bug in the coding or the error in the concept of this approach?


We did some similar implementation a year ago for an other customer and it worked without any problems. Have there been any changes since then?

By the way the messages are raised from Party node:

08:30:03 [1:E] Message     (LEAD, PARTY) Please report an incident. Party instance is inconsistent.
08:30:03 [1:W] Message     (LEAD, PARTY) Please enter another party ID. <RoleName> 8000000093 (<FirstName> <LastName>) does not exist in master data.

Accepted Solutions (0)

Answers (0)