Showing posts from 2016

Deleted Forms Cause Error in Publish

During recent CRM upgrades I started getting the following error on publish. systemform With Id = {Guid} Does Not Exist After looking through the database it was discovered that there were upgraded forms that had been marked with the component state of deleted which were causing the error. Deleting those rows marked with the component state of 2 (deleted) allowed for publishing. *** Disclaimer: Modifying CRM data directly can void your warranty. Use at your own risk. *** delete from systemformbase where componentstate = 2

Repost: Loading Assemblies from Anywhere into a New AppDomain by 2012 by Marius Bancila

If you are interested in loading assemblies into a worker domain which do not live in the base directory of that worker domain, check out this great article with code.

Watch Window Copy for Plugin Context Depth Issues

For those times when you are trying to figure out a plugin depth issue and you want to quickly copy/past into your watch window. pluginExecutionContext.PrimaryEntityName pluginExecutionContext.Depth pluginExecutionContext.Stage pluginExecutionContext.ParentContext.PrimaryEntityName pluginExecutionContext.ParentContext.Depth pluginExecutionContext.ParentContext.Stage pluginExecutionContext.ParentContext.ParentContext.PrimaryEntityName pluginExecutionContext.ParentContext.ParentContext.Depth pluginExecutionContext.ParentContext.ParentContext.Stage pluginExecutionContext.ParentContext.ParentContext.ParentContext.PrimaryEntityName pluginExecutionContext.ParentContext.ParentContext.ParentContext.Depth pluginExecutionContext.ParentContext.ParentContext.ParentContext.Stage pluginExecutionContext.ParentContext.ParentContext.ParentContext.ParentContext.PrimaryEntityName pluginExecutionContext.ParentContext.ParentContext.ParentContext.ParentContext.Depth pluginExecutionContext.ParentContext.P

Get Solutions Containing Web Resource

Snipit to determine which solutions contain a web resource. SELECT TOP 1000 S.FriendlyName, s.UniqueName, WR.DisplayName, WR.Name FROM [Default_MSCRM].[dbo].[SolutionComponentBase] SC LEFT JOIN Default_MSCRM.dbo.SolutionBase S ON S.SolutionId = SC.SolutionId INNER JOIN Default_MSCRM.dbo.WebResourceBase WR ON WR.WebResourceId = SC.ObjectId WHERE WR.Name LIKE '%classeventscoresheet.htm%'

Refresh ISV/WebResource after CRM 2013/2015/2016 Save Event

I had a Web Resource page which needed to refresh a jqgrid on it after some fields on a CRM form were updated and record was saved. In order to do this a ran a watcher to check to see if the modified date of the record had changed if so I ran the code to update the grid. This code is on the actual Web Resource page not the form JS. Also a quick note you may want to run another watcher to make sure window.parent.Xrm.Page is not null before you run this code. //set the initial modified on date var prevModifedOn = window.parent.Xrm.Page.getAttribute('modifiedon').getValue(); var xrmPageWatcher = window.setInterval(function () { //check to see if the date is modified, convert to string since JS doesn't know how to convert the CRM date time to a datetime object if (window.parent.Xrm.Page.getAttribute('modifiedon').getValue().toString() != prevModifedOn.toString()) { //update the previous data time so we can detect another save prevModifedOn = window