Created
September 21, 2011 13:02
-
-
Save tswann/1231970 to your computer and use it in GitHub Desktop.
Assign contact to a new Owner.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| contact.FirstName = "Tom"; | |
| // Assign record to new owner | |
| AssignRequest assign = new AssignRequest | |
| { | |
| Assignee = new EntityReference(SystemUser.EntityLogicalName, newOwnerId), | |
| Target = new EntityReference(Contact.EntityLogicalName, contact.Id) | |
| }; | |
| _context.UpdateObject(contact); | |
| _context.Execute(assign); | |
| _context.SaveChanges(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment