cancel
Showing results for 
Search instead for 
Did you mean: 

C4C PDI How to get BusinessPartner ID from an Employee instance

former_member234906
Participant
0 Kudos

Hi,

This is a pure absl question.

I have a bunch of Employee instances, and need to query Leads for which they are owners. The leads query is something along the lines of

leadsSelParams.Add(leadsQuery.PartyResponsibleEmployeePartyKey.PartyID.content, "I", "EQ", some8digitID);

The some8DigitID is actually a Business Partner ID.

The problem I face is that the Employee instances have multiple ID fields inside but none of them is the right ID (and can't be plugged in the above query), they are all Employee IDs. (shorter and different).

A specific example: I have a lead assigned to say John. He has employee ID 48, but to get the right Lead with the Query I need to use his Business Partner ID (which is 8000000075). So can one get the Business Partner ID (80000000075) from an Employee instance?

Thank you very much in advance.

Accepted Solutions (0)

Answers (6)

Answers (6)

former_member207719
Participant

Hi Tiago,

I once tried the same as below and it worked for me.

import ABSL;
import AP.FO.BusinessPartner.Global;
import AP.PC.IdentityManagement.Global;
this.GetBPID.Clear();

if(!this.TestID.content.IsInitial())
{
	var employeeID : Employee.Identification.EmployeeID;
	employeeID.content = this.TestID.content;

	var employeeIns = Employee.Identification.Retrieve(employeeID);
	if(employeeIns.IsSet())
	{
		if(!BPIDIns.content.IsInitial())
		{
			var BUPAIns = BusinessPartner.Retrieve(employeeIns.ToRoot.AssignedIdentity.BusinessPartnerUUID);
			if(BUPAIns.IsSet())
			{
				this.GetBPID = BUPAIns.InternalID;
			}
		}
	}
}
Former Member

Hi there.

Could you check the following?

"Employee.BusinessPartnerSolutionExtension.BusinessPartner.InternalID"

It may be possible to access if you have an employee instance (var e = Employee.Retrieve();)

Best regards,

Alexandre.

former_member186648
Active Contributor

Hi Tiago,

You could call Query "QueryByEmployeeAttributes" on "Employee" BO, this accepts Employee ID and returns BusinessPartner ID.

Thanks, Pradeep.

Former Member
0 Kudos

Hi there,

1.Employee ID:

  1. In UI, Work Center View: People -> Employees -> ID

  • In Backend, Business Object: Employee -> IdentificationEmployeeID -> BusinessPartyID

2.Business Partner ID:

  • In UI, Work Center View( Silverlight only) Business Partyners -> Business Partyners -> Business Partyner ID

  • In Backend, Business Object: Employee -> Root -> InternalID

Hope this can helps you distinguish Employee ID and Business Partner ID

pbugel
Explorer
0 Kudos

Hi Tiago. Were you able to solve your Issue? I would very much like to know the solution.

Thank you and Kind regards,

Pavel

former_member226
Employee
Employee
0 Kudos

Hi,

Can you please try to use following query to get BP Internal ID (8******) from Employee ID?

var query = Employee.Identification.QueryByEmployeeAttributes;
var par = query.CreateSelectionParams();
par.Add( query.EmployeeID.content, "I","EQ","E1876"); // E1876 is employee ID to be searched. This can be get from Identification.EmployeeID.Content
var res = query.Execute( par ).GetFirst().ToRoot.BusinessPartnerSolutionExtensions.BusinessPartner.InternalID;

Thanks

Saurabh

former_member234906
Participant
0 Kudos

Thanks for the reply Pradeep. Unfortunately that does not seem to work.

When I use that query with the Employee ID I get an object with both businessPartnerID and employeeID set to the same value:

In this image, lead_owner.ToCurOwner is an employee instance ( association ToCurOwner to Employee;)

.Identification is a list but has only one entry. The "48" is hardcoded as a test.

The system does have this relationship somewhere because on the Business partners tab (silverlight) I can find it, I see it has a role "employee" and when I open it, the new screen shows the employee ID.

What am I missing?

Thanks & regards,