Get specific systemuser GUID

Kérdés 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


Az összes válasz