Thursday, September 21, 2017

VS - Find and Replace JS File Name With Version Number

File Name: test.1.3.5.4.min.js

VS Regex: test.\d+(\.\d+)+.min.js

Thursday, July 13, 2017

Finding Parental and Cascading Relationships In CRM using SQL

This script will find custom Parental or Cascading Relationship between entities in CRM.  This script was used to determine if someone had changed a relationship on a target system and if that change was causing an import to fail.

SELECT REL.[Name]
   ,[CascadeLinkMask]
      ,Referencing_Entity.LogicalName
      ,Referencing_Attribute.LogicalName
      ,Referenced_Entity.LogicalName
      ,Referenced_Attribute.LogicalName
      ,[RelationshipType]
      ,[CascadeDelete]
      ,[CascadeAssign]
      ,[CascadeShare]
      ,[CascadeUnShare]
      ,[CascadeMerge]
      ,[CascadeReparent]
      ,[IsCustomRelationship]
  FROM [DefenseReady_MSCRM].[MetadataSchema].[Relationship] REL
  left join DefenseReady_MSCRM.MetadataSchema.Entity Referencing_Entity on REL.ReferencingEntityId = Referencing_Entity.EntityId
  left join DefenseReady_MSCRM.MetadataSchema.Entity Referenced_Entity on REL.ReferencedEntityId = Referenced_Entity.EntityId
   left join DefenseReady_MSCRM.MetadataSchema.Attribute Referencing_Attribute on REL.ReferencingAttributeId = Referencing_Attribute.AttributeId
  left join DefenseReady_MSCRM.MetadataSchema.Attribute Referenced_Attribute on REL.ReferencedAttributeId = Referenced_Attribute.AttributeId
  where IsCustomRelationship = 1
  AND CascadeLinkMask NOT IN (2,3,1099511627779,1099511627778,1)
  ORDER BY Referencing_Entity.LogicalName
  --RefRestrictDelete 1099511627779, 3
  --Referencial 1099511627778, 1,2
  --Parental 4311810305,1103823438081
  --Many To Many 1
  --Configure Cascading 4311810306, 4311810307

Thursday, March 16, 2017

VS Shortcut for Data View Pane on SSRS Report

To open the Data View pane for an SSRS report do the following.

-Open Report
-Click on the Report Canvas
-Use the following keyboard shortcut
Ctrl+Alt+D

CRM SSRS FetchXml PreFiltering Tips

I don't do custom SSRS to often but when I do I consonantly have issues pre-filtering FetchXML in SSRS reports.  The items below are what I have found to be the total set of requirements to make sure it works.

Example:  Let's say we have an entity called 'new_house'.  Below is the FetchXML statement I would use in the data set.

<fetch mapping="logical" version="1.0">
 <entity name="new_hosue" enableprefiltering="true" prefilterparametername="CRM_Filterednew_house">
  <all-attributes/> 
</fetch>



Here are the steps i usually take to create this fetch.

-Open the query designer and paste in the fetch without the enableprefiltering and prefilterparametername attribute.

<fetch mapping="logical" version="1.0">
 <entity name="new_hosue" >
  <all-attributes/> 
</fetch>


-Next add the enableprefiltering="true" attribute then close the dataset.  A new Parameter will automatically be created in your report.  Sometimes SSRS will create the report parameter name correctly but sometimes it will not.   The report parameter MUST have the following naming convention.  If it does not select the properties of the parameters and change it's name.

CRM_Filtered<entityname>

So in my case it needs to be called CRM_Filterednew_house

-Reopen the dataset and update the fetch to include the prefilterparametername attribute

<fetch mapping="logical" version="1.0">
 <entity name="new_hosue" enableprefiltering="true" prefilterparametername="CRM_Filterednew_house">
  <all-attributes/> 
</fetch>



Final Notes:
-DO NOT ALIAS the entity you are prefiltering.  If you add the alias it will not work.  You may Alias any Linked Entities.
-DO NOT RE-UPLOAD your file to the same Report record you created in CRM.  When you do the initial upload of the report the first time a lot of things are saved to this record and are not updated if you just edit the record and upload a new rdl file.



Monday, February 6, 2017

RDWeb - Cannot use Connect to a PC Functionality

After completing the setup of the RDS/RDWeb on Windows Server 2012 R2 we were unable to use the "Connect to a PC" functionality. When attempting to connect the following error:

Remote Desktop can't find the computer "". This means that "" does not belong to the specific network. Verify the computer name and domain that you are trying to connect to" 

The fix for this is to go into the IIS Manager on the RDS server. 
 -Go to Server -> Sites -> Default Web Site -> RDWeb -> Pages 
-Click on Application Settings. 
-Modify the DefaultTSGateway setting by entering the FQDN of your RDS server. eg(rds.richardawilson.lab)

Tuesday, October 18, 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

Tuesday, October 4, 2016

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. http://www.codeproject.com/Articles/453778/Loading-Assemblies-from-Anywhere-into-a-New-AppDom