The form message solution can be found on CodePlex, it allows you to place custom messages onto a CRM form where you can define text and the image icon such as Success, Error, Information, Warning and Alert.

You can also choose to display the 2 buttons that can be customised with your desired label for example OK, Cancel, or Submit, Cancel, etc… and attach JavaScript functions as call back events for each one.

Form Message with Buttons displayed

Available Message Icons

Adding Form Message web resource to CRM Form

You can add initial/static text and an icon by supplying Custom Parameters such as text and type like this.

You can also find the Microsoft Dynamics CRM 2013 Custom Code Validation Tool here http://www.microsoft.com/en-us/download/details.aspx?id=30151. This will help you prepare for your upgrade to Microsoft Dynamics CRM 2013. It is possible that some code will stop working or cause an error when you upgrade from CRM 2011 to 2013 so it is worth putting the time in to investigate. The Microsoft Dynamics CRM Custom Code Validation Tool helps identify potential problems so that any potential issues can be resolved before upgrading. the tool will help identify potential issues with custom JavaScript in JavaScript libraries and HTML web resources. It will detect issues in web resources that will no longer work after you upgrade from CRM 2011 to 2013. Areas that the tool will cover include CRM v4 client SDK calls, CRM 2007 end points and Common DOM manipulations.

You can download the Microsoft Dynamics CRM 2013 Software Development Kit (SDK) here http://www.microsoft.com/en-us/download/details.aspx?id=40321 to get up to speed regards the fantastic capabilities coming with CRM 2013. The Microsoft Dynamics CRM 2013 Software Development Kit (SDK) is for developers, system customisers, and report writers.

A great site to keep up to date with all the goodness is the Dynamics CRM Develop Center on msdn. http://msdn.microsoft.com/en-us/dynamics/crm/jj937218 where you can get all of the information you need to develop, design, and distribute solutions for Microsoft Dynamics CRM.

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.

I wanted to explore the issue of authentication between CRM Online and SharePoint Online from a server to server perspective and as you can imagine authentication is a big hurdle for this direct type of communication as every example I have seen so far includes Azure. Well at least until I started to look at what others were doing with Windows 8 Apps and Active Authentication. Omar Venado http://blogs.msdn.com/b/omarv/ and fellow MVP Wictor Wilen http://www.wictorwilen.se/ had some really great articles to help me build out a solution focused on this scenario. The code attached to this blog is heavily derived from Omar’s Windows 8 App code though now is useable in non Windows 8 App projects such as C# Console, SSIS Packages and of course CRM Plugin/Workflow projects. I have added some background reading at the bottom of this post so you can see the articles I used to get my code to work.

// Send a json odata request to SPO rest services to fetch all list items for the list.

byte[] result = HTTPHelper.SendODataJsonRequest(

url,

“GET”, // reading data from SP through the rest api usually uses the GET verb

null,

(HttpWebRequest)HttpWebRequest.Create(url),

SpoAuthUtility.Current // pass in the helper object that allows us to make authenticated calls to SPO rest services

);

string response = Encoding.UTF8.GetString(result, 0, result.Length);

You can authenticate using corporate credentials if inside your network, username/password if outside your network (e.g CRM Online O365) and you can also use your onmicrosoft.com accounts. Remember that my primary focus was on server to server integration possibilities, not user to server contexts such as in the current SharePoint CRM List Component model.

The attached C# Console app contains 3 files to provide you with an example of how to use the 2 cs classes HTTPHelper and SPOAuthUtility. To authenticate and start calling REST from CRM Plugins/Workflows simple include the HTTPHelper and SPOAuthUtility cs files into your Plugin/Workflow project.

What’s Changing in the Next Major Release – This new topic outlines features that will be changing in the upcoming Orion release and provides a tool you can use to help you prepare your organizations for these changes.

Updated these topics to remove the restriction on using the service proxy classes when authenticating with the Microsoft online services identity provider of Microsoft Dynamics CRM Online. You can now use these proxy classes with all deployment types and identity providers.

