import ABSL;
import AP.PC.IdentityManagement.Global;
import AP.FO.BusinessPartner.Global;
var queryByIdentityUUID = Identity.QueryByElements;
var queryByIdentityUUIDParameter = queryByIdentityUUID.CreateSelectionParams();
var queryByEmployeeBPUUID = Employee.QueryByIdentification;
var queryByEmployeeBPUUIDParameter = queryByEmployeeBPUUID.CreateSelectionParams();
if ( this.DepartmentName.IsInitial()){
var id = Context.GetCurrentIdentityUUID().content;
queryByIdentityUUIDParameter.Add( queryByIdentityUUID.UUID.content, "I", "EQ", id.ToString() );
var result = queryByIdentityUUID.Execute(queryByIdentityUUIDParameter);
var first = result.GetFirst(); // points to identity instance
var person = first.Person;
var bpUUId = person.UUID.content;
queryByEmployeeBPUUIDParameter.Add( queryByEmployeeBPUUID.UUID.content, "I", "EQ", bpUUId.ToString());
var employeeQueryResult = queryByEmployeeBPUUID.Execute(queryByEmployeeBPUUIDParameter);
var EmployeeQueryResultCurrent = employeeQueryResult.GetFirst();
var assignedOrg = EmployeeQueryResultCurrent.OrganisationalUnitAssignment.GetFirst();
var org = assignedOrg.ToRoot;
// readOnly in AfterLoading event
this.DepartmentName = org.NameAndAddress.AddressSnapshot.NameSuitableForLogonLanguage.GetFirst().Name.SecondLineName;
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
4 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |