Skip to Content
0

C4C PDI How to get BusinessPartner ID from an Employee instance

Nov 10, 2016 at 06:21 PM

630

avatar image

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.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

6 Answers

Pradeep Kumar N
Nov 11, 2016 at 04:06 AM
1

Hi Tiago,

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

Thanks, Pradeep.

Share
10 |10000 characters needed characters left characters exceeded
Alexandre Kaminagakura Mar 16, 2017 at 01:32 AM
1

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.

Share
10 |10000 characters needed characters left characters exceeded
Senthil Murugan Mar 16, 2017 at 03:11 AM
1

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;
			}
		}
	}
}
Share
10 |10000 characters needed characters left characters exceeded
Tiago Almeida Nov 11, 2016 at 10:59 AM
0

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,


Share
10 |10000 characters needed characters left characters exceeded
Pavel Bugel Mar 15, 2017 at 01:25 PM
0

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

Thank you and Kind regards,

Pavel

Show 1 Share
10 |10000 characters needed characters left 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

0
Xinguang Chen
Mar 16, 2017 at 08:58 AM
0

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


u0j24.png (24.5 kB)
rtqsr.png (67.9 kB)
bxhci.png (67.9 kB)
Share
10 |10000 characters needed characters left characters exceeded