Cleared MB2-703: Microsoft Dynamics CRM 2013 Customization and Configuration Exam.


Finally took and cleared my first CRM 2013 exam i.e. Customization and Configuration today.

It had total 48 questions in it with passing score of 700.

As expected the main focus area were

  • Access Teams
  • Business Process Flows
  • Business Rules
  • Quick Create forms.
  • New Controls

So anyone planning to take this exam should focus around these new features added in CRM 2013.

Bye.

CRM 2011 StringMap Table


John Winford's avatarTechnical Reflections

Fields in a CRM entity record are often based on a pick list. Should you need to query the SQL database directly to extract information these will come out not as the text based descriptive values, but a code such as 0, 1, or 2. To retrieve the associated descriptive information, a join to the StringMapBase table is required. A rough SQL query might be something like so:



This works fine for most items, but some such as statecode are used in multiple entities. A join to the MetaDataSchema.Entity table to get the ObjectTypeCode will filter down the records. If you do not the following will result:



Say you wanted to retrieve the values for statecode for the Opportunity entity, you would write query such as this:



The reason for the date filter is that CRM maintains a history of changes to the entities. If a customisation solution has been…

View original post 47 more words

How to – Get OptionSet Label using FormattedValues property of Entity in Plugin in CRM


The easiest way to get the Label for the option set in plugin is using the FormattedValues property of the Entity.

The Post Create plugin on Contact record getting the label for the address type field.


if (context.InputParameters.Contains(“Target”) && 
context.InputParameters[“Target”] is Entity){

// Obtain the target entity from the input parmameters. 

Entity entity = (Entity) context.InputParameters[“Target”];

if(entity.Contains(“address1_addresstypecode”)){

string addressTypeCodeLabel = entity.FormattedValues[“address1_addresstypecode”];

entity.Attributes[“address1_city”] = addressTypeCodeLabel;

service.Update(entity);}

}

http://community.dynamics.com/crm/b/crmmitchmilam/archive/2013/04/18/crm-sdk-nugget-entity-formattedvalues-property.aspx

Hope it helps.

Advertisements

CRM Online to SharePoint Online Integration using REST and ADFS


Rhett Clinton MVP's avatarDynamics Bing'd

Accessing SharePoint Online 2013 REST services with SSO via ADFS (Active Directory Federation Services) from CRM Online provides loads of potential opportunities, especially now that SharePoint offers a huge REST API. You can call REST from a CRM Online Plugin or Custom Workflow activity with no dependencies on SharePoint Client dll’s or Azure getting in the way, It is fairly awesome I must say.

I use the HttpWebRequest class to perform SOAP requests to perform the authentication part of this integration, which is totally supported within Sandboxed Plugins and Custom Workflow Activities. You can read more about the restrictions of the CRM Sandboxed environment here http://msdn.microsoft.com/en-us/library/gg334752.aspx. Once you get authenticated and obtain the cookies you are free to fire REST calls off by simply providing the cookies along with the request.

The best diagram I found to describe the authentication process visually was from Wictor Wilen’s blog http://www.wictorwilen.se/

Auth Process

I wanted to explore the issue…

View original post 376 more words

Validating Input Parameters in SSRS


We recently developed a report which had Days Input Parameter in it. Now the requirement was if the user enters any thing other then number (integer) over there they should get the appropriate error message.

Here if we define the Days parameter of type Integer and if we enter say for e.g. value = ‘x’ over there

We will get the following error message.

And if we upload the same report in the CRM, we will get the following error message, which doesn’t seem that user friendly.

Now to display proper error message to the end user we can take the following approach.

Change the parameter type to Text first. (From integer type)

Add a text box to report to show the error message, have following expression. If the value entered for Days parameter is not of numeric type display error message.

To hide the table if the Days field is not numeric, set the Hidden property with the following expression. If the Days parameter value is not numeric then hide the table.

And the following change in the DataSet’s query

Original Query

SELECT
Name, lss_First_Name, lss_Last_Name

FROM
Account

WHERE (DATEDIFF(day,CreatedOn,GETDATE())@Days)

New Query

If Days is not a numeric field then then modified select query to retrieve blank data from the table (using createdon field null criteria here in our case)

DECLARE
@SQL
Nvarchar(1000)

IF  ISNUMERIC(@Days)= 1 BEGIN

SET
@SQL ‘SELECT Name, lss_First_Name, lss_Last_Name FROM Account WHERE (DATEDIFF(day, CreatedOn, GETDATE())) >’+Convert(nvarchar,@Days)+

End

Else

Begin

SET @SQL=‘SELECT Name, lss_First_Name, lss_Last_Name FROM Account WHERE createdon=Null’

End

exec(@SQL)

The report with proper Days value for e.g. 1

If entered incorrect Days value for e.g. abc

Helpful post

http://geekswithblogs.net/Compudicted/archive/2012/08/14/validate-ssrs-report-input-parameters-the-proper-way.aspx

Hope it helps.

Unit Test RetrieveAttributeResponse in CRM using Microsoft Fakes.


Hi,

Recently we wrote a plugin that was using RetrieveAttribute class to get the label as well as value of the optionset field.

The issue that we faced over here is that the AttributeMetadata property of RetrieveAttributeResponse is read only, we cannot set it. The following post provided the solution i.e. writing a wrapper class over the RetrieveAttributeResponse

http://www.alexanderdevelopment.net/post/2013/01/13/How-to-unit-test-C-Dynamics-CRM-interface-code-part-III


organizationService.ExecuteOrganizationRequest = request =>
 {
 var retrievedPicklistAttributeMetadata = new PicklistAttributeMetadata();

if (request.Parameters["LogicalName"].ToString() == "lss_service_request_status")
 {
 var optionMetadata = new OptionMetadata(new Label("Closed", 1033), 10);
 optionMetadata.Label.UserLocalizedLabel = new LocalizedLabel("Closed", 1033);
 optionMetadata.Label.UserLocalizedLabel.Label = "Closed";

var serviceRequestTypeOptionSet = new OptionSetMetadata
 {
 Name = "lss_service_request_status",
 DisplayName = new Label("Service Request Status", 1033),
 IsGlobal = false,
 OptionSetType = OptionSetType.Picklist,
 Options = { optionMetadata }
 };

retrievedPicklistAttributeMetadata.OptionSet = serviceRequestTypeOptionSet;
 }

var retrAttResponse = new RetrieveAttributeResponseWrapper(new RetrieveAttributeResponse());
 retrAttResponse.AttributeMetadata = retrievedPicklistAttributeMetadata;
 return retrAttResponse;
 };

Hope it helps!