CRM 2013/2015 – Add a Visual Indicator to distinguish between build environments

Posted by on Jul 28, 2015 in CRM 2013, CRM 2015 |

Visually distinguish between your build environments

2015-07-28_151331

Edit the main.aspx file located in the C:\Program Files\Microsoft Dynamics CRM\CRMWeb\ folder

Add the following java script code block

Add the following CSS code which will allow you to have some additional text before the word SANDBOX.

 

Read More

CRM 2015 save method with callbacks to navigate away from an error

Posted by on Jul 16, 2015 in CRM 2013, CRM 2015 |

Recently i stumbled upon an edge case scenario where the logged in user that has access to the record was making a specific change to the record which in turn fired the elevated plugin which removed his access and threw this strange error:

Server Is Busy

The record was saved. However, the data could not be displayed because the server is busy…

server-busy

During my investigation, i had to come up with a way to remove this annoying error and take them back to the grid screen. Thankfully the Xrm.Page.data has a method save with the option to set callback functions to be executed after the save operation is completed.

Hooking onto these methods, i threw an alert and used the history.go method to return to the grid.

Notice the set_forceNavigationAway method, this is used to disable the the onbeforeunload message that CRM prompts saying you have unsaved changes to the form.

 

Read More

Manipulate the data returned by the CRM 2013 grid.

Posted by on Jan 15, 2015 in CRM 2013 |

Using a CRM plugin you can manipulate the data returned by CRM before the data is returned to the user in the grid/sub-grid.

Some examples would be:

  • Deny the user access to specific data in a specific field based on a security role
  • Get data from a lookup record on a related entity and display it dynamically on the grid.

Create your new plugin class and register it on the RetrieveMultiple message, select your entity and keep the stage of execution as Post operation

Get your entity collection:

 You can run your own queries and add your own logic, then to set the column value for the grid use:

You will need to have a ‘dummy’ field on your entity to be used to display the data however this field will always be empty.

The field will also need to exist in the view or in the columnset retrieval.

This does not update the value in the database rather just a dynamic way of displaying data from another entity.

Read More

Add a double click event handler to a Subgrid in CRM 2013

Posted by on Jan 13, 2015 in CRM 2013 |

Had an interesting problem we had a middle entity that linked two other entities together however we didn’t really want people to get to that entity when double clicking on the row in the grid.

Use the following function and you can override the double click event.

 

Read More

Filtering a Grid in a CRM 2013 Dashboard based off another Grid’s selected row

Posted by on Jan 8, 2015 in CRM 2013 |

G’day Folks,

Had a requirement for a few grids on a new dashboard to be pre-filtered based off the selected row the main grid. My solution was to create a WebResource HTML page which looked at it’s parent window and set the click events on the Grid i wanted and within that click event i’d set the new FetchXml criteria to filter the second grid.

Example:

Entities

Client Entity – N:1 Outlet

Create a HTML webresource with the following:

Note:

Replace “OutletsGrid” with Grid 1 Component Name

Replace “ClientGrid” with the Grid 2 Component Name

I have a base fetchxml  (which you need to fill in) if you want to show all data before you click on any row in Grid 1

Add the Webresource to the Dashboard and Publish

Grid

 

My Outlet Clients Grid (Grid 2) should now filter based on the Selected Outlet (Grid 1)

 

 

Read More

Launching a Modal Dialog from a CRM 2013 Record Window

Posted by on Oct 14, 2014 in CRM 2013 |

In particular situation you may want to launch a modal url fortunately CRM 2013 has an internal function to launch the modal dialogs.

The helper function:

Result:

modalPopUp

Read More
%d bloggers like this: