The ‘label’ attribute is not declared error while importing solution in CRM 2011


Hi,

We got this “The ‘label’ attribute is not declared” while importing one of our solutions in CRM 2011. It gave the following details for the error

ame” /><attribute name=”parentcustomerid” /><attribute name=”telephone1″ /><attribute name=”emailaddress1″ /><attribute name=”statecode” /><order attribute=”fullname” descending=”false” /><link-entity name=”postfollow” from=”regardingobjectid” to=”contactid” alias=”aa”><filter type=”and”><condition attribute=”ownerid” operator=”eq-userid” /></filter></link-entity><attribute name=”contactid” /></entity></fetch></fetchxml><LocalizedNames><LocalizedName description=”Contacts I Follow” languagecode=”1033″ /></LocalizedNames><Descriptions><Description description=”Contacts that you follow.” languagecode=”1033″ /></Descriptions></savedquery></savedqueries></SavedQueries><Visualizations><visualization><savedqueryvisualizationid>{889CE563-1263-E211-8BE5-984BE17C6693}</savedqueryvisualizationid><datadescription><datadefinition><fetchcollection><fetch mapping=”logical” aggregate=”true”><entity name=”contact”><attribute groupby=”true” alias=”_CRMAutoGen_groupby_column_Num_0″ name=”address1_city” label=”City” /><attribute alias=”_CRMAutoGen_aggregate_column_Num_0″ name=”fullname” aggregate=”countcolumn” /></entity></fetch></fetchcollection><categorycollection><category alias=”_CRMAutoGen_groupby_column_Num_0″><measurecollection><measure alias=”_CRMAutoGen_aggregate_column_Num_0″ /></measurecollection></category></categorycollection></datadefinition></datadescription><presentationdescription><Chart Palette=”None” PaletteCustomColors=”149,189,66; 197,56,52; 55,118,193; 117,82,160; 49,171,204; 255,136,35; 168,203,104; 209,98,96; 97,142,206; 142,116,178; 93,186,215; 255,155,83″><Series><Series ChartType=”Bar” IsValueShownAsLabel=”True” Color=”purple” BackGradientStyle=”TopBottom” BackSecondaryColor=”112, 142, 50″ Font=”{0}, 9.5px” LabelForeColor=”59, 59, 59″ CustomProperties=”PointWidth=0.75, MaxPixelPointWidth=40, DrawingStyle=Wedge”></Series></Series><ChartAreas><ChartArea BorderColor=”White” BorderDashStyle=”Solid”><AxisY LabelAutoFitMinFontSize=”8″ TitleForeColor=”59, 59, 59″ T

We saw one attribute tag with label attribute in it. Removing the label attribute and importing the solution back resolved the issue.

Hope it helps

Reviewed Book: Microsoft Dynamics CRM 2011 Application Design


Hi,

Last year I got an opportunity to review the “Microsoft Dynamics CRM 2011 Application Design” book http://bit.ly/135Wi8J
written by Mahendar Pal (Packt Publishing). Mahendar is Most Valuable Professional (MVP) for Microsoft Dynamics CRM. He is a good friend of mine and we stay in touch with each other and mostly discuss things around CRM. The review process was roughly around 6 months.

Now about the book, I found it to be quite unique in regards that it talks about the design and implementation aspect of Microsoft Dynamics CRM 2011. There are other good books available in the market on Microsoft Dynamics CRM, but they mostly talk about and explains the features available within the product. This makes the book helpful to both readers who are new to CRM as well as experienced.

There are total 8 chapters in the book in which readers will learn the basics of CRM 2011 and will also learn how to implement and create applications like Project Training Enrolment System, Employee Recruitment Management System, Hotel Management System etc. using CRM 2011. The readers will also get to learn how to create Silverlight applications, ASP.NET pages which integrates with CRM 2011.

Reading books is my hobby so was happy to get early access to the chapters for reading and reviewing and thanks to Mahendar and Packt Publishing for giving me this opportunity.

Lastly and most importantly I would also like to thank my friend and colleague Hina Mehta who helped me during the review process. She is an expert in CRM and CCA (which is an integral part of CRM now and there are very few people who have expertise on it). So her opinion and suggestions mattered a lot. You can subscribe to her blog here http://hinamehta14.wordpress.com/

All said and done,

Order a copy for yourself

http://www.packtpub.com/microsoft-dynamics-crm-2011-application-design/book

Bye.

“The Business Data Connectivity Metadata Store is currently unavailable” error in SharePoint Designer 2013 Preview


Hi,

I recently wrote a WCF service as a wrapper over CRM 2011 online and hosted it in Azure. The intent was to use this WCF service as BCS connection to integrate CRM 2011 online with SharePonit 2013 online. I tested the service with WCF Test Client and it was working fine.

The next step was to create an External Content Type in SharePoint Designer 2013. On selecting the External Content Types link inside SharePoint designer I kept getting the below error.

Next I used SharePoint Designer 2010 to connect to the SharePoint 2013 online site. There it didn’t throw the Metadata Store is currently available error.

However I kept getting the following error while trying to create a new external content type.

The workaround was to connect to SharePoint 2010 online site through SharePoint Designer 2010 and then generating the BCS Model from therein using our Azure Hosted WCF Service.

Hope it helps.

 

Using RetrieveMetadataChangesRequest class (Metadata Querying) in Polaris (CRM 2011)


Hi,

Let us take a very simple example to understand RetrieveMetadataChangesRequest class introduced in Polaris.

In this example we will retrieve information about all the attributes for contact entity where attribute type is of lookup.

For this we will use the RetrieveMetadataChangesRequest class.

This class contains the data which specifies the metadata information that needs to be retrieved.

RetrieveMetadataChangesRequest class has a Query property that accepts an EntityQueryExpression.

RetrieveMetadataChangesRequest retrieveMetadataChangesRequest = new
RetrieveMetadataChangesRequest()
{
Query = entityQueryExpression
};

EntityQueryExpression class defines the query to retrieve the metadata information.

Here we will need to set the following three properties of the EntityQueryExpression class


EntityQueryExpression entityQueryExpression = new
EntityQueryExpression()
{
Criteria = EntityFilter,
Properties = EntityProperties,
AttributeQuery = new
AttributeQueryExpression()
{
Criteria = AttributeFilter,
Properties = AttributeProperties
}
};
  • Criteria – specifies the filter criteria like for which entities we want metadata information to be retrieved.
  • Properties –
    specifies the properties to be returned.
  • AttributeQuery – specifies the criteria and properties for the entities attribute metadata like which type of attribute to retrieve and what all information to be retrieved for that attribute.

Specfying EntityFilter

This is how we will specify that we need metadata information for only the contact entity.

Specifying Properties of the Entity to be retrieved

Here we are specifying all the properties to be returned

MetadataPropertiesExpression EntityProperties = new
MetadataPropertiesExpression() { AllProperties = true };


Here we can set the AllProperties as false and instead specify the property names that we want to retrieve as shown below

EntityProperties.PropertyNames.Add(“AttributeType”);

Specifying the lookup attribute to be retrieved

MetadataConditionExpression metadataconditionexpressionEntity = new
MetadataConditionExpression();
metadataconditionexpressionEntity.PropertyName = "SchemaName";
metadataconditionexpressionEntity.Value = "Contact";
metadataconditionexpressionEntity.ConditionOperator = MetadataConditionOperator.Equals;
MetadataFilterExpression EntityFilter = new MetadataFilterExpression(LogicalOperator.And);
EntityFilter.Conditions.Add(metadataconditionexpressionEntity);

Specifying the properties to be retrieved for the lookup attribute

Here we are specifying that we only need the AttributeType and Description information for the Lookup attributes retrieved.

MetadataPropertiesExpression AttributeProperties = new
MetadataPropertiesExpression() { AllProperties = false };
AttributeProperties.PropertyNames.Add("AttributeType");
AttributeProperties.PropertyNames.Add("Description");

Full sample code

// specifying EntityFilter to only include entity having SchemaName as contact

MetadataConditionExpression metadataconditionexpressionEntity = new
MetadataConditionExpression();
metadataconditionexpressionEntity.PropertyName = "SchemaName";
metadataconditionexpressionEntity.Value = "Contact";
metadataconditionexpressionEntity.ConditionOperator = MetadataConditionOperator.Equals;
MetadataFilterExpression EntityFilter = new MetadataFilterExpression(LogicalOperator.And);
EntityFilter.Conditions.Add(metadataconditionexpressionEntity);

// specfying EntityProperties to include the properties to be retrieved
MetadataPropertiesExpression EntityProperties = new
MetadataPropertiesExpression() { AllProperties = true };
MetadataConditionExpression metadataExpression = new
MetadataConditionExpression("AttributeType", MetadataConditionOperator.Equals, AttributeTypeCode.Lookup);
MetadataFilterExpression AttributeFilter = new
MetadataFilterExpression(LogicalOperator.And);
AttributeFilter.Conditions.Add(metadataExpression);

//A Properties expression to limit the properties to be included with attributes
MetadataPropertiesExpression AttributeProperties = new
MetadataPropertiesExpression() { AllProperties = false };
AttributeProperties.PropertyNames.Add("AttributeType");
AttributeProperties.PropertyNames.Add("Description");

//An entity query expression to combine the filter expressions and property expressions for the query.
EntityQueryExpression entityQueryExpression = new
EntityQueryExpression()
{
Criteria = EntityFilter,
Properties = EntityProperties,
AttributeQuery = new
AttributeQueryExpression()
{
Criteria = AttributeFilter,
Properties = AttributeProperties
}
};

RetrieveMetadataChangesRequest retrieveMetadataChangesRequest = new
RetrieveMetadataChangesRequest()
{
Query = entityQueryExpression
};
RetrieveMetadataChangesResponse retrieveMetadataChangesResponse = (RetrieveMetadataChangesResponse)_service.Execute(retrieveMetadataChangesRequest);
EntityMetadata entityMetadata = retrieveMetadataChangesResponse.EntityMetadata[0];
foreach (AttributeMetadata attMetadata in entityMetadata.Attributes)
{
MessageBox.Show(attMetadata.Description.UserLocalizedLabel.Label);
}

Hope it helps.

Sample code to connect Office 365 users to CRM 2011 online


Sharing a sample code that can be used to connect to CRM 2011 online with Office 365.

// Add refereneces to the following dll
 // microsoft.crm.sdk.proxy
 // microsoft.xrm.sdk
 // system.runtime.serialization
 // system.servicemodel

IServiceManagement&lt;IOrganizationService&gt; orgServiceManagement =
 ServiceConfigurationFactory.CreateManagement&lt;IOrganizationService&gt;(new Uri("https://democrm.api.crm5.dynamics.com/XRMServices/2011/Organization.svc"));

AuthenticationCredentials authCredentials = new AuthenticationCredentials();
authCredentials.ClientCredentials.UserName.UserName = _userName;
authCredentials.ClientCredentials.UserName.Password = _password;
AuthenticationCredentials tokenCredentials = orgServiceManagement.Authenticate(authCredentials);

OrganizationServiceProxy organizationProxy = new OrganizationServiceProxy(orgServiceManagement, tokenCredentials.SecurityTokenResponse);
Guid userid = ((WhoAmIResponse)organizationProxy.Execute(new WhoAmIRequest())).UserId;

Sample Code – Dynamics 365 Web API / Organization Service

Bye.

Advertisements

FaultException was unhandled ‘organizationName’ while using DiscoveryService in CRM 2011


Hi,

I was getting the below error while using DiscoveryService

The reason was I was unknowingly using RetrieveOrganizationRequest class instead of RetrieveOrganization(s)Request class.

http://social.microsoft.com/Forums/is/crmdevelopment/thread/d5d00302-8f7b-4efc-873b-c54b3e29749d

Hope it helps.