Sometimes you have issues that you want to troubleshoot and other times you may choose to investigate/analyse/review your CRM 2011 environment. Often performing health checks is necessary and I suggest necessary if you haven’t already thought of this. One of the tools I promote for searching and crunching logs is Log Parser. This awesome tool is a powerful, versatile tool that provides universal query access to text-based data such as log files, XML files and CSV files, as well as key data sources on the Windows® operating system such as the Event Log, the Registry, the file system, and Active Directory®. If that doesn’t sound awesome enough for you how about if you could write a sql type query against the server’s Application Event Log to find where lock is found in the message attribute like so.

SELECT * FROM \\server1\APPLICATION where message like ‘%lock%’

or lets look at the Application and System Event Log entries for server1

SELECT * FROM \\server1\APPLICATION, \\server1\SYSTEM where message like ‘%lock%’

but wait there, what if I have 2 front end CRM servers, server1 and server2.

This is just touching the surface of what this tool can do to dig through information held in your environment, this is also all from my own desktop machine, there is no need to log on to various servers to gather this information. So command line is so yesterday I hear you say, well there is also Log Parser Studio which presents a library of ready to go queries for various sources. You need to install Log Parser first and then you’re ready to go.

You can also take a look at Log Parser Lizard by Dimce Kuzmanov, a free GUI tool for managing queries and exporting results to Excel and charts. In addition, you will find input filters for RegEx and log4net input log formats (with support for regular expressions) and SQL server T-SQL queries.

This example I’m sharing today is demonstrating a few techniques which promote JavaScript and REST, along with using namespaces and creating a library of functions/properties. This example declares a library Security.UserInRole and defines a number of properties and functions. The general idea is to allow the data access via REST to be asynchronous which then offers a valid and invalid function callback option to be defined to handle the outcome. You can specify an array of security roles to check against the current user and then with the callback functions you can perform the actions that you require.

Ideally I want to call a function that is easy to use and it will look like this.Security.UserInRole.checkUserInRole(
["System Administrator", "System Customizer", "Custom Role Name"],
function(){alert("valid"); // The user is in one of the specifed roles.
},
function(){alert("invalid"); // The user is not in one of the specifed roles.
}
}

The entire library is implemented so that you call a function, it performs the processing asynchronously and then gives you the outcome to handle the response. Whether you want to show/hide form elements or disable fields etc, you can handle this in the callback function parameters validFunc and invalidFunc defined in the checkUserInRole function. The entire library content can be placed in a CRM webresource and added to a form. The full library is as shown below.

To use the library in the onload event of an entity form simply add the Security.UserInRole library webresource to the form and create a another JavaScript web resource to hold the onload function. The onload function may look like this. You define the roles to check as an array and pass this to the checkUserInRole function along with the valid and invalid callback functions. You don’t have to define the functions as anonymous functions like my example below but it can sometimes feel cleaner.

function onload()
{
Security.UserInRole.checkUserInRole(
["System Administrator", "System Customizer", "Custom Role Name"],
function(){alert("valid"); // The user is in one of the specifed roles.
},
function(){alert("invalid"); // The user is not in one of the specifed roles.
}
);
}

I would like to mention Jim Daly from the MS CRM Team for his examples of namespace and library structure along with his REST query code as this example I have created is derived from his outstanding work.

Rollup 12 (CRM December 2012 Service Update), is full of nice new features but a huge bonus was the new capabilities to interact with CRM metadata in a much more efficient manner along with benefiting from improved performance. Only retrieving the metadata that you only require and need is a much more pleasing idea especially when it comes to mobile clients. The MSDN SDK article can be found here that covers this subject in more detail. http://msdn.microsoft.com/en-us/library/jj863599.aspx

As you can imagine if you only want to check if an entity has Is Visible in Mobile flag set then you don’t want anything else. In this case the new EntityQueryExpression class provides a similar experience to the existing QueryExpression for querying CRM data though specifically for querying metadata.

Defines a complex query to retrieve entity relationship metadata for entities retrieved using an EntityQueryExpression

So to slightly different but if you want to retrieve all entities that have the Is Visible in Mobile set to true using the new classes then specify a filter as follows and execute the RetrieveMetadataChangesRequest message with ClientVersionStamp set to null in the request.

The ClientVersionStamp timestamp value representing when the last request was made can be set to only retrieve data that has changed since the time specified. The RetrieveMetadataChangesResponse returns a timestamp value that can be used with another request at a later time to return information about how metadata has changed since the last request.