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.
Az összes válasz
2012. május 28. 7:24
I believe you can retrieve system user GUID by querying systemuser entity (systemuserid is the GUID of the user). Hope it helps.
2012. május 28. 10:56