Thursday, 18 April 2013


Exception While associating a record of setting up relationships (N:N) between child and parent records same entity


Code Fix :
associateRequest.Relationship.PrimaryEntityRole = EntityRole.Referenced;


AssociateRequest associateRequest = new AssociateRequest();
            associateRequest.Target = new EntityReference("account", childAccount.AccountId.Value);
            associateRequest.RelatedEntities = new EntityReferenceCollection();
            associateRequest.RelatedEntities.Add(new EntityReference("account", parentAccount.AccountId.Value));
            associateRequest.Relationship = new Relationship("account_parent_account");
associateRequest.Relationship.PrimaryEntityRole = EntityRole.Referenced;
            var associateResponse = xrm.Execute(associateRequest);

Tuesday, 16 April 2013

How to update the existing records using Re-import (OOTB Import)Wizard in MSCRM 2011:


If you export a set of Accounts for example and select the option to make available for update, save the file and then open the xml document using Excel, you'll see the format by expanding the first few hidden columns.  You can see that there are some unique values assigned that trigger the Update feature during import.


Step1:
 From Advance find take  the view where the primay key( Account -account name)  and also the required updated column (FAx) should be there.



Step2: Export the view but select the below option (MAKE THIS DATA AVAILABLE FOR RE IMPORT BY INCLUDING REQUIRED COLUMN HEADINGS) :




STEP3: Open the exported file  (open with Xml editor)



Step 4: Update the fax column data in the  above open  excel  with the data you required and save .

Step5: Import the same sheet from importing wizard like normal way.

Add Custom Attributes in the views of Activity Entity:

 Not possible .


The only "true" workaround is to customize each Activity-type record (e.g. Email, Appointment, etc.) individually to include the relationships or attributes you require, and develop custom pages, reports, Workflows, or Plug-in code to support your intended functionality upon each as necessary.
 Ref:

Wednesday, 3 April 2013


Display an HTML Web Resource in a Form with No Border:

When you add an HTML web resource to an entity form, a border will be displayed even when you do not check the Display Border check box of the formatting tab of the Web Resource Properties dialog box. To prevent a border from being displayed, set the style properties of the body element of the HTML document. You must also not include any DOCTYPE information. The following HTML will cause the HTML web resource contents to display without a border.

<html>
<head>
 <title>No Border Web Resource</title>
</head>
<body style="border-width: 0px; padding-left: 0px; padding-top: 0px; margin-left: 0px; margin-top: 0px; margin-bottom: 0px; margin-right: 0px">
 <p>
  This Web resource will display with no border</p>
</body>
</html>
By default, many HTML editors include DOCTYPE information in the contents of the HTML. The following HTML with the same body style applied will still appear with a border.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
 <title>Web Resource with Border</title>
</head>
<body style="border-width: 0px; padding-left: 0px; padding-top: 0px; margin-left: 0px; margin-top: 0px; margin-bottom: 0px; margin-right: 0px;">
 <p>
  Style applied but border still appears.</p>
</body>
</html>

Display Full-Screen Dashboards with Auto-Refresh in CRM 2011

CRM dashboards are great visualizations of what’s going on in the business. Sometimes we would just want to have a huge plasma screen displaying specific dashboards and refreshing the data automatically and regularly. This post will show you how simple that is!

When you want to permanently display a dashboard in a screen, these are the usual requirements:

  • Strip down the dashboard to exclude ribbon, navigation menu, etc.
  • Automatically refresh the page every X minutes
The solution is to create an HTML web resource which will embed the stripped-down dashboard in a new HTML page with refreshes automatically. These are the steps to do so:


1. Identify the dashboard you want to display on a screen
Click on the arrow to the right of “Dashboards” on the sitemap, then right click on the dashboard you select and click “Copy a Link” (and allow access to clipboard)

image

When you paste the link, it will look something like this: Customer Service Performance Dashboard <https://avanade45.crm.dynamics.com/workplace/home_dashboards.aspx?dashboardId=%7b2e3d0841-fa6d-df11-986c-00155d2e3002%7d&dashboardType=1030&sitemappath=Workplace%7cMyWork%7cnav_dashboards>
You need to copy the URL (in blue for the example above).



2. Create your HTML Web Resource to host the dashboard
Create a new web resource in your solution as follows
image



3. Edit the HTML to embed your dashboard and auto-refresh
Click on the “Text Editor” button and then click on the “Source” tab to enter your HTML code. This is the HTML I used:

<HTML>
  <HEAD>
    <TITLE>Customer Service Performance Dashboard</TITLE>
    <META content="300" http-equiv="REFRESH">
      <META charset="utf-8">
  </HEAD>
  <FRAMESET contentEditable="true" frameSpacing="0" border="0" frameBorder="0" rows=""*>
    <FRAME noResize="" src="/workplace/home_dashboards.aspx?dashboardId=%7b2e3d0841-fa6d-df11-986c-00155d2e3002%7d&dashboardType=1030&sitemappath=Workplace%7cMyWork%7cnav_dashboards" name="top" scrolling="no">
  </FRAMESET>
</HTML>


The highlighted values are the refresh rate (in seconds) and the relative URL to your dashboard (taken from step 1). Note that the relative URL above works for CRM Online, but for OnPremise you might need to modify the path slightly.
The HTML above is basically an embedded frame to your dashboard with a META tag to refresh the content every 300 seconds (5 minutes). It should work on most (or all) browser versions supported by MSCRM.



4. Navigate to your dashboard and make it full-screen.
There is a URL link from the web resource which you can click to navigate to your dashboard:

image

Now to make it full screen you need to hit F11 in your keyboard, and voila! This is all you will see on the screen:

image

Note that there is a dropdown control to update the dashboard; however, if you update the dashboard here, each time your window refreshes it will revert back to the original dashboard. So you might need to follow these steps for each dashboard that you want to display on a screen and never change the dashboard from the dropdown menu. Now you can also bookmark these URLs so you can directly access your dashboard screen anytime. Note that the same authentication as to access CRM will be required to access these HTML pages.