Skip to Content

C4C PDI How to get BusinessPartner ID from an Employee instance

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.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

6 Answers

  • Nov 11, 2016 at 04:06 AM

    Hi Tiago,

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

    Thanks, Pradeep.

    Add comment
    10|10000 characters needed characters exceeded

  • Mar 16, 2017 at 01:32 AM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • Mar 16, 2017 at 03:11 AM

    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;
    			}
    		}
    	}
    }
    
    Add comment
    10|10000 characters needed characters exceeded

  • Nov 11, 2016 at 10:59 AM

    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,

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Mar 15, 2017 at 01:25 PM

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

    Thank you and Kind regards,

    Pavel

    Add comment
    10|10000 characters needed characters exceeded

    • 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

  • avatar image
    Former Member
    Mar 16, 2017 at 08:58 AM

    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

    Add comment
    10|10000 characters needed characters exceeded