Thursday, March 29, 2012

Add a Custom Attribute to an Entity in Microsoft Dynamics CRM 2011 Using VB.NET

This illustration will show you how to add a new custom attribute to an entity in Microsoft Dynamics CRM 2011 using VB.NET.

Ok, here is what the code looks like once your service is instantiated!

In VB.NET

Dim attribute As New StringAttributeMetadata
attribute.SchemaName = "new_stringattribute"
attribute.DisplayName = New Label("sample string  attribute", 1033)
attribute.RequiredLevel = New AttributeRequiredLevelManagedProperty(AttributeRequiredLevel.None)
attribute.Description = New Label("string attribute", 1033)
attribute.MaxLength = 100

Dim req As New CreateAttributeRequest
req.EntityName = "account"
req.Attribute = attribute
Dim resp As CreateAttributeResponse = DirectCast(service.Execute(req), CreateAttributeResponse)


Thats all there is to it!
-

Wednesday, March 28, 2012

Check if an Entity can Participate in Many-To-Many Relationships in Microsoft Dynamics CRM 2011 Using VB.NET

This illustration will show you how to check if an entity can participate in many-to-many (N:N) relationships in Microsoft Dynamics CRM 2011 using VB.NET.

Ok, here is what the code looks like once your service is instantiated!

In VB.NET

Dim req As New CanManyToManyRequest
req.EntityName = "account"
Dim resp As CanManyToManyResponse = DirectCast(service.Execute(req), CanManyToManyResponse)


Thats all there is to it!
-

Tuesday, March 27, 2012

Check if an Entity can be the Referencing (Many) Entity in a One-To-Many Relationship in Microsoft Dynamics CRM 2011 Using VB.NET

This illustration will show you how to check if an entity can be the referencing (many) entity in a one-to-one relationship in Microsoft Dynamics CRM 2011 using VB.NET.

Ok, here is what the code looks like!

In VB.NET

Dim req As New CanBeReferencingRequest
req.EntityName = "account"
Dim resp As CanBeReferencingResponse = DirectCast(service.Execute(req), CanBeReferencingResponse)


Thats all there is to it!
-

Monday, March 26, 2012

Check if an Entity can be the Primary Entity in a One-To-Many Relationship in Microsoft Dynamics CRM 2011 Using VB.NET

This illustration will show you how to check if an entity can be the primary entity in a one-to-one relationship in Microsoft Dynamics CRM 2011 using VB.NET.

Ok, here is what the code looks like!

In VB.NET

Dim req As New CanBeReferencedRequest
req.EntityName = "account"
Dim resp As CanBeReferencedResponse = DirectCast(service.Execute(req), CanBeReferencedResponse)


Thats all there is to it!
-

Friday, March 23, 2012

Update Rollup 7 Available and Read-Optimized (Read-Only) Forms

Update Rollup 7 is now available for Microsoft Dynamics CRM 2011.  It brings some nice fixes to the table, but also brings with it a new feature, read-optimized forms.  Read-optimized forms are read-only and load very fast because they send only the very minimum amount of information across the wire.  This is very good for people who don't need edit access or often times need to be able to pull up information very quickly.  The edit-button will also still be in the ribbon so you can quickly switch to your edit form.  Lastly, you don't have to use them if you don't want to.  and you can even allow your users to turn them on or off for themselves.

Check out the following articles for more information:
http://support.microsoft.com/kb/2600643
http://msdn.microsoft.com/en-us/library/hh913610.aspx


-

Saturday, March 17, 2012

Convergence 2012 or Bust!!

So... I am in the process of getitng ready to head to Houston for Convergence.  I even got up early to go for a nice run about 3 hours ago and I just got back into my house because I accidentally locked myself out.  When the guy finally got to the house it took him about 5 seconds to get in with no more than a blood pressure cuff and a screwdriver.  I had no idea it was so easy to pop a lock.

Anyways, heading to the airport in an hour and  a half..  If anyone wants to hang out while I am down there and grab a beer or invite me to a party please go to my about me page at www.about.me/jamiemiley and click the "email me" button to send me a message.

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!
-