Hi,
You may need Logged in user details for different purposes in hosted controls.
Here is the way to get them from replaced parameters.
// This will give you actual logged in customer
var customer = (Microsoft.Crm.UnifiedServiceDesk.Dynamics.DynamicsCustomerRecord)localSession.Customer.DesktopCustomer;
Dictionary<string, CRMApplicationData> userInfo = null;
if (!customer.CapturedReplacementVariables.TryGetValue(“$User”, out userInfo))
return;
CRMApplicationData fullname = null;
if (!userInfo.TryGetValue(“fullname”, out fullname))
return;
CRMApplicationData userId = null;
if (!userInfo.TryGetValue(“systemuserid”, out userId))
return;
Dictionary<string, CRMApplicationData> systemUserInfo = null;
if (!customer.CapturedReplacementVariables.TryGetValue(“systemuser”, out systemUserInfo))
return;
Happy coding..!
Sreeni Pavalla