Easily Export Audit Logs

If you have already used Audtining in Dynamics CRM, you may have noticed that you cannot export logs. This is an issue I have been facing recently when I was asked how we can perform stats and measure CRM’s use.

Fortunately, there are two ways to get that logs on an Excel file. The first method that we wont use is to query AuditBase SQL table. The second one, much easier, is to use an amazing tool : MSCRM ToolKit that you can download here http://mscrmtoolkit.codeplex.com/

Here’s how:

Once you’ve downloaded the tool, extract the zip package and launch MSCRMToolKit.exe and go to Connections Manager to enter your CRM connection information

 

sshot1

 

Once connected, you can go to Tools–>Audit Export Manager

sshot2

 

Now you can filter data you want to export, click save and then run Profile

sshot3

 

 

 

.

 

 

 

 

 

Interact with business process flows with Xrm.Page.data.process object

Dynamics CRM 2015 Update 1 offers a new interesting capability. You can now interact diretcly without trying to get the process ID as we used to do in the previous versions. So the magic object is Xrm.Page.data.process

It allows you to get the current process by using ActiveProcess method or the active stage by using ActiveStage method. There are many amazing other methods that can be very useful. I invite you to try them, here is where you can find all of these methods: https://msdn.microsoft.com/library/dn817878.aspx

 

Hope you like it!

 

 

 

.

Hide subgrid add button (+)

For some user experience issues, sometimes you may want to hide the + button on a subgrid. This is how to proceed:

If not already done, download JQuery and add it to your webresources then add the following HTML code as a webresource in the form containing your subgrid.

 

<script src=”/webresources/new_Jquery.js”></script>
<script>
$( document ).ready(function() {
if (parent.document.getElementById(“subgridname_contextualButtonsContainer”) != null ) {

parent.document.getElementById(“subgridname_contextualButtonsContainer”).style.display=’none’;}

});
</script>

Where subgridname must be replaced by your subgrid name.

IMPORTANT: Hiding the + button does not mean users cannot create new records, allowing or forbidding users to create new records should necessary be configured in their security roles.

 

 

 

 

 

.

CRM 2015 SDK: How to recognize user’s form factor and client

When you’re working on multi-device projects in Dynamics CRM, sometimes you need to know the form factor that the user is currently using in order to execute or note some UI actions using Javascript. Dynamics CRM 2015 makes it easier and suggests using the context object with getFormFactor() method that returns an integer between 0 and 3.

Javascript Code: Xrm.Page.context.client.getFormFactor()

Return Value Form Factor
0 Unknown
1 Desktop (Warning that does not mean Computer, it can also be a desktop version used from a tablet navigator)
2 Tablet Application
3 Phone Application

Let’s apply this to a simple example, we will run an alert box containing the name of the form factor on form loading:

Javascript Code: function myTestFunction()

{

var formFactor = Xrm.Page.context.client.getFormFactor();

if(formFactor == ‘1’) { alert(“Desktop”);}
else if (formFactor == ‘2’) { alert (“Tablet App”); }
else if (formFactor ==’3′) { alert (“Phone App”); }
else { alert (“Unknown form factor”); }
}

 

To get which client the script is executing in, you can use:

 

Javascript Code: Xrm.Page.context.client.getClient()

The return value of this method is a String. These are the returned values:

Client Value
Browser Web
Outlook Outlook
Mobile Mobile

 

For more client-side context methods, you can visit https://msdn.microsoft.com/en-us/library/gg334511.aspx

 

 

 

 

.

CRM 2015: Yes you can clear a field with Business Rules

If you have experienced Business Rules in Dynamics CRM 2013 you probably had to build a BR where a field must be cleared. Well that was not possible and we used to either make a two lines script or create another hidden field which is always empty and match the field you want to clear to that one. Fortunately CRM 2015 came with a new update making it possible when choosing a field’s value as you can see in this screenshot.

 

clear br

 

 

 

 

Dynamics CRM 2015 Update 1 – How to create a theme

CRM 2015 latest update has changed several issues regarding User Interface and made navigation easier with less scrollings and less clicks. Navigating in CRM 2015 now follows the same principles as Microsoft Dynamics Marketing. Check out this video to have further information about navigation and other features regarding Update 1.

Let’s have a glance to a new feature of this last update (UPDATE 1): Creating themes!

A theme is a set of customizations of the graphic interface that you can change to make it fit your corporate visual identity.

So let’s create our first theme, navigate to Settings/Themes then click +New

Note that you’ll use hex codes for your theme colors, here is a link that generates a hex code for every color selected http://www.w3schools.com/tags/ref_colorpicker.asp

 

settings customizations themes create new theme

 

 

The three main parameters (I mean those that you will see all the time when navigating) are the logo, navigation bar color and navigation bar shelf color. Here is a screenshot that explains correspondence between colors and items of navigation.

Note that the logo can make max to 400*50 pixels

 

correspondaece

 

You can also try to test other UI elements by picking other colors.

 

ui elements

 

 

Hope you’ll like it!