Archive

Posts Tagged ‘CRM’

Different ways of referencing web resources – CRM

December 8, 2014 Leave a comment

If you have a HTML file added as a Web resource in CRM and it need to refer below web resources

  • new_jquery
  • new_dummy

Below are 2 ways to achieve the same

Standard Way

One way is to follow below convention to refer the web resource files in your HTML file

<script src=”../webresources/{webresourcename}”></script>

Referencing by folders

Assume you maintain files in folder structure, in your Visual studio solution which looks as below

  • Jscript
    • Util
      • jquery.js
      • helper.js
    • Account
      • account_form.js
      • account_ribbon.js
  • CSS
    • dummy.css

Below is a more readable way to refer CRM web resources in HTML file.

Below are steps to achieve same.

Step 1

Add web resources with name as “solution prefix_/{webresourcename}”, as below.

  • new_/Jscript/Util/jquery
  • new_/CSS/dummy
Web resource with folder naming

Web resource with folder naming

Step 2 

When you follow above naming convention, web resources can be referenced like how we do it in Asp.net projects, as below

<script src=”Jscript/Util/jquery” type=”text/javascript”></script>

Refer MSDN Link

Categories: CRM Tags: , ,

Base and Extension base tables Merge error – Upgrade from CRM 2011 to 2013

October 29, 2014 Leave a comment

As we know till CRM 2011, CRM maintained two database tables for each Entity:

  • Base table for the out-of-the-box fields of an entity
  • Extension table for the custom fields added to an entity

With CRM 2013, Now there is just one entity table for a given entity.

So when you upgrade CRM 2011 to 2013 Organization using Deployment manager, both base & extension base tables will be merged automatically.

Refer this link on how to upgrade Organization from 2011 to 2013.

However, you might get merge error stating:

“This may exceed that the architectural limits of Microsoft SQL Server, and the merge operation will fail.”

Refer this link on how to fix the table merge error.

🙂

Network Error while accessing external service from CRM web resource

October 28, 2014 Leave a comment

We had a requirement to fetch and display data from external hosted service, on a HTML web resource  hosted in CRM.

So I created a HTML file with below logic to fetch data from external hosted service.

var xmlhttp = new XMLHttpRequest();
xmlhttp.open(‘POST’, {External Service URL}, false);

xmlhttp.onreadystatechange = function () {
if (xmlhttp.readyState == 4) {
if (xmlhttp.status == 200) {
// Success
}
}
}

The logic was working fine, when I tested individual HTML fine.

But when hosted in CRM, I was getting “Network Error”.

Reason :

  • Cross domain issue while accessing HTML from CRM

Fix :

  • Setting “Access data sources across domains” to “true” in IE browser solved the issue
Access data sources across domains

Access data sources across domains

🙂

Using ‘No Lock’ in FetchXML CRM

October 16, 2014 Leave a comment

In one of our requirement we are retrieving records using FetchXML and we observed fetch taking long time when there are more concurrent user access.

Reason:

  • Records are being updated by other users when I perform Fetch

Fix :

  • Set “no-lock=’true'” in the FetxhXML as below

<fetch mapping=’logical’ no-lock=’true’>

</fetch>

🙂

Categories: CRM Tags: , ,

The security timestamp is invalid because its creation time is in the future – Error CRM

September 24, 2014 Leave a comment

I was getting below exception when I try to create records from my console application using CRM Organization Service.

The security timestamp is invalid because its creation time (2014-09-24T08:51:00.583Z) is in the future. Current time is 2014-09-24T08:45:58.432Z and allowed clock skew is 00:05:00].

Reason :

  • There was difference in Time settings between CRM Front end server and CRM DB Server.

Fix :

  • In our case CRM Front end server and CRM DB Server time zones were different.
  • Also sometimes check if the “Windows Time” service is running on machines. (To check go to Run -> Services.msc)
  • FYI, “Windows Time” service maintains date and time synchronization on all client and servers on the network.

Same scenario would sometimes cause below exception too

Message security verification failed

🙂

Check Entities attribute type – CRM Late Binding

September 2, 2014 Leave a comment

Recently somebody posted a question in my blog, whether there is a way to determine the entities ‘Attribute Type’ instead of making Organization service call and read the metadata. 

Assume you have a Plug-in you made a ‘Retrieve’ call using Late Binding and, you got Entity object. 

Below is easy way to determine type of each attribute using ‘is’ operator.

Entity.Attributes[attributeName] is EntityReference

Or

Entity.Attributes[attributeName] is Money

Or

Entity.Attributes[attributeName] is OptionSetValue

🙂

Categories: CRM Tags: , ,