Answered
25 Oct 2016
in reply to
Missing user
Link to this post
Not sure if this is the best way, but this is what I worked out should anyone else find it useful:
private string GetUserCrmContactId()
{
string crmGuid = string.Empty;
try
{
Guid userId = ClaimsManager.GetCurrentUserId();
UserProfileManager profileManager = UserProfileManager.GetManager();
UserProfile userProfile = profileManager.GetUserProfile(userId, typeof(SitefinityProfile).FullName);
crmGuid = userProfile.GetValue("CRMContactId").ToString();
}
catch (Exception ee)
{
// do something with the error
}
return crmGuid;
}