dynamics crm 2011

I want to update ownerid in one of the lead in dynamics crm 2011
all google tells me about the codes below. but i do not know how to declare "SystemUser.EntityLogicalName".
I already ahve SDK reference in the website. please help if you know what to do.



// Create the Request Object and Set the Request Object's Properties  
AssignRequest assignowner = new AssignRequest {  
    Assignee = new EntityReference(SystemUser.EntityLogicalName, _otherUserId),  
        Target = new EntityReference(Account.EntityLogicalName, _accountId)  
};  
// Execute the Request  
orgService.execute(assignowner);   

Open in new window

LVL 1
ITsolutionWizardAsked:
Who is Participating?
 
Rikin ShahMicrosoft Dynamics CRM ConsultantCommented:
Hi,

You can simply try "systemuser" string, the logical name of the entity.

// Create the Request Object and Set the Request Object's Properties  
AssignRequest assignowner = new AssignRequest {  
    Assignee = new EntityReference("systemuser", _otherUserId),  
        Target = new EntityReference("account", _accountId)  
};  
// Execute the Request  
orgService.execute(assignowner);  

Open in new window


Regards,
Rikin
0
 
Rikin ShahMicrosoft Dynamics CRM ConsultantCommented:
Correct Solution!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.