Friday, March 30, 2012

Delete A Custom Attribute From an Entity in Microsoft Dynamics CRM 2011 Using VB.NET

This illustration will show you how to delete a custom attribute from an entity in Microsoft Dynamics CRM 2011 using VB.NET to invoke DeleteAttributeRequest.

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 DeleteAttributeRequest
req.EntityLogicalName = "account"
req.LogicalName = attribute.SchemaName
Dim resp As DeleteAttributeResponse = DirectCast(service.Execute(req), DeleteAttributeResponse)


Thats all there is to it!
-

1 comment:

  1. This is a good article & good site.Thank you for sharing this article. It is help us following categorize:
    healthcare, e commerce, programming, multi platform,inventory management, cloud-based solutions, it consulting, retail, manufacturing, CRM, technology means, digital supply chain management, Delivering high-quality service for your business applications,
    Solutions for all Industries,
    Getting your applications talking is the key to better business processes,
    Rapid web services solutions for real business problems,
    Web-based Corporate Document Management System,
    Outsourcing Solution,
    Financial and Operations Business Intelligence Solution,

    Our address:
    2002 Timberloch Place, Suite 200
    The Woodlands, TX 77380
    281-364-1799

    prologic-corp

    ReplyDelete