CRM 2016 + JavaScript: Web Resource cannot be reloaded

Since we got upgraded to CRM 2016 from CRM 2015, we faced a strange issue with JavaScript and Web Resource (html).

At some point of time the script goes to reload the html Web Resource with the following code:

var webResource = Xrm.Page.getControl("WebResource_ControlName");
webResource.setSrc(webResource.getSrc());

Easiest way to reload the web resource!

But the same code does not work in case of CRM 2016. As the web resource was already loaded when the page was loaded. CRM 2016 treats the same web resource not to be loaded again (may be for better performance!).

After trying numerous ways to solve, following code worked perfectly:

var webResource = Xrm.Page.getControl("WebResource_ControlName");
webResource.setSrc(Xrm.Page.context.getClientUrl() + "/WebResources/new_webResource?data=someValue%26ver%3D" + Math.random());

Here, I had to pass some parameters. What I have done to modify is added another parameter called “ver” (you can have any other parameter name instead of “ver”) and the value will be rendered from Math.random() method. This way the web browser treats each URL as a new request as Math.random() will return random number each time it will be executed.

Microsoft Ebooks huge collection… Free free free!!

Huge collection of Free Microsoft eBooks for you, including: Office, Office 365, SharePoint, SQL Server, System Center, Visual Studio, Web Development, Windows, Windows Azure, and Windows Server

http://blogs.msdn.com/b/mssmallbiz/archive/2013/06/18/huge-collection-of-free-microsoft-ebooks-for-you-including-office-office-365-sharepoint-sql-server-system-center-visual-studio-web-development-windows-windows-azure-and-windows-server.aspx

Large collection of Free Microsoft eBooks for you, including: SharePoint, Visual Studio, Windows Phone, Windows 8, Office 365, Office 2010, SQL Server 2012, Azure, and more.

http://blogs.msdn.com/b/mssmallbiz/archive/2012/07/27/large-collection-of-free-microsoft-ebooks-for-you-including-sharepoint-visual-studio-windows-phone-windows-8-office-365-office-2010-sql-server-2012-azure-and-more.aspx

Invalid Action – The selected action was not valid. Current key (KeyType : CrmWRPCTokenKey) is expired. This can indicate that a key is not being regenerated correctly.

I just had an error which does not let me access anything on CRM 2011 and present me a screen just with –

Invalid Action
The selected action was not valid.

I did not manipulate anything on server! So, I checked my event logs which said –

Current key (KeyType : CrmWRPCTokenKey) is expired.  This can indicate that a key is not being regenerated correctly.  Current Key : CrmKey(Id:xxxxxxxx-xxxx-xxx-xxxx-xxxxxxxxxxxx, ScaleGroupId:00000000-0000-0000-0000-000000000000, KeyType:CrmWRPCTokenKey, Expired:True, ValidOn:02/25/2013 06:31:03, ExpiresOn:03/30/2013 06:31:03, CreatedOn:02/25/2013 06:31:03, CreatedBy:NT AUTHORITY\NETWORK SERVICE.

I got solutions from MSDN saying these steps but both did not work. Most of the issues on net were solved by these steps mentioned. And mine was resolved by the steps given in Solution.

1. Restart IIS (iisreset from command prompt or run window)
2. Restart the CrmAsyncService (Services.msc restart CrmAsyncService)

Solution:

1. Open Command Prompt
2. Go to:  C:\Program Files\Microsoft Dynamics CRM\Tools
3. Run Microsoft.Crm.Tools.WRPCKeyRenewal.exe /R
4. Restart IIS

This should solve the issue and you will be able to see your CRM 2011 entities again!

CRM Installation Error: Action Microsoft.Crm.Setup.Common.Analyzer+CollectAction failed.

I was setting up a new virtual machine today for Microsoft Dynamics CRM today and encountered the error:

Action Microsoft.Crm.Setup.Common.Analyzer+CollectAction failed.
The specified domain either does not exist or could not be contacted. (Exception from HRESULT: 0x8007054B)

 

CRM Installation Error

The error is related to Active Directory. To resolve this issue, you just have to add the current server to the existing domain or promote the server as a domain (in case of virtual machine… similar to my case).

Know your computer's gender!!

Yeah!! Ever thought you could check your computer’s gender?!? Is it Male or Female?

Here is how!

Create a new .vbs file on your desktop… and paste the below statement in in, save it and run it.

CreateObject("SAPI.SpVoice").Speak "I love Mr. Skynetr. And he is a good boy"

Mine is a female!! 😛

Tell me yours…