"Always start with where the error is, then what the error is" I am MVP, founder and CTO at CRM-Konsulterna AB a company specializing in only Microsoft Dynamics CRM.
Tuesday, April 17, 2007
Use url-parameters in javascripts in CRM
He explains how to catch a url-parameter in the Javascript code, something I'd find very useful, especially if creating an integration with for instance SharePoint, since I can use this to control what is shown and what is not.
For instance, if you have a sharepoint integration with CRM where there is an IFRAME on the accounts showing the customer site in SharePoint, and the customer site shows the CRM account in an IFRAME also. It might be advisable to not show the IFRAME showing the sharepoint site, if it is shown in Sharepoint (=loop). Then you could use this technique to handle this.
It could also be used for shooting data into a CRM form from some other system. The URL-parameter could then be written to a specific field, it could even be saved and closed using the javascript command for that, in essence creating a very simple integration of data. Not very beautiful but still might be useful, since it is easy to create and very unobstrusive. Might be interesting if a program can't consume webservices for instance.
There are certainly a million other uses for this, so enjoy!
http://blogs.msdn.com/jonasd/archive/2007/04/16/render-hidden-values-in-tester-mode-by-using-querystring-parameters.aspx
Gustaf Westerlund
CRM and SharePoint Consultant
Humandata AB
www.humandata.se
Monday, April 16, 2007
Alternate Access Mapping in SharePoint
To be able to handle this properly, a function called Alternate Access Mapping is used. The SharePoint Technology Team blog discusses it further and describes how to set it up.
http://blogs.msdn.com/sharepoint/archive/2007/03/06/what-every-sharepoint-administrator-needs-to-know-about-alternate-access-mappings-part-1.aspx
http://blogs.msdn.com/sharepoint/archive/2007/03/19/what-every-sharepoint-administrator-needs-to-know-about-alternate-access-mappings-part-2-of-3.aspx
Since this is quite a normal setup, and there are certain aspects of this that are a bit complicated, like only having to log on once, we at Humandata are working on a best-practice for how to set this up properly that is based on the Microsoft best-practice. When we're done, I'll let you know.
Gustaf Westerlund
CRM and SharePoint Consultant
Humandata AB
www.humandata.se
Friday, April 13, 2007
New programming example of bulk import
1. Using the standard import web-GUI. It can only import to a few entities like account, lead, campaign response.
2. Using the free Migration Framework. It is a bit tricky to get it going but it can handle all system entities and relations and custom attributes, but not custom entities. Skills of SQL is more or less mandatory.
3. third party products - My favorite being Import Studio Manager 2006 professional from the Danish company Crmextensions. It supports custom entities, custom fields and relations. It uses standard ODBC to connect to a datasource and the mapping and setup can be saved for future use. Very useful for frequent imports/syncs. There are also other products, like Scribe. I havn't had the need to test them since Import Studio Manager 2006 has had all the features I needed.
4. Developing your own import program to do the gritty stuff. Without comparisson the most flexible solution but also the most timeconsuming and demanding, since it requires good skills of a .NET language like VB, C# or J#.
What Microsoft has just released is a sample of how to create you own bulk import program (using alt 4), which simplifies this a bit. Please have a look at it:
http://msdn2.microsoft.com/en-us/library/bb291036.aspx
I havn't tried it, but I would still suggest using third party products instead.
Gustaf Westerlund
CRM and SharePoint Consultant
Humandata AB
www.humandata.se
Thursday, April 05, 2007
Nice movie showing some of CRM Live
Some of the marketing guys in Redmond (technical people) are talkning and showing some of the CRM Live functionality. To make a long story short, some of the more interesting things they talked about and that could be seen in the movie are:
- Ability to "Download web service description files" into CRM. It is done from the menu where you can select import/export customizations, so I am a bit curious of what it actually means and to what degree they have created automation for web service integration.
- According to them, Windows Workflow Foundation is the workflow engine for the new version (Titan) of CRM.
- I am still a bit confused if CRM Live, that will be launched in the second half of 2007, is the CRM Titan or if it is a Suped-up version of CRM 3 and that Titan will be something more. I will get back on this. I think that it might acctually be Titan, but I am not sure, and I have not read anything definitive on the question (as far as I remember anyway)
- The Titan version will have three deployment scenarios; normal, Service Provider Edition and Live.
- According to the movie, a customization created for one deployment will work for all deployment scenarios. This is probably true for customizations created using the GUI but my experience of working with CRM 3 SPE tells me there might be differences concerning dll-versions of for instance callout-base. Hence, you might have to have different compilations of your ISV solution for each deployment. We will see later how this develops.
- It is also a bit unclear on how callout and workflow dll:s should be deployed to the Live system it the callout and workflow dll-extending functionality will still be supported in Titan. I would imagine that Microsoft Live IT-people, might be a bit restrictive to letting people run their own dll:s on their servers.
- Concerning security, the normal version of CRM will still use NTLM, the SPE edition will use Forms based authenticatio (cookie) and Live will use "Live ID" which is the new name for Microsoft Passport, I believe. When consuming web services from CRM today, there is a difference between the two versions (normal and SPE) in how you authenticate yourself to the service. Since the three are based on different security architectures, I would imagine that you would have to write three different securtiy handlers to make your ISV-solution transparent to the deployment version.
- The long awaited offline API will be released making customizations of the offline experience possible in more manners than changing the GUI and creating non-AJAX javascripts. This is great news! :)
- In the movie they are talking about the possibility to download a trial version and a VPC. I acctually think this is CRM 3 not the Titan version they are talking about. Please correct me if I am wrong.
- In general, CRM Live looks quite a lot like CRM 3 but I am curious to how the deployment of callout and workflow dll:s will be handled.
Please let me know if you have an more info, I will always write who has given me the info (if you want to of course).
Gustaf Westerlund
CRM and SharePoint Consultant
Humandata AB
www.humandata.se
Wednesday, April 04, 2007
Ease the trouble of developing callouts
Microsoft Swedens CRM expert, Jonas Deibe, has written a posting on his blog concerning how to recycle the application pools instead of resetting the IIS, which means that CRM doesn't have to be compiled just-in-time each time, saving you lots of hair, and time.
So, have a look at his posting: http://blogs.msdn.com/jonasd/archive/2007/03/28/use-build-events-to-recycle-application-pool-instead-of-iisreset.aspx
Gustaf Westerlund
CRM and SharePoint Consultant
Humandata AB
www.humandata.se
Friday, March 30, 2007
What the H*!LL is the bug? - Debugging the right way...
When you get a bug, what is the first question you ask yourself? What the H**LL is the problem?!!!! Well, that phrase actually puts the finger on it. You’re asking the wrong question! It is usually quite difficult to know WHAT the problem is when you don’t know WHERE it is. So the first question should be, WHERE the h****ll is the problem? When you know where exactly the bug is in the code, the question to WHAT the h***ll is the problem? Is usually trivial or very simple.
Might seem a bit too obvious? Think about it, and think about it the next time you're debugging, and I think you might learn to appreciate it.
Gustaf Westerlund
CRM and SharePoint Consultant
Humandata AB
www.humandata.se
New CRM SDK
http://www.microsoft.com/downloads/details.aspx?FamilyId=9C178B68-3A06-4898-BC83-BD14B74308C5&displaylang=en
Talked to my collegue Michael Jansson today and he told me he met some guys down in Malmö who said they followed my blog. Thanks guys, to know that there are some really sharp CRM and SharePoint consultants that find this blog valuable is a great compliment. If there is anything concerning CRM and SharePoint you would like me to blog about, please send me a mess and I will see what I can do. Nothing is to basic, there will always be people who are new to CRM and SharePoint, and if you're not careful, they might be way ahead of you in no time at all.
I have also seen the first screenshots from Titan (code name for the next version of CRM) and it looks really good and there seems to be some really inovative features that will boost this already great program! So, be there or be square (swe: "Var där, eller var rektangulär ;)
Gustaf Westerlund
CRM and SharePoint Consultant
Humandata AB
www.humandata.se
Monday, March 19, 2007
SharePoint & Exchange Forum 2007
If you live close to Sweden or close to Europe for that matter, make sure not to miss SharePoint and Exchange Forum 2007 in Sweden, the 14:th and 15:th of May. It is THE place to be for all SharePoint (and Exchange) professionals, decision makers, developers, administrators and powerusers. I will be the presentor for one of the tracks and I will also be holding a seminar on SharePoint and Microsoft CRM integration.There will be a host of very prominent speakers, some of these will be:
Patrick Tissegheim, SharePoint MVP & author, Belgium
Michael Noel, SharePoint MVP and expert on MS ISA, author, USA
Nick Swan, SharePoint MVP, USA
Göran Husman, SharePoint MVP & Author
Eric Legault, Outlook MVP and author, USA
Scott Schnoll, Exchange expert, Microsoft, USA
Micke Nyström, Windows Server MVP
Lasse Pettersson, Exchange MVP
Peter Andersson, Microsoft Sweden
Kalle Becker, Microsoft Sweden
Pontus Haglund, Microsoft Sweden
Magnus Danielsson, Microsoft Sweden
Christer Olsson, Exchange expert, Microsoft Sweden
Michael Jansson, SharePointexpert and trainer, Humandata
So invest in your social network and knowledge from the worlds most competent SharePoint and Exchange Experts! Not to be there is not an option...
There are a limited amount of seats so make sure you get one! Go to www.seforum.se for more information!
Gustaf Westerlund
CRM and SharePoint Consultant
Humandata AB
www.humandata.se
Thursday, March 15, 2007
Bugg found in SharePoint 3
Well, not a big problem, we thought, we'll just change it back. Well... we couldn't... so we were stuck with a "non-Title-name". Bad, really bad. The only way I found of resetting this, was to delete the entire sitecollection (I had changed the site column at the top site) and the creating a new one. Not a very nice workaround...
So, be ware, don't change the "Title" site column located in the group "_hidden".
Gustaf Westerlund
CRM and SharePoint Consultant
Humandata AB
www.humandata.se
Wednesday, March 14, 2007
Content Query Web Part
http://msdn2.microsoft.com/en-us/library/ms497457.aspx
Here is another blog posting concerning the same theme:
http://www.microsoft.com/belux/msdn/nl/community/columns/stevenvandecraen/contentquerywebpart.mspx
Gustaf Westerlund
CRM and SharePoint Consultant
Humandata AB
www.humandata.se
Monday, March 12, 2007
Different versions of MOSS
http://office.microsoft.com/search/redir.aspx?AssetID=XT102011901033&CTT=5&Origin=HA101978031033
Gustaf Westerlund
CRM and SharePoint Consultant
Humandata AB
www.humandata.se
Thursday, March 08, 2007
New CRM 3.0 Partner Preparedness Tools Available
"CRM 3.0 Partner Preparedness Tools".
Please check it out at the following site:
Jim glass blog
Gustaf Westerlund
CRM and SharePoint Consultant
Humandata AB
www.humandata.se
Wednesday, February 28, 2007
Callouts in Service Provider Edition of Microsoft CRM 3
Finally!
I got it to work, and it actually wasn't too difficult when I got hold of the correct DLL:s. So, first hot tip, right out the furnace:
"When developing for CRM Service Provider Edition, make sure you got CRM Service Provider Edition versions of your dll:s".
This can actually be a bit problematic when working in a development environment on a VPC since it is quite rare to have the entire Hosted Environment, like Hosted AD, Hosted Exchange etc on your virtal machines. If you do, great, use it, but I would guess that most of you don't.
I will give you a short walkthrough of how to create a post callout using the CRM Service Provider Edition. I will focus mainly on the differences between developing a normal callout and one for for CRM SPE.
First off, copy the file Microsoft.Crm.Platform.Callout.Base.dll from the CRM SPE CD 1 (\bin\Assembly). Put it somewhere where it is possible to add a reference to it. Like c:\temp.
Now, add a reference to it in the project.
Modify the callout.config.xml file just like you usually do, for instance:
<callout.config version="3.0" xmlns=" http://schemas.microsoft.com/crm/2006/callout/">
<callout entity="account" event="PostUpdate">
<subscription assembly="CalloutLibrary.dll" class="CalloutLibrary.AcctCallouts" />
</callout>
</callout.config>
Create a class file called AcctCallouts in the namespace CalloutLibrary and make sure the dll is called "CalloutLibrary.dll". (If you name your project CalloutLibrary, this will be default).
using System;using Microsoft.Crm.Callout;
using System;using System.Data;
using System.Net;
using System.Web;
using MSAB.CalloutLibrary.CRMSDK;
using Microsoft.Crm.Callout;
using System.Globalization;
using System.IO;
namespace CalloutLibrary
{
public class mbaktivitet: CrmCalloutBase
{
private CrmService service;
private WhoAmIRequest userRequest;
private WhoAmIResponse user;
public override void PostCreate(
CalloutUserContext userContext,
CalloutEntityContext entityContext,
string postImageEntityXml)
{
string usr = "username@test.local";
string pwd = "1m0rePassword";
string HostedCRMurl ="http://crmserver.hostingcompany.com";
service = new CrmService();
service.Url = HostedCRMurl + "/mscrmservices/2006/crmservice.asmx";
service.CookieContainer = new CookieContainer();
service.CookieContainer.Add(GetCRMCookie(HostedCRMurl, usr, pwd));
//Make sure the webservice works
userRequest = new WhoAmIRequest();
user = (WhoAmIResponse) service.Execute(userRequest);
}
}
}
The important call here is the GetCRMCookie(HostedCRMurl, usr, pwd), a method that I will describe bellow which returns an authentication cookie that can be used to authenticate against the web service. Here is its definition, it is more or less what Arash has written on his blog concerning how to write web services for CRM SPE.
public Cookie GetCRMCookie(string url, string userName, string password)
{
DebugText("Start of GetCRMCookie");
Cookie authCookie;
try
{
Uri serverUri = new Uri(url);
Uri logonServerUri = new Uri(serverUri, @"LogonServer/Logon.aspx");
string encodedUserName = HttpUtility.UrlEncode(userName);
string encodedPassword = HttpUtility.UrlEncode(password);
string logonServerUrl = String.Format(CultureInfo.InvariantCulture, "{0}?UserName={1}&Password={2}", logonServerUri.ToString(), encodedUserName, encodedPassword);
// Make a web request that does not allow redirection
HttpWebRequest logonRequest = (HttpWebRequest)WebRequest.Create(logonServerUrl);
logonRequest.AllowAutoRedirect = false;
logonRequest.CookieContainer = new CookieContainer();
HttpWebResponse logonResponse = (HttpWebResponse)logonRequest.GetResponse();
authCookie = null;
using (logonResponse)
{
if (HttpStatusCode.Found != logonResponse.StatusCode)
{
// throw new CrmException(logonServerUrl, ErrorCodes.InvalidOperation);
}
if (null == (authCookie = logonResponse.Cookies["CRMAuthCookie"]))
{
// throw new CrmException(logonServerUrl, ErrorCodes.InvalidOperation);
}
}
// Now we have the cookie, make sure the credential is valid by passing the cookie back to CRM
logonRequest = (HttpWebRequest)WebRequest.Create(serverUri);
// The following user agent is required by CRM
logonRequest.UserAgent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2)";
logonRequest.AllowAutoRedirect = false;
logonRequest.CookieContainer = new CookieContainer();
logonRequest.CookieContainer.Add(authCookie);
logonResponse = (HttpWebResponse)logonRequest.GetResponse();
using (logonResponse)
{
if (HttpStatusCode.OK != logonResponse.StatusCode)
{
throw new InvalidOperationException(logonServerUrl);
}
}
return (authCookie);
}
catch (Exception err)
{
return null;
}
}
That’s about it. Using this technique, you should be able to get your SPE Callouts to work.
Make sure that the callout.base is exists in the servers GAC, if not, copy it there.
Note that post-callouts, won’t break the execution if there is an error but they will leave the error exception sprecification in the eventlog so make sure you have a look at it.
So, in short, there are two main differences when developing callouts that use web services when comparing normal CRM with SPE CRM, they are:
- DLL:s are unique. The version number for SPE is 3.0.5745.0 while the version for the normal CRM is: 3.0.5300.0.
- To authenticate, you cannot use the normal System.Net.CredentialCache.DefaultCredentials but, you have to use the “slightly” more complicated method of capturing the authentication cookie and using it to log in.
As you might have noticed in the code, the user is hard-coded, which means that there will not be any impersonation in the way it works in normal CRM. I have an idea of how this might be solved; by creating a new aspx-page to capture the username and password, creating a cookie using these credentials and then storing it in the session variable to enable further loggin in later with the webservice. One would also have to make sure that the cookie can be used by the normal IE klient as well. As you might understand, there are some question marks here that I will try to straighten out. If I find a solution to impersonation in CRM SPE, I will be sure to create a post about it!
Gustaf Westerlund
CRM and SharePoint Consultant
Humandata AB
www.humandata.se
Tuesday, February 27, 2007
Service Provider Edition / Hosted CRM
I am developing callouts and will write some more about what the differences are, for now I will leave you with a reference to a blog that actually mentiones something about this.
For one, there is a different version of Microsoft.Crm.Platform.Callout.Base.dll and there is a different way of authenticating when using the webservice. I will write I bit more about it later.
Have a look at this blog for now: Microsoft.Crm.Platform.Callout.Base.dll
http://crm.davidyack.com/journal/2006/7/21/callouts-and-the-service-provider-edition.html
Gustaf Westerlund
CRM and SharePoint Consultant
Humandata AB
www.humandata.se
Import of customizations not working in IE 7
http://blog.sonomapartners.com/2007/01/importing_custo.html
Gustaf Westerlund
CRM and SharePoint Consultant
Humandata AB
www.humandata.se
Wednesday, February 21, 2007
How to create many-to-many relationships in CRM
http://blogs.msdn.com/crm/archive/2007/02/15/many-to-many-relationships-in-ms-dynamics-crm-3-0.aspx
Gustaf Westerlund
CRM and SharePoint Consultant
Humandata AB
www.humandata.se
CRM Analytics foundation
http://www.codeplex.com/crmanalytics
Gustaf Westerlund
CRM and SharePoint Consultant
Humandata AB
www.humandata.se
Monday, February 19, 2007
MOSS and CRM Webparts
Please click this posts heading to go to the posting I found.
Gustaf Westerlund
CRM and SharePoint Consultant
Humandata AB
www.humandata.se
IFrame security problems
I had some problems with the dymanic functionalities of the report, which didn't work. After some work, I found that it was due to the fact that the Reporting Server had the wrong security settings in IE, and hence was prohibited to fully use the JavaScripts that controlled the drill-down of the reports. The simple solution was to add the reporting server to Local Intranet Sites in IE.
Gustaf Westerlund
CRM and SharePoint Consultant
Humandata AB
www.humandata.se
Monday, February 05, 2007
How to create .NET-class files from xsd files
To some of you, this might be yesterday’s news, but for those of you who havn't tried it, you should.
I will try to explain how to do it here. In this example, we'll be basing the .NET class on a InfoPath form. InfoPath is, as you might know, just a front-end to XML, ie. a user friendly way of creating xml-data.
Create you xml-form in any way you like. I won't go into how exactly you do that, but
That will create a schema in the background. To export it to an xsd-file, select “Save as source files…” from the file menu and direct it to a directory of your choice, for instance, “c:\temp”.
Use the file explorer, go to the directory where you just saved the files, and you will find a file with the name of your different data sources followed by the extension “.xsd” in this directory. Remember the name of the xsd-file, let’s call it “source.xsd” in this example.
Then, start up a “Visual Studio 2005 Command Prompt”, go to the directory where you saved the source files, for instance:
cd c:\temp
Then, using the command xsd you can create the cs-file containing the .NET-class with the following command:
xsd source.xsd /c
This will create a new file called “source.cs”. This is the file that contains the .NET class.
Now open your development project and add the file source.cs to the project. This will now give you access to the .NET class in you project. Open the file and you can see the name of your class, it should be “myFields”.
Now we want to instantiate the class with some xml-data. This is done in the following manner using c#-code.
XmlSerializer serializer = new XmlSerializer(typeof(myFields));
XmlTextReader reader = new XmlTextReader(“c:\XmlInstanceOfSourceXsd.xml”);
myFields fields = (myFields)serializer.Deserialize(reader);
Now, you can access the xml-data using the instance fields of the class myFields.
Gustaf Westerlund
CRM and SharePoint Consultant
Humandata AB
www.humandata.se