Blog migrated to another domain

Dear readers.

A few months ago I started my own company Sven Vervynckt BVBA in Belgium. Together with the company comes a brand new website, which is hosted on Microsoft Azure (for now).

The website created in WordPress – just like this website – and has its own “blog” part. So from now on, I will no longer update this website with new posts. But of course, you’re welcome to follow me on my new website.

http://svenvervynckt.azurewebsites.net/

And I which you all a Happy new year!

Thanks!

CRM 2011 The webpage you are viewing is trying to close the window

Sometimes when we want to close a CRM form via javascript, we get the following error:

The webpage you are viewing is trying to close the window. Do you want to close this window?

Our customer didn’t liked this windows because it’s again one additional click to close the form. We have solved this by adding script to the form.

the page is trying to close the webpage

Browsers do this for security reasons. The rule is “only windows opened by javascript can close them by javascript.” In any other case, this pop-up window is displayed.

Add the following line of code to the beginning of your CRM form. And the pop-up won’t show up anymore:

window.top.open('', '_self', '');

Hope this could help.

Tagged , , , , , , ,

CRM 2011 Enable trace logging on server

Sometimes it can happen that something unexplainable happens when using CRM. In this case you can always try to enable the Verbose logging on the server. Below you find a small step-by-step guide on how to do this.

Note: Try to avoid this on production environments with people working on. It can result in a slower performance. On servers with a lot of activity, verbose logging files can grow to multiple gigabytes in less than a few minutes.

  1. Log on the server where the CRM is installed
  2. Open the registry with the “regedit” command in the “run” window:run
  3. Navigate to the following folder in the registry:
    HKEY_LOCAL_MACHINE > SOFTWARE > Microsoft > MSCRM
  4. Change the following values:
    • TraceCategories: Depending on the number of logging you might change it to “Verbose” (for all information) or “Error” if you only want the critical requests;
    • TraceEnabled: 1 (to enable, to disable, change it to 0);
    • TraceRefresh: Change number to another value. The nummer doesn’t really matter;

registry

To analyse the trace logs you can use “CRMTraceReader”, which can be downloaded for free on CodePlex.

Just don’t forget to disable the logging again after you’ve reproduced your issue.

Tagged , , ,

CRM 2011 Pluginregistration tool: Unable to retrieve the organisations from the Discovery Service

When trying to open an organization with the following error appears:error

90% of all cases this issue can be resolved by doing an iisreset in the command line of the CRM server;

Tagged , , , ,

CRM 2011 – Found more than one RibbonDiff entity

While importing a CRM Solution, it can happen that the following error appears as a “result” of the solution:

Found more than one RibbonDiff entity

This is a bug in CRM which duplicates the <RibbonDiff> tag in the customisations.xml file. To make it back to normal again,

  1. Open the customisations.xml file from your solution;
  2. Clear all the data from between the <RibbonDiff> and </RibbonDiff> tags;
  3. Import the solution again. The Ribbon should look like the default ribbon after a new installation of CRM.
  4. Import the original solution again;
  5. Publish All Customisations

Normally everything should be back to normal with a beautifull customized ribbon.

Tagged , , , ,

CRM 2011/2013: Web resource not found for user

A few weeks ago I experienced something strange in CRM 2011. I created a HTML webresource, added to the form, but some users could not see the resource. When they tried to open the webresource the following screen appeared while opening the following URL:

http://crmd.customer:5555/WebResources/ag_/searchaffiliatedialog.html

notfound

I’ve check the security roles, tried with different users on different machines, cleared the cache, modified my test user to the same of the users with the error… But nothing worked.

 

Finally the reasons seemed to be that there was no organization specified in the URL. So changing:

http://crmd. customer.intranet:5555/WebResources/ag_/searchaffiliatedialog.html

to:

http://crmd. customer.intranet:5555/organisation/WebResources/ag_/searchaffiliatedialog.html

fixed the problem.

 

But of course, that doesn’t explain why this only happened to specific users. The reasons is that when no organization is specified in the URL, CRM picks the default organization for the signed in user. DefaultOrganizationId is a field in the “systemuser” table that is set for each user. To change this you can follow those steps:

  1. Go to SQL Server where MS Dynamics CRM 2011 installed:
    USE MSCRM_CONFIG
    SELECT *
    FROM organization

    You can find the list of organization in your CRM.

  2. Find the User’s Systemuserid. You can also find the user GUID using this query:

    USE Your_Organization_MSCRM
    SELECT      systemuserid
    FROM        systemuserbase
    WHERE domainname = ‘domain\user’

    For example: systemuserid = <6893E7A3-62B8-E011-AA60-000C292CBBE1>
  3. Find the User’s ID:

    USE MSCRM_CONFIG
    SELECT      userid
    FROM        systemuserorganizations
    WHERE             crmuserid = ‘6893E7A3-62B8-E011-AA60-000C292CBBE1’

    For example: User ID = <E0437EA7-9B8B-E011-9245-000C292CBBE1>
  4. Find the appropriate user in the systemuser table

    SELECT *
    FROM        systemuser
    WHERE             id = ‘E0437EA7-9B8B-E011-9245-000C292CBBE1’
  5. Update the systemuser table to reflect the desired defaultorganizationid

    USE MSCRM_CONFIG
    UPDATE     SystemUser
    SET        DefaultOrganizationId = ‘6893E7A3-62B8-E011-AA60-000C292CBBE1’
    WHERE      id = ‘E0437EA7-9B8B-E011-9245-000C292CBBE1′

  6. Run IISRESET and access the MS Dynamics CRM 2011

Hope this helps to keep you productive!

Tagged , , , , , ,

Error when applying inline custom filter on option set in CRM 2011

When applying an inline filter to a custom option set in CRM 2011 I received an error saying

“There was an error processing your request. Please wait an try again later.”

So I waited… and waited… and waited… but nothing happened.

 

The reason for this was that one of the option set values contained an “&” (ampersand) sign, which is not supported. But if we take a look at the option set configuration, we don’t see an ampersand. That’s because we used an “&lg;” ad “&gt;” for rendering an option set in HTML.

option set values

If you take a look at the option set in the configurations.xml you can see the code behind the option set:

<optionsets>

<optionset Name="agtd_deadlinecompare" localizedName="AG ToDo Deadline Compare">

<OptionSetType>picklist</OptionSetType>

<IsGlobal>1</IsGlobal>

<IsCustomizable>1</IsCustomizable>

<displaynames>

<displayname description="AG ToDo Deadline Compare" languagecode="1036" />

<displayname description="AG ToDo Deadline Compare" languagecode="1043" />

<displayname description="AG ToDo Deadline Compare" languagecode="1033" />

</displaynames>

<Descriptions>

<Description description="" languagecode="1033" />

</Descriptions>

<options>

<option value="861100013">

...

...

</option>

<option value="861100000">

<labels>

<label description="&lt; 2 weeks" languagecode="1033" />

<label description="&lt; 2 weeks" languagecode="1036" />

<label description="&lt; 2 weeks" languagecode="1043" />

</labels>

<Descriptions>

<Description description="" languagecode="1033" />

</Descriptions>

</option>

 

...

...

<option value="861100012">

<labels>

<label description="&gt; D+5" languagecode="1036" />

<label description="&gt; D+5" languagecode="1043" />

<label description="&gt; D+5" languagecode="1033" />

</labels>

<Descriptions>

<Description description="" languagecode="1033" />

</Descriptions>

</option>

</options>

</optionset>

</optionsets>

 

Tagged , , , , ,

BlogEngine on Windows Azure

While exploring the world of blogging I discovered something called blogEngine. This is a blog you can deploy directly from Microsoft Azure. There is also the possibility to add custom .NET code to extend the functionality of your Blog.

As a Microsoft and Microsoft Azure enthousiast I wanted to try this. That’s why I duplicated this blog on BlogEngine as well. You might like the one or the other more. So now you have the option to choose what’s more readable for you.

 

You can find the website on:

http://svenvervynckt.azurewebsites.net

Tagged , , , , ,

EF DbContext constantly changed: “The model backing the ‘DbContext’ context has changed since the database was created.”

While working on a project I experienced the following error:

InvalidOperationException was unhandled by user code

An exception of type ‘System.InvalidOperationException’ occurred in EntityFramework.dll but was not handled in user code
 
Additional information: The model backing the ‘AdminDataContext’ context has changed since the database was created. Consider using Code First Migrations to update the database (http://go.microsoft.com/fwlink/?LinkId=238269).
error
First I double checked  if the context really changed by executing the Update-Database command in the “Package manager console”. But it told me that the database was up-to-date.
 
PM> Update-Database
Specify the ‘-Verbose’ flag to view the SQL statements being applied to the target database.
No pending explicit migrations.
Running Seed method.
After a couple of hours I found the solution. I needed to add a line of code to the Global.asax file:
namespace Juwelenkistje.Admin
{
    public class MvcApplication : System.Web.HttpApplication
    {
        protected void Application_Start()
        {
            Database.SetInitializer<AdminDataContext>(null);
            AreaRegistration.RegisterAllAreas();
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);
        }
    }
}
This method executes some code when the DbContext (between <>) is used to access the database. SeeMSDN for more information about how to implement this method.
 
Hope this helps to keep you productive.
Tagged , , , ,

Change Ribbon color in CRM 2011

To raise the awareness of working in a production or development environment we changed the color of the ribbon for each CRM 2011 environment at our client. When working in Development, the ribbon is green, in Qualification orange, red for Acceptance and the color for Production is the default CRM color –We don’t want our end users to go mad–. The result is something like this:

Development (D)

RibbonInD

Qualification (Q)

RibbonInQ

 

Acceptance (A)

RibbonInA

 

Production (P)

RibbonInP

 

 

  1. Open a remote desktop connection and log in to the CRM server. For example:
  2. On the server, browse to the “static css” folder:C:\Program Files\Microsoft Dynamics CRM\CRMWeb\_static\css\1033


  3. If there are multiple languages, you should change the css in each language folder:

    1033 = English

    1043 = Dutch

    1036 = French

  4. Open the file cui.css and change the following classes:

    Original class

    Changed class

    .ms-cui-topBar2
    {

        border-bottom: 1px solid #b6babf;

        height43px;

       

    }

    .ms-cui-topBar2
    {

        border-bottom: 1px solid #b6babf;

        height43px;

        background-color: rgba(255, 136, 51, 0.5);

    }

    .ms-cui-tabBody
    {

        overflowhidden;

        width100%;

        height90px;

        background-color : #ffffff;

       

       

        background-repeat: repeat-x;

        background-position: left bottom;

        border-style: solid;

        border-width: 0px 0px 1px 0px;

        border-bottom-color: #898d92;

        margin0px;

        padding0px;

    }

    .ms-cui-tabBody
    {

        overflowhidden;

        width100%;

        height90px;

        /*background-color: #ffffff;*/

        background-image: none;

        background-color: rgba(255, 136, 51, 0.5);

        background-repeat: repeat-x;

        background-position: left bottom;

        border-style: solid;

        border-width: 0px 0px 1px 0px;

        border-bottom-color: #898d92;

        margin0px;

        padding0px;

    }

     

  5. Depending
    on the environment you will need to use another and color. See table below for
    the values:

    Environment

    RGBA Color

    Color

    CRM D

    rgba(184, 249, 181, 0.5);

     

    CRM Q

    rgba(255, 136, 51, 0.5);

     

    CRM A

    rgba(255, 0, 0, 0.3);

     

    CRM P

    default

     


Tagged , , ,