« May 2008 | Main | July 2008 »
June 2008
June 30, 2008
Error Occurred Promoting E-Mail to Microsoft CRM
A user recently saw a strange error when tracking one of his Outlook e-mails in Microsoft CRM 4.0. Whenever he would try to track e-mails from one specific contact, he would get the following error message:
An error occurred promoting this item to Microsoft CRM. The Microsoft CRM Server could not be contacted or the user has insufficient permissions to perform this action. This item has been saved to Microsoft Outlook but is not being tracked in Microsoft CRM.
This was very frustrating, because it only occurred when he tracked e-mails from one specific contact.
The problem turns out to be with the e-mail signature of the contact's e-mail. It had an image of his company's logo in it. The issue is that whenever you open an e-mail with an image in it, that image is stored to the Outlook temp folder. The problem happens when you get more than 99 copies of this image in the temp folder.
The solution is to go and clear out the files in the Outlook temp folder.
For more details, see support KB article 933234. Note that this article says that it applies to 3.0, we have also seen this same issue with 4.0.
Posted by Joel Lindstrom on June 30, 2008 at 09:34 AM in Microsoft CRM Tricks and Tips | Permalink | Comments (0) | TrackBack (0)
June 29, 2008
Pre-Filtered Reporting in CRM
The ability to build Pre-Filters for custom reports through CRM’s built-in user interface is one of the great features of Microsoft CRM. Allowing report developers to utilize CRM’s advanced find interface ensures application consistency and ease of use for the end-user.
Two Methods of Pre-Filtering CRM Reports
There are two methods of connecting a report to CRM’s pre-filtering feature. The first, using CRMAF_ style Aliased Views, is more common and easier to implement, the other using Dynamic SQL is less intuitive, but allows for more interactive reports.
Aliased views
Most beginning CRM report developers have built a pre-filtered CRM report by aliasing the filtered view in the dataset with CRMAF_FilteredEntity. (See http://msdn.microsoft.com/en-us/library/aa685875.aspx for more information.) –
Here’s a simple example of the query in a report dataset that uses the Aliased View method of report pre-filtering.
Select CRMAF_FilteredContact.* from FilteredContact CRMAF_FilteredContact
When run from CRM’s Reports, Forms or Entity List interface, CRM recognizes the CRMAF_ alias and uses the context or default filter to as the basis for the dataset’s pre-filter.
This method is the easier of the two methods to understand, implement and test. It works great as long as you need only need to pass the results of the filter to a single report.
Dynamic SQL
When a report needs to pass the results of a pre-filter to a drill-down or sub-report, the aliased view method will not work since CRMAF_FilteredEntity does not pass the filtered dataset from the parent report to the sub-report. Consequently, the sub-report will process the query as if no pre-filtering had taken place in the parent report. [Just to be clear, not all drill-down/sub-reports need to pass the results of the filtered dataset to the report.]
Dynamic SQL is also useful is when the report needs the flexibility to change at runtime based on user input. Dynamic SQL allows you to substitute portions of the query, or even the entire query itself based on user input.
Here’s what the dataset query for a very simple pre-filtered contact report would look like if written as a Dynamic SQL style report.
DECLARE @SQL1 nvarchar(max)
Set @SQL1 =
'SELECT * FROM (' + @CRM_FilteredContact + ') Contacts'
EXEC(@SQL1)
At runtime, the variable @CRM_FilteredContact is replaced with the SQL equivalent of the pre-filter from CRM to serve as a sub-query. The entire string is then executed as a single query.
The value of understanding Dynamic SQL-style reporting becomes apparent when you consider that reports created through the CRM Report Wizard and most, if not all, of the ‘out of the box’ CRM reports use the Dynamic SQL – style of dataset query design. Modifying any of these reports outside of CRM requires understanding what at first seems to be an overly complicated format, but when understood becomes only moderately complicated but extremely useful.
In the next post, we’ll look at the structure of a Dynamic SQL query in a CRM report.
-- Scott Sewell
Posted by Scott Sewell on June 29, 2008 at 11:26 PM in Microsoft CRM Reporting | Permalink | TrackBack (0)
June 27, 2008
Change The Tabbing Direction On Microsoft CRM Forms
From time to time new users of Microsoft CRM ask me if it is possible to change the tabbing order of fields on a CRM form. People are used to hitting the tab key on their keyboard while populating a form on a web site, and having the cursor move to the field on the right.
However, this is not how Microsoft CRM forms behave by default. Instead of left to right, top to bottom, the default tabbing order on CRM forms is top to bottom, left to right. So if you have users that need to key in a lot of data and want to do it in a logical manner (First name, last name, address 1, address 2, city, state, zip, for example), you have to lay out your fields top to bottom instead of left to right, so they can quickly populate the form.
The problem that this can cause is when people pull up the record, the information is not layed out in the way that is easiest to read.
The good news is that the tabbing order on the form can be modified using a simple javascript function. Put the following in the OnLoad event for the form:
function OnCrmPageLoad()
{
ReArangeTabIndex();
}
function ReArangeTabIndex()
{
for( var i = 0 ; i < crmForm.all.length ; i++ )
{
if( crmForm.all[ i ].tabIndex )
crmForm.all[ i ].tabIndex = 1000 + (i*10);
}
}
OnCrmPageLoad();
Special thanks to Adi Katz in the Microsoft Dynamics CRM forums. Adi is a Microsoft CRM Expert in Tel Aviv, Israel, and has a great blog with a lot of really innovative uses of javascript in Microsoft CRM--see Microsoft CRM Unleashed.
Posted by Joel Lindstrom on June 27, 2008 at 06:39 PM in Microsoft CRM Customizations | Permalink | Comments (2) | TrackBack (0)
Microsoft CRM 4.0 Workflows Not Working After Org is Imported
One issue I've seen when you import a CRM database as a new organization using the deployment manager in Microsoft Dynamics CRM 4.0 is that the workflows in the database that was imported do not work. When I've seen this issue, I have deleted and recreated these workflows, and they work fine.
Microsoft has released a hotfix for this issue. Turns out that when the deployment manager imports the org, the AsyncOperationsBase table is updated incorrectly, preventing these workflow rules from running.
You have to call Microsoft support to get this hotfix.
Posted by Joel Lindstrom on June 27, 2008 at 06:35 AM | Permalink | Comments (0) | TrackBack (0)
June 26, 2008
Turn E-Mail Address Fields Into Hyperlinks In Microsoft CRM
When you open a Contact or Account record in Microsoft CRM, a user might assume that they can click on the e-mail address to compose a new E-Mail to that address; however, out of the box, Microsoft CRM does not work that way. In 3.0, it is especially deceptive, because it is blue and underlined like a hyperlink; however, it does not work that way.
The good news is that with some simple on-load javascript, you can change the E-Mail address to a hyperlink that will launch a new E-mail when you click on it.
Just add the following to to On-Load event of the Contact form. You can adapt it to work with the other address fields by modifying the emailaddress1 to whatever the name of the other e-mail field is.
//make email1 a hyperlink to create a new email
if (crmForm.all.emailaddress1 != null) {
crmForm.all.emailaddress1.ondblclick = function() {
var email = crmForm.all.emailaddress1.DataValue;
if ((email != null) && (email.length > 0)) {
window.navigate("mailto:" + email);
}
}
}
Thanks Michael at Stunnware.
Posted by Joel Lindstrom on June 26, 2008 at 10:32 PM in Microsoft CRM Customizations | Permalink | Comments (2) | TrackBack (0)
Scroll Bars Missing From Web Sites Linked From Microsoft CRM Sitemap
One of the really nice things about Microsoft Dynamics CRM being a web application is the ability to easily extend the functionality by creating links in the navigation bar to other web sites. This give users of CRM the ability to create their own html or aspx pages and present them to users as part of the main application.
We frequently use this to add FAQ pages to provide customized help instructions to users, and add-ons, such as our Interactions and Quick Call apps.
We have found that due to some changes from 3.0 to 4.0, the behavior of links in the sitemap has changed. With 3.0, when you put a link in the sitemap, it would launch that link in the CRM window, but if the page linked to was longer than the CRM window, a scroll bar would appear, allowing users to scroll the length of the page linked to.
With 4.0, when you add a link to the sitemap, it will still appear within the Microsoft CRM window; however, if the page linked to is longer than the CRM Window, no scroll bar will appear, preventing the user from full seeing the page.
One solution previously described on this blog was to have your link open a new window when it launches.
This solution is viable; however, some users may not like additional windows popping up. What do you do if you want to have the link open in the CRM window, as it did with 3.0?
A pretty simple solution is to create an html page with an iframe. You can do this in notepad. Something like this:
<head>
<title>Untitled Page</title>
</head>
<body style="width:100%; height:100%; background-color:#d6e8ff; margin:3 3 3 3">
<iframe id="frm" src="http:/sb00m/FAQ/FAQ.htm" frameborder=0 height=100% width=100%></iframe>
</body>
</html>
Change the src= link to link to your custom page/application. Then save this html page in the folder of the virtual directory for your custom webpage/application.
Then, just change your link in the sitemap to point to your new html page with the iframe, which will point to your custom webpage/app.
The result looks, feels, and functions exactly like it did in 3.0.
Posted by Joel Lindstrom on June 26, 2008 at 07:22 AM in Microsoft CRM Customizations | Permalink | Comments (8) | TrackBack (0)
June 23, 2008
What To Do If A Report Won’t Upload to Microsoft CRM
So you write your fantastic SRS report in Visual Studio, but when you upload it to CRM, you get a generic error message. What should you do?
- Verify if it is a CRM problem or a problem with the report. Select any of the standard CRM reports, click the "Edit report" button, and on the Edit Report screen, click "More Actions" and "Download Report." This will download the RDL file for the report. Rename the report (For Example, change Account Summary.rdl to Account summary 2.rdl), and attempt to upload this new report to CRM. If the report uploads successfully, you have adequate permissions to upload reports, and there is a problem with your report.
- Test the report on the report server. Go to your report manager URL (http://servername/reports) and upload the report there. If there is a problem with the report, it may give you a more specific error message than CRM did.
- Check your rdl file in Visual Studio. Don't forget to check the basics—make sure that you have used an embedded data source, not a shared data source. This is a common problem that can be frustrating, because if you use a shared data source, the report will preview correctly in Visual Studio, but will not work with CRM.
Do you have any other report troubleshooting tips? Please share them in the comments.
Posted by Joel Lindstrom on June 23, 2008 at 04:44 PM in Microsoft CRM Tricks and Tips | Permalink | Comments (0) | TrackBack (0)
Cannot Export Customizations From Microsoft Dynamics CRM 4.0
Problem: When you go to Settings/Customization/Export Customizations and attempt to export all customizations, you get the following error:
"An unhandled exception occurred during the execution of the current web request." The screen looks like this:
This problem is caused by an attribute being referenced on a form without the relationship being present. This can happen when a relationship gets deleted without the lookup fields being removed from the form, or by importing entities that have a 1:N relationship without importing the relationship—sometimes this happens when entities are imported one at a time.
Solution: You need to figure out which entity has the problem. You can do this by running the CRM 4.0 Diagnostic Tool, enabling platform tracing, and recreating the error by attempting to export customizations. The log file that is generated by the platform trace should tell you which entity has the problem.
Another way to locate the problem entity is to attempt to export a smaller subset of entities. Attempt 3-5 at a time going down the list until you get to a group that throws the error. Then try to export each of these individually, until you get to the one that throws the error.
Once you have found the problem entity, go to forms and views in entity customization and open the form view. You will see which attributes are causing the problem, as they will appear grayed out. Double click on them and go to the name tab. This will tell you what the name of the attribute is.
Next, go to the attribute tab for the entity customization, and create a new attribute with the name of the deleted attribute. Save and publish.
Now you should be able to export your customizations. You can then delete the fields from the form, publish, delete the temporary attributes that you created, publish, then set up the relationship again if desired.
Posted by Joel Lindstrom on June 23, 2008 at 02:38 PM in Microsoft CRM Tricks and Tips | Permalink | Comments (4) | TrackBack (0)
Microsoft Dynamics CRM 4.0 Mail Merge Basics
Someone was asking me about the new mail merge capabilities in Microsoft CRM 4.0 recently. This functionality is much enhanced from 3.0, and now harnesses the complete Microsoft Office mail merge capabilities.
It's a great tool to give users the ability to generate documents from CRM. Once you perform the mail merge, the results can be printed or emailed through Microsoft Word, so if a user understands how to us Mail Merge, they can create custom formatted documents and send them to clients. Along with the report wizard, this can become an ad-hoc formatted report generator tool--we have had clients use this to create quotes and other basic reports.
So where should a 3.0 user start to learn how to use the new mail merge capabilities?
I would start with this post from the Microsoft CRM team blog. It has very detailed step by step instructions on creating a mail merge.
Also, be aware of some limitations of mail merge. There is a 62 field limit on the number of attributes that you can include in a mail merge. Also, with the exception of quotes/quote products, you can not reflect fields from child related entities, just parents--so if you were performing a mail merge from accounts and you have a child custom entity related to it, you could not look up fields from that entity for your mail merge.
Another good post is this one which details all of the different areas where mail merge can be invoked. I learned several things from it, including that you can create a quick campaign from a mail merge. Pretty nice.
Posted by Joel Lindstrom on June 23, 2008 at 06:53 AM in Microsoft CRM Tricks and Tips | Permalink | Comments (0) | TrackBack (0)
June 20, 2008
The URL of a CRM Published Report
Running an SRS report with CRM filters can be quite powerful. Running the report from a URL opens up additional possibilities. For example, say you have a report that you want to run from the CRM SiteMap. To do this you need the URL, but which URL will work best?
A report published via CRM has a couple different URLs. There is the URL that can be captured using Ctrl-N on the open report, just like any other open CRM window. There is also the URL that can be captured from the report server. These solutions do not work because in the first case the URL as is cannot be uploaded to CRM after modifying the xml. In the second case, the CRM filters are not available when running the report directly from the report server. Although neither of these URLs will work in the SiteMap example, capturing the report shortcut URL will work.
To get the report shortcut URL:
1. Assuming the report has been published to CRM, open CRM 4.0 and locate the desired report in the list of CRM reports;
2. Right click on the report that you want to view from the CRM Report Viewer using a URL;
3. Select the Send shortcut option and then use this URL.
In this example make sure the report query uses CRMAF_ to avoid a message about a default filter. In the SiteMap xml update you are then simply calling this URL, and you will view the report just as if it were run from the CRM reports grid view. The code will look something like this: <SubArea Id="nav_TheReport" Title="TheReport" Description="TheReport" URL="TheSendShortcutURL" Client="NameTheDesiredClients" AvailableOffline="trueOrfalse"/>
Posted by David Frattalone on June 20, 2008 at 08:50 AM | Permalink | Comments (1) | TrackBack (0)
Custom Toolbars and Buttons Not Showing Up in Microsoft Dynamics CRM 4.0
With Microsoft Dynamics CRM 4.0, you can add custom buttons, menus and toolbars to entity forms by editing the ISV.config XML file. With 3.0, this was stored in an external XML file. In 4.0, you access the ISV.config xml file by exporting it from the CRM Customizations (Settings/Customizations/Export Customizations).
If you export the ISV.Config customizations, you will see some examples of custom toolbars and menus in the file that you can use as an example to build your own.
So after you add your custom button, import the customizations, and publish customizations, what do you do if your custom button does not show up?
1. Verify which clients are set to display ISV configurations. In Microsoft CRM 4.0, go to Settings/Administration/System Settings and select the clients that you want to display your custom toolbars or buttons, such as web, Outlook on-line, and Outlook Offline.
2. Enable ISV Extensions in Security Roles: In each security role that you want to see the button, you need to make sure that ISV extensions is enabled on the customization tab.
3. Verify that your XML is the correct case. For example, the Entity name in the ISV must be lower case. For example <Entity name="Account"> will not be recognized, and as a result, your button will not show up. You have to use <Entity name="account">. See http://msdn.microsoft.com/en-us/library/cc150895.aspx
Posted by Joel Lindstrom on June 20, 2008 at 07:50 AM in Microsoft CRM Customizations | Permalink | Comments (2) | TrackBack (0)
Custom Entity Name & Outlook Offline Synchronization Failure
CRM allows the developer to create custom entities with the same name as an out-of-box entity provided the out-of-box entity is first renamed. For example, in the scenario were a custom opportunity product entity is needed, the existing entity can be renamed to XXXOpportunity Product (plural name to XXXOpportunity Products) and then the new entity can be published. In 3.0 there are no issues, but with 4.0, synchronization to an offline client will fail.
To get around the issue the custom entity can be renamed and published, synchronization can be completed, and then the entity can be renamed back. This of course is not a practical solution. A best solution for now is to just rename your custom entity with a name that is not the same as an out-of-box entity. Microsoft is working on the fix.
Posted by David Frattalone on June 20, 2008 at 07:37 AM | Permalink | Comments (2) | TrackBack (0)
June 19, 2008
Installing Windows SharePoint Services 3.0 on the same server as Microsoft Dynamics CRM 4.0
I recently revisited a post from a year ago SRS, Microsoft SharePoint and Dashboards in Microsoft CRM. One of the reasons that I post to the CustomerEffective blog is so I can find the information when I need it later, and I need to set up a dashboard.
The scenario that I'm working on now is:
- SharePoint is not installed
- The only reason SharePoint is needed is to display the dashboard, so WSS is ok
- There is not an available server to dedicate for SharePoint, so we are using the same server as CRM
- CRM is installed as the default web site
This presents some interesting wrinkles not discussed in my original post. When you do the standard or advanced installation (stand alone), SharePoint takes over port 80, and deactivates the default web site. The problem is that when it does this on the CRM server, CRM will no longer be available, which is a problem.
The good news is that it is possible to have SharePoint use a different port; however, it is not extremely obvious.
You have to choose the advanced option and choose the web front end option. This is confusing because this is the option to set up a server farm. We want to select this option, even though we are just installing it on one server.
Follow the steps on this Microsoft TechNet web site (until it starts talking about adding additional servers, unless you intend to set up a SharePoint server farm).
Then go to the SharePoint Central Administration web site, create a new web application. This is where you can specify a port number other than 80 for your dashboard site to use, then you can go ahead and create your dashboard site on your new web application.
Posted by Joel Lindstrom on June 19, 2008 at 04:38 PM in Microsoft CRM Implementation | Permalink | Comments (4) | TrackBack (0)
June 18, 2008
Sorting By Multiple Columns in Microsoft Dynamics CRM 4.0
One of the limitations of views in CRM 3.0 is that you can only sort by one column. I was recently asked if this was still the case in 4.0.
One trick with CRM 3.0 and 4.0 is that users can sort by multiple columns by shift+Clicking at the time the view is run as described by Brian Begley at MSCRMSPOT.
The bad news is that with CRM 4.0, the same limitation applies—when you design a view you can only select one default sort column. Users can sort by other columns by clicking on the headers.
The good news is that with the 4.0 report wizard, you can easily turn your view into a report that can be sorted by multiple columns.
In the report wizard Lay Out Fields screen, you will see a similar configure sorting button that allows you to select one column to sort by.
But you also have the ability to add groupings. So when you click on a column and click the "click here to add a grouping button" you will see the grouping screen.
The nice thing about this is that you can group by columns that are not even displayed on the report. So I could have a report that is grouped by state name sorted descending and have my rows sorted by account name ascending. Since you can have multiple groupings, the number of sort combinations is virtually unlimited.
Posted by Joel Lindstrom on June 18, 2008 at 10:41 AM in Microsoft CRM Tricks and Tips | Permalink | Comments (0) | TrackBack (0)
Don’t Use a Trial Key to Test an Upgrade to 4.0
When you get ready to upgrade your Microsoft CRM from 3.0 to 4.0, it is best practice to test the upgrade before you upgrade your production environment, to see if there are any issues with your database that will prevent the upgrade from completing successfully.
One thing I learned the hard way is do not use a trial key to do the test upgrade. The CRM 4.0 install does not tell you until you are half way through that you cannot upgrade to a trial license key, and the only option at that point is to cancel the install.
Fortunately, it stops before it makes any changes to the 3.0 database, but you will have to reinstall 3.0 and all of the rollups, which can be time consuming
Learn from my mistakes.
Posted by Joel Lindstrom on June 18, 2008 at 09:37 AM in Microsoft CRM Implementation | Permalink | Comments (0) | TrackBack (0)
June 13, 2008
Auto-sending Microsoft CRM Campaign Emails
One nice enhancement to Microsoft CRM 4.0 campaign management is the ability to choose to automatically send campaign emails when the email activity is deployed. When you deploy the email activity, there is a checkbox that you can check to send e-mail automatically and close the email activities.
Say you are on 3.0, and you need this capability? The good news is that this functionality can be enabled in 3.0. You have to have rollup 1 installed, and then make a registry change.
1. | Click Start, click Run, type regedit, and then click OK. | ||||||
2. | In Registry Editor, locate the following registry subkey: HKEY_LOCAL_MACHINE\SOFTWARE\MICROSOFT\MSCRM | ||||||
3. | Create the registry entry. To do this, follow these steps:
|
See Microsoft KB article 911520 for full details.
Posted by Joel Lindstrom on June 13, 2008 at 11:02 AM in Microsoft CRM Tricks and Tips | Permalink | Comments (0) | TrackBack (0)
Fixing the Pesky Grayed-Out CRM Outlook Toolbar
Users of the Microsoft CRM client for Outlook from time to time may experience problems with the CRM toolbar being "grayed out." This can be frustrating, as you can see the toolbar, but can't use it. There are several reasons that this can happen, such as incompatibility with other plugins, network availability, etc. Frequently I see these kinds of issues when users open Outlook while not connected to the network, then go back on their network. CRM sometimes seems to still think that the user is not connected to the network and have trouble authenticating. There are several things that you can try to fix the problem—this is not a complete list, but a good start.
Microsoft Dynamics CRM 4.0:
- Typically, most of these issues can be fixed by reconfiguring the outlook client. To reconfigure the client, close Outlook, click start, All Programs, Microsoft Dynamics CRM 4.0, configuration wizard.
Microsoft CRM 3.0:
- Make sure that you are on the latest version of the client. For 3.0, that would be VC3 client with rollup 2 and rollup 3.
- Refresh the plug-in: In Outlook 2007, settings, trust center, addins, and click the "go" button on the bottom of the form to manage COM plug-ins. Click the check box next to the outlook plugin, then click ok. Log out of Outlook. Log back in to Outlook, go back to the trust center, re-enable the plugin, close outlook, reopen Outlook. This should fix the problem.
- If you are using Office 2007 and IE 7, make the registry change referenced by Dale here.
Posted by Joel Lindstrom on June 13, 2008 at 10:51 AM in Microsoft CRM Tricks and Tips | Permalink | Comments (1) | TrackBack (0)
June 11, 2008
Publish Microsoft CRM Reports for External Use
Scenario: You want to allow people to access your CRM reports outside of CRM, for example, for a SharePoint dashboard. When you go to your reportserver URL and open the MSCRM folder; however, all you see is a list of guids, not report names:
And when you click on one of the GUIDs, you get prompted for credentials
The reason is that when you upload a report or create a report with the CRM report wizard, they are published for "internal use only." If you want to extend the report to users outside of CRM, you need to publish the report for external use.
- In CRM, click on Reports, and select the report from the list (do not double click to open the report.
- Click the Edit Report button
- On the Report properties page, click Actions and select "Publish Report for External Use"
Now, when you go to your Report Server URL, you will now see a hyperlink with the name of the report, and when you click on it, the report will launch without prompting for credentials.

Posted by Joel Lindstrom on June 11, 2008 at 11:19 AM in Microsoft CRM Reporting | Permalink | Comments (1) | TrackBack (0)
What does "reparenting" do?
A question I get from time to time is what does the relationship "Reparent" option mean? In 1:N parental relationships, by default, CRM cascades the security of parents to childred in areas like assignment, sharing, delete and merge. Most of these are pretty straight forward--for example, if I delete an account, by default all contacts will also be deleted. If I assign an account to Landy, the contacts will also be assigned to Landy.
Fortunately, all of these can be edited, based on your preference, by changing the relationship type to "Configurable Cascading." You will then be presented with a picklist for each of these areas, where you can select Cascade All (default behavior) , Cascade Active, Cascade User-Owned, and Cascade None. By selecting Cascade None, you can prevent the behavior from cascading from the parent to the child.
So what does Reparent mean? It has to do with granting security access when a parent is related to the child, or that relationship is changed. For example, say that Landy owns an account, and I create an opportunity associated with that account. By default, Landy would have access to that Opportunity, while I would still be the owner of the opportunity.
If you want to restrict access to opportunities to only the owner of the opportunity, you would want to change the reparent cascading behavior to Cascade None.
Posted by Joel Lindstrom on June 11, 2008 at 07:44 AM in Microsoft CRM Customizations | Permalink | Comments (2) | TrackBack (0)
June 10, 2008
Embedded Grid on CRM form – including custom entities
An embedded grid is a great way to see associated records without having to navigate to the associated view. There are some drawbacks to the embedded grid such as possible speed issues and limitations of the grid itself but these are often outweighed by the advantages – especially if the items in the grid are primarily only viewed by the user.
One method of embedding a grid on a form is through the use of an iframe. This is outlined very well by Michael Hoehne on his Stunnware site, http://www.stunnware.com/crm2/topic.aspx?id=JS27
Following are a recap of the steps from that site along with an addition for placing a custom entity's associated view in the embedded grid:
1a. (Standard Entities) Obtain the tabset name of the associated view you want to include on the form. Standard entities' tabset name can be found by:
- Open the main form and click the associated entity in the navigation pane.
- Paste/Type into your web browser address bar:
javascript:alert(document.frames[1].location)
- This should open a window with a url with the tabset name. Copy that url for use later
1b. (Custom Entities) The tabset name of the associated view for custom entities is the relationship name of the associated entity. This name is created (or specified by the user) when the relationship is created between two entities. This can be found by:
- Open the main entity in customization
- Open the 1:N Relationships area (CRM 4.0) and find the related entity
- Open that relationship and the Name field (second from the top) is what you'll use in the javascript below
- Place an iframe on the parent record form and make note of the name you give the iframe. The display properties (size) of the iframe might need to be edited depending on the grid.
- Add the following javascript to the OnLoad of the form:
function GetFrameSource(tabSet) {
if (crmForm.ObjectId != null) {
var oId = crmForm.ObjectId;
var oType = crmForm.ObjectTypeCode;
var security = crmFormSubmit.crmFormSubmitSecurity.value;
return "areas.aspx?oId=" + oId + "&oType=" + oType + "&security=" + security + "&tabSet=" + tabSet;
}
else {
return "about:blank";
}
}
crmForm.all.IFRAME_salesprofile.src = GetFrameSource("new_account_salesprofile"); - The last line of the above code will be where you make the changes. The IFRAME_Invoices will be replaced with the name of your iframe (from step 2). The .src needs to be added to your iframe name. The new_account_salesprofile will be replaced with the tabset name from step 1a or 1b.
If all goes well your form will look something like:
Posted by Matt Putnam on June 10, 2008 at 12:55 PM | Permalink | Comments (11) | TrackBack (0)
Simplified filtered lookups for Microsoft CRM
Ross at http://advantageworks.blogspot.com has an interesting idea for filtered lookups in CRM 4.0. I'm frequently asked to filter lookups to make CRM more user friendly, such as filtering a contact lookup to just contacts at a selected company.
His solution is very simple, it uses simple Javasript On Load and On Change of the primary lookup to change the search parameter of the dependent lookup.
The nice thing about his solution is it is very simple code, and it does not prevent users from searching for other values. Frequently the desire to filter lookups is just desired as a convenience to the users, and there are certain scenarios where you want to still give them the option of selecting a value outside of the filter if they need to.
Check out his solution here: http://advantageworks.blogspot.com/2008/02/pseudo-filtered-lookup-dialog-in.html. The only change I made was I included the OnChange code also in the OnLoad, so that the lookup would be filtered when I opened an existing record.
If you need to have a filtered lookup that filters based on multiple criteria or that can prevent users from selecting other values, I would recommend that you consider a different solution, such as Stunnware's Filtered Lookups for MS Dynamics CRM 4.0.
Posted by Joel Lindstrom on June 10, 2008 at 06:58 AM in Microsoft CRM Customizations | Permalink | Comments (5) | TrackBack (0)
June 05, 2008
Microsoft CRM Many-To-Many Relationship Considerations
When you are planning your CRM configuration, an important consideration is whether or not to use a N:N relationship. This new relationship fills a much needed gap from Microsoft CRM 3.0; however, there are a few things to keep in mind.
- N:N relationship entities do not support adding additional attributes to the entity. For example, if you want to have an attribute classifying the type of relationship between the two entities. See An Under the Hood Look at Many to Many Relationships.
- The N:N "Add Existing Record" lookup button does not use the CRM lookup view—it limits the visible records to 100, you cannot add additional view columns, and it only supports searching by the name of the record. This is problematic in the case where, for example, there are multiple locations of the same account, each with the same account name. Since you can't search the list by other lookup criteria or browse by other columns, it makes the lookup nearly impossible. I hope that in the future Microsoft enhances this view to use the standard lookup view, or customize the lookup and view columns.
- The N:N entity that is created does not support workflow. That means that you cannot fire workflows when a new relationship is created, you also cannot use workflow to create relationships. A nice workaround to number 2 would be the ability to do an advanced find to select a number of records, and apply a workflow to create relationships at all these records; however, since you cannot create the N:N relationship records with a workflow, this is not possible.
So in a nutshell, N:N relationships in 4.0 are a good start, and are practical if every record you are relating has a unique name; however, if you need more dimensions on your relationship or have multiple records with the same name, you will want to create a "cross reference" or a "linker" entity.
For those who may not be familiar with the concept of a "cross reference" entity, here is the basic concept:
- Create a new entity. You can call it whatever makes sense, I typically use a name that indicates what it is, something like "Account Products."
- When you create the new entity, set the primary attribute to "no constraint." The name is inconsequential, and frequently we remove it from the form. Other users have used workflow to combine the two related entities in the name so it makes sense if you ever view it in the lookup field.
- Create a N:1 relationship between both entities that you want to use in your many to many relationship and your new cross reference entity. For example, in the case of Account products, I would create a N:1 relationship between new_accountproducts and Accounts, and also a N:1 relationship between new_accountproducts and Products. An important thing to consider, however, is what you want the navigation bar link to say from the various entities. In this case, for the relationship between Accounts and new_account products, we want to use a custom label for the navigation bar and call it Products and for the Product relationship we want to make the label be Accounts, so that when we're on Accounts the navigation bar doesn't say Accounts. This is a nice improvement from 3.0, where both related entites had to have the same label, and it got really confusing from time to time.
In effect, we are manually doing what CRM does automatically in the case of a N:N relationship. The end result is possibly a little bit clickier than just hitting the "add existing" button; however, we can capture more detail, and the cross reference entity is available from workflow, so I can drive events from when two records are related, and I can also use workflow to quickly relate multiple records.
Posted by Joel Lindstrom on June 05, 2008 at 10:19 AM in Microsoft CRM Customizations | Permalink | Comments (3) | TrackBack (0)
June 02, 2008
Error Communicating with CRM Server
I recently worked on an issue with a client running CRM 3.0 that received the dreaded generic "There is an error communicating with the CRM server" message when starting Outlook. The user was still able to access the CRM web client, however.
After looking at the user's record in CRM and checking the setup logs, I found that there was the following error when the CRM desktop client was re-installed a few days prior: "Setup cannot connect to the Microsoft CRM server. This might indicate that the server is down".
I did some standard connectivity stuff (ping, accessing the web client, etc) that seemed to work just fine. I did notice that the web client kept prompting for credentials even though the CRM server was added to the Local Intranet zone. On a crazy hunch (and a very vague google search result), I checked out the local Stored User Names and Passwords on the user's machine. I found an entry for the CRM server, deleted it and restarted Outlook. CRM worked just fine after that.
Although this error was on an XP machine with CRM 3.0, you might encounter the same issues on Vista and/or CRM 4.0. This by no means is the solution to every connectivity error, but it should be added to your routine CRM troubleshooting steps - it only takes about a minute to eliminate this option. Here's what to do:
Posted by Will Wilson on June 02, 2008 at 10:44 AM | Permalink | Comments (0) | TrackBack (0)




Recent Comments