Dynamically updating the X-UA-Compatible tag in a WebPart for SharePoint 2010

Posted by on Aug 25, 2016 in Sharepoint, SharePoint 2010, SharePoint 2010 Foundation, SharePoint 2010 Server |

So i came across this problem where the default document mode in SharePoint 2010 was IE8 (legacy mode…) and i was developing an angular app that would be plugged into the site.

I did not want to update the masterpage as this may cause other issues with other parts of SharePoint. My only option was to update the Compatibility tag dynamically in the OnInit method on my WebPart.

 

Read More

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
%d bloggers like this: