XmlException: An error occurred while parsing EntityName in CRM Plugin


I had written a pre-update plugin, it was working properly on my environment.

But after sending it across to the client, after he had deployed it we started getting the below mentioned error.

“XmlException: An error occurred while parsing EntityName”

We were actually passing secure configuration information to the plugin in the following format

<Config>

<url>http://CrmServer/MSCRMServices/2007/CrmService.asmx</url>

<orgname>OrgName</orgname>

<username>UserName</username>

<password>Password</password>

<domain>Domain</domain>

</Config>

And the issue was the password that was being used, it had ‘&’ character, which we then replaced with ‘&amp;’ and the error got resolved.

Hope it helps!

Import Customization Error: Customization Import failed. Error: Entity with id already has the label Violation for column LocalizedName and language 1033 – update entity with id cannot have the same label


Hi got the following error while importing a customization file in CRM 4.

Customization Import failed. Error: Entity with id 02fe2413-00fb-44a9-a604-113c5134589d already has the label Violation for column LocalizedName and language 1033 – update entity with id 8e5456bf-38c1-4252-98fb-0637b9693940 cannot have the same label

It was referring to the custom entity name Violation.

The solution for this is to either change the display name of the already existing entity or the entity being imported.

I changed the display name of the existing entity to ViolationG.

I tried importing the entity again, however this time I got the below error

Customization Import failed. Error: Entity with id 02fe2413-00fb-44a9-a604-113c5134589d already has the label Violations for column LocalizedCollectionName and language 1033 – update entity with id 689586d1-d773-485a-90cf-a62ff54fff18 cannot have the same label

Here Violations was the plural name of the entity. I changed the plural name of the existing custom entity.

Tried importing the file again, and this time it succeeded without any error.

Check out this wonderful post àhttp://mscrm4kb.blogspot.com/2009/11/customization-issue.html

Hope it helps!

SetFocus on OnChange Event in CRM


In case of OnChange event, at times we need to do some validation and if the validation fails we want the focus to be set back to the same attribute.

We can make use of the following JScript for that

var oField = crmForm.all.crm_myfield;

oField.onblur = function() {

oField.SetFocus();

oField.onblur = null; }

oField.SetFocus();

or


set focus on some other field and then setting it back to our field

http://groups.google.com/group/microsoft.public.crm.developer/browse_thread/thread/3857037251c57f9e?pli=1

Bye..

Could not load file or assembly ‘Microsoft.Crm, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’ or one of its dependencies. The system cannot find the file specified or Deploying custom web application inside ISV folder of CRM 2011


To deploy our custom web application inside ISV folder of CRM 2011 we need to follow the below steps

Make following changes in the web.config

<configuration>
<configSections>
<remove name=crm.authentication />
</configSections>
<system.web>
<httpModules>
<clear/>
</httpModules>

……………………

And after deploying the application within the ISV folder, place the following dlls within its bin folder

  • AntiXssLibrary.dll
  • Microsoft.Crm.dll
  • Microsoft.Crm.Sdk.dll
  • Microsoft.Crm.Platform.Sdk.dll

We can find these dll’s inside

../Microsoft Dynamics CRM/Server/Bin folder.

The above solution worked perfectly for Beta Versions of CRM 2011.

Recently we upgraded to RTM, and we had to deploy a WCF Service and custom web site inside isv.

For WCF service we had to make following changes to the web.config apart from the changes mentioned above

<serviceHostingEnvironment aspNetCompatibilityEnabled=”false”>
</serviceHostingEnvironment>
</system.serviceModel>

And in case of custom web site we had to add the following additional dll’s

  • Microsoft.Crm.Sdk.Proxy.dll
  • Microsoft.Xrm.Sdk.dll

Hope it helps!

Get the Plugin assembly stored in database in CRM


One of my colleagues faced a situation where he had installed a plugin assembly into database but was not able to locate its dll, and now he wanted to deploy it in some other server.

These are the steps he followed

Get the encoded base 64 string representation of the plugin from PluginAssemblyBase table.

select name,content,*
from PluginAssemblyBase

Use that content and get the dll from the following site.

http://www.motobit.com/util/base64-decoder-encoder.asp

Set decode and export to binary file option there with filename having extension as .dll

Open the dll in the reflector tool and use the source code to build that assembly.

http://reflector.red-gate.com/download.aspx

Bye..

Setting Custom View as default for lookup in Connection entity. (CRM 2011)


To create a custom view for a lookup, we can refer to this blog post

https://nishantrana.wordpress.com/2010/12/31/filtered-lookup-in-crm-2011/

Here

lookupControl.addCustomView(viewId, entityName, viewDisplayName, fetchXml, layoutXml, true);

Setting last parameter as “true” sets the custom view as default. However this was not happening in case of connection entity lookups.

So to finally achieve this we did the following

Modify the lookupinfo.aspx “..\Microsoft Dynamics CRM\CRMWeb\_controls\lookup”.

Find the function named handleView and modify it to show our custom view as default.

function handleView(o, entity){
var selObjectsDropdown = (typeof (selObjectsList) == Mscrm.TypeNames.undefinedType) ? selObjects : selObjectsList;


if (o.innerHTML.indexOf(‘Case Member View’)!=-1){

var sOriginalViewId = “{C0F1DD64-1BF3-450D-BCDE-DF4732DE1001}”;

}
else {

var sOriginalViewId = crmGrid.GetParameter(“viewid”);
if (selObjectsDropdown.selectedIndex != -1 && selObjectsDropdown.options.length > 0) {
var tempDefaultViewId = selObjectsDropdown.options[selObjectsDropdown.selectedIndex].guid;
if (!IsNull(tempDefaultViewId)) {

sOriginalViewId = tempDefaultViewId;}}}

. . . . . . . .

. . .

It is an unsupported customization!!!!

Bye..