June 22, 2014

MB2-720 Functional Application in Microsoft Dynamics Marketing

A new Microsoft Dynamics CRM exam is available:

MB2-720 - Functional Application in Microsoft Dynamics Marketing

The exam is not listed yet under Dynamics certifications on Microsoft Learning but can be scheduled on Prometric:

Update:
The details page is available on Microsoft Learning:
https://www.microsoft.com/learning/en-us/exam.aspx?id=mb2-720

June 21, 2014

The "Tiedot" Bug

"Tiedot" is a Finnish word that means "Information", it is used inside Dynamics CRM as the default name for the two standard forms (Main and Mobile) when a new entity is created.

This is pretty obvious if the base language for the organization is Finnish, but some days ago I discovered a bug regarding the default form names, the base language for the organization was English, the Finnish language pack was NOT installed, but form name and description were in Finnish.




After a while I found that this bug is caused by the Current Format selected under System Settings, if for example you choose a different language (without installing the language pack)


You will end up with a localized form name and description: (信息 for Simplified Chinese)



My suggestion is to keep inside the development environment the same Current Format as the base language, especially when the customer will use multiple languages.



I created also a Connect feedback: https://connect.microsoft.com/dynamicssuggestions/feedback/details/902012/bug-form-name-and-description-depending-on-current-format-and-not-on-base-language

June 20, 2014

LCID JavaScript Helper Library

Xrm.Page object provides two methods to get the relevant language used inside Dynamics CRM:
  • Xrm.Page.context.getUserLcid() - returns the LCID value that represents the Microsoft Dynamics CRM Language Pack that is the user selected as their preferred language
  • Xrm.Page.context.getOrgLcid() - returns the LCID value that represents the base language for the organization
The value returned is the lcid decimal value, there is not a built-in function to return the culture name ("en-US" for LCID 1033) or the language region ("German (Germany)" for LCID 1031).

The attached library provides an easy way to get the culture name and the language region from the decimal lcid value, it contains two methods:

  • LCIDUtils.getCultureName(lcid)
    returns a string with the culture name of the selected lcid value
    var userLcid = Xrm.Page.context.getUserLcid(); 
    var userCultureName = LCIDUtils.getCultureName(userLcid); 
    alert("User Culture name is: " + userCultureName);
    
  • LCIDUtils.getLanguageRegion(lcid)
    returns a string with the language region of the selected lcid value
    var orgLcid = Xrm.Page.context.getOrgLcid(); 
    var orgLanguageRegion = LCIDUtils.getLanguageRegion(orgLcid); 
    alert("Organization Language Region is: " + orgLanguageRegion);
    
The library can be downloaded from Technet Gallery:
http://gallery.technet.microsoft.com/scriptcenter/LCID-JavaScript-Helper-7cfb0829

Note: The culture name and language region mappings come from this MSDN page: National Language Support (NLS) API Reference (Windows 7)

June 16, 2014

CRM Reports and Barcodes

Yesterday I saw a question on MSDN Dynamics forum: How to rotate an image in SSRS
The asker needed to generate barcodes inside a CRM Online report and shared this link:
Free Reporting Services Barcodes
The idea is to create a bitmap representing the barcode using the font text, in order to keep the aspect consistent between the preview and the exported report.
However he wanted to know how to rotate the bitmap and although I'm not a big fan of SSRS, the question was interesting so I checked the code.
I have some experience with Image Processing (years ago I created this ugly and nowadays outdated software) so I recognized the System.Drawing namespace and its methods.
So I thought: well, if we can use FillRectangle, DrawString and similar, probably RotateFlip will work too. I suggested the following code and it worked:
newBitmap.RotateFlip(System.Drawing.RotateFlipType.Rotate270FlipNone)
Moral of the story: even if the reports for CRM Online have limitations, sometimes we can count on the .NET framework to solve our requirements.

June 8, 2014

Retrieve the members of a specific Team

The code to retrieve the members of a specific Team is quite easy, it's a standard QueryExpression, but contains a linked entity with a condition inside, it's good as start point for similar queries.
// Id of the specific Team
Guid teamId = new Guid("DAC1F09E-02EF-E311-A2AB-D89D67630DBC");
// main query returing users
QueryExpression userQuery = new QueryExpression("systemuser");
// take all columns
userQuery.ColumnSet = new ColumnSet(true);
// this is the intersect condition
LinkEntity teamLink = new LinkEntity("systemuser", "teammembership", "systemuserid", "systemuserid", JoinOperator.Inner);
// this is the condition to use the specific Team
ConditionExpression teamCondition = new ConditionExpression("teamid", ConditionOperator.Equal, teamId);
// add the condition to the intersect
teamLink.LinkCriteria.AddCondition(teamCondition);
// add the intersect to the query
userQuery.LinkEntities.Add(teamLink); 
//get the results
EntityCollection retrievedUsers = service.RetrieveMultiple(userQuery);
// fetch the results
foreach (Entity user in retrievedUsers.Entities)
{
    // Id of the user
    var userId = user.Id;
    // FullName of the user 
    var userFullName = user.Contains("fullname") ? user["fullname"].ToString() : "";
}

June 3, 2014

Dynamics CRM Tools and Utilities from Codeplex

I just discovered Curah!, a free service provided by Microsoft to share links with the possibility to add a comment or a description.
For my first Curah I decided to share a list of tools and utilities for Dynamics CRM available on Codeplex, you can find it here:

http://curah.microsoft.com/70730/dynamics-crm-tools-and-utilities-from-codeplex