Get specific systemuser GUID
-
2012. május 26. 16:23
We're using the the following code to assign a specific user to a custom entity record.
Guid systemUserGUID = new Guid("11111111-1111-1111-1111-111111111111");
AssignRequest aReq = new AssignRequest()
{
Assignee = new EntityReference(SystemUser.EntityLogicalName, systemUserGUID),
Target = new EntityReference("myEntity", myEntityId),
};However, rather than hardcoding the GUID for this systemuser (which will be different in production) we would like to a retrieve their GUID so it doesn't have to be maintained in code. Is this possible and what is the recommended approach for doing this? Also, the systemuser GUID we are retreiving is not the currently logged in user.
Thank you- Szerkesztette: Cipher 2012. május 26. 16:23
- Megváltozott típus Neil BensonMVP, Moderator 2012. május 26. 23:30 It's a question
Az összes válasz
-
2012. május 28. 7:24
Hi Cipher,
I believe you can retrieve system user GUID by querying systemuser entity (systemuserid is the GUID of the user). Hope it helps.
Regards,
Shaikshavali Mohammed.
-
2012. május 28. 10:56
this blog post has some Javascript code to retrieve the current user and sets it to a field on the form onload.
Ben Hosking
Check out my CRM Blog
Linked-In Profile
Follow Me on Twitter!