on 11-10-2016 6:21 PM
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.
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;
}
}
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Tiago,
You could call Query "QueryByEmployeeAttributes" on "Employee" BO, this accepts Employee ID and returns BusinessPartner ID.
Thanks, Pradeep.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi there,
1.Employee ID:
2.Business Partner ID:
Hope this can helps you distinguish Employee ID and Business Partner ID
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Tiago. Were you able to solve your Issue? I would very much like to know the solution.
Thank you and Kind regards,
Pavel
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
78 | |
9 | |
8 | |
6 | |
6 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.