Thursday, March 15, 2012

Update an Entity Instance in Microsoft Dynamics CRM 2011 Using VB.NET

This illustration shows how to use UpdateRequest to update an entity instance in Microsoft Dynamics CRM 2011 with VB.NET

Ok, here is what the code looks like!

In VB.NET

'get entity to update
Dim entityAccount As Entity = service.Retrieve("account", New Guid("063DE6F9-2E6B-E111-B3CA-1CC1DEF1B5FF"), New ColumnSet(True))

'update attributes
entityAccount.Attributes("name") = "test update from vb.net"

'Send update request
Dim req As New UpdateRequest()
req.Target = entityAccount
Dim resp As UpdateResponse = DirectCast(service.Execute(req), UpdateResponse)


Thats all there is to it!
-

No comments:

Post a Comment