on 07-01-2013 11:03 AM
Hi there,
i just created a extension for the BO CustomerQuote where I put the following elements:
[Extension] businessobject AP.CRM.Global:CustomerQuote raises DebugInfo {
element EmloyeeId : EmployeeID;
element EmployeeName : LANGUAGEINDEPENDENT_EXTENDED_Text;
element EmployeeForname : LANGUAGEINDEPENDENT_EXTENDED_Text;
element EmployeePhoneNumber : LANGUAGEINDEPENDENT_EXTENDED_Text;
}
Then I created the Script-File "Event - BeforeSave" for the root-context. In this event i want to put the current information of the user which is currently loggedin. This is the coding:
var userUUID = Context.GetCurrentIdentityUUID();
raise DebugInfo.Create("W", userUUID.content.ToString() , "", "");
var query = BusinessPartner.QueryByIdentification;
var selParams = query.CreateSelectionParams();
var queryResult;
selParams.Add(query.UUID.content, "I", "EQ", userUUID.content);
queryResult = query.Execute();
var bp : BusinessPartner;
foreach( bp in queryResult ) {
this.EmloyeeId.content = bp.Identification.GetFirst().BusinessPartnerID;
this.EmployeeName = bp.Common.GetFirst().Person.Name.FamilyName;
this.EmployeeForname = bp.Common.GetFirst().Person.Name.GivenName;
this.EmployeePhoneNumber = "121";
break;
}
Unfortunalety the bp is empty. Is there any other way to determine the current user?
Thanks for responding and best regards,
Daniel Gegenheimer
try this.
var current_emp_uuid = Context.GetCurrentIdentityUUID();
var bupa_uuid = Identity.Retrieve(current_emp_uuid).BusinessPartnerUUID;
var current_employee_name = Employee.Retrieve(bupa_uuid).CurrentCommon.BusinessPartnerFormattedName;
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.