August 11, 2008

A great CRM 4.0 Book

It's finally published!  I want to recommend a book that I recently got to help edit.  It's called "CRM as a Rapid Development Platform" and is authored by David Yack.

David put a lot into this book and it really is great at explaining and giving how to's on some of the more advanced topics of CRM.  It not only covers the CRM platform fairly well but also covers writing of Plug-ins and Workflow for the extention of CRM.

One of my personal favorites of the this book is the code samples that you have access to when you buy it.  They include some pretty robust libraries that can be used to jump start your development.  There is a javascript library that helps make calls back to the CRM web services much easier from the CRM page scripts as well as several other things you would commonly do in the page scripts.  There are also .Net libraries to help with the development of Plug-ins and Workflows and to allow testing of them outside of the CRM environment.  There is even a section of code that shows how to write silverlight pages that can be used in CRM as well.  And that is only some of what you will find in the code.

Now for the good part, since I helped with the editting of this book, I was given discount codes to share for buying it.  You can get it in print or ebook form and the discount code will save you $10 off the price.  I was told that the codes are only good for the first 20 buyers.  The site for buying the book is http://thecrmbook.com/.

The Print copy discount code is CATHYBLOG.

The Ebook discount code is CATHYBLOGEBOOK.

I would love to hear the opinion of anyone that buys the book.  Happy reading :)

April 22, 2008

VS 2008 Server Explorer won't open

I was working on a linq project and needed to connect to my database to make some changes in the linq to sql when I realized that my server explorer windlow would not open.  I clicked view - server explorer and just got nothing, zip, nada.  After some headaches and some hunting in other blogs I found this little VS command line command that solved the problem.

devenv /resetsettings

I read several blogs about it and the general idea is that if you had a previous version of VS installed and uninstalled it to install a newer version that the settings get messed up.  This command sets your setting back to the default out of the box settings.  So if you're having problems that seem to be dev environment instead of your code, you might want to give this a try.

March 28, 2008

CRM 4.0 Recurrence Pattern for Asynchronous Job Execution

Today I was working on a method to create a scheduled async job for CRM 4.0.  I needed to allow the calling method to pass in the frequency of how often to run this job and I wanted to allow for running only once.  I found a few sites, including Microsoft's that made reference to a way to make an async job run only once, but noone said how.  The frequency property is required on the call and it only has values that I could find such as hourly, daily, weekly and such. 

To make a long story short.  I found another optional property on the rrule called Count.  So.... I set the frequency to Hourly and the count to 1 and I got the desired affect.  Hope this helps someone :)

March 18, 2008

Silverlight 2 Databinding ParserException

I recently ran into a problem trying to bind a string value to a HyperlinkButton's NavigateUri property that I had placed in the CellTemplate of an DataGrid. It would throw a ParserException error and fail to render the page. 

After a bit of trial and error I realized it was a type mis-match.  The HyperlinkButton's NavigateUri property is of type Uri and I was trying to bind a string value to it.  I changed the value in my Data Source to be a type Uri (got with a Linq query) and magicaly the code is happy again.

I hope this post helps someone else with this problem. 

January 08, 2008

VS 2008 and Workflow

I have been working with workflow in VS2008 quite a bit lately and I decided to try something new.  There is a new sequential workflow type described as 'Sequential Workflow with definition expressed as Xaml and user code in a separate code file'.  I found out that if you use this type, you have to write some extra code when creating rules or the the workflow will not compile.  Your rules should look something like this.

((FullyQualifiedActivityTypeName)this.GetActivityByName("ActivityInstanceName")).PropertyName > 0

Also, I had some problems with Xaml file not keeping in sync with changes made to the activities.  For example, if I desided to add a new property to an activity that was already on a workflow, the workflow would not pick up the new property.  This problem remained even after I did a clean and rebuild.  In the end. I closed down the environment, manually editted the .xoml file for the workflow an re-openned VS 2008 to solve the problem. 

I would love to hear from others that have had simular issues and what resolutions you have found.

November 05, 2007

CRM Custom Web Page

This post is for those of you that are starting to build custom web pages for integration with CRM.  I spent a bit of time trying to figure out why one of my pages ran very well outside of CRM, but when I ran it under the CRM service it started acting very strange.  At first I thought it might be due to the ajax that I had on the page, which it wasn't, but that reminds me to tell you that if you use ajax, or other script on the page, you need to set the property to allow scripts to run when you setup the iframe in crm to run the page in. Anyway, my flakey page problem was very simple, even though it took me a while to find it.  The CRM site was not configured for ViewState.  I enabled the view state at the page level on my page and all is good again. :)

XmlTextWriter Formating

I was recent faced with writing code to generate an xml file to be sent to an other company that automaticly processes it.  No big deal, I thought, just use the XmlTextWriter, flip through my data and generate the file.  All well and good.  Then the other company came back and said they couldn't handle the xml being all on one line, they needed a new line for each tag.  So after a bit of research I found that the XmlTextWriter has some formatting properties that can be used to create indenting, new lines and such.  The code I used is this.

            //initialize the Xml Text Writer
            XmlOutput = new XmlTextWriter(m_memStream, Encoding.UTF8);
            XmlOutput.Formatting = Formatting.Indented;
            XmlOutput.Indentation = 0;
            XmlOutput.IndentChar = '\n';

The one thing I want to note is that in the examples I saw, the Indentation property was used to say how many IndentChar that you want, for example, 5 spaces.  So, I set this to 1 thinking that I would get one new line character, but for some reason, I got 3 or 4 new lines.  Moral of the story is, if you are using the Indentation format for the XmlTextWriter and you are trying to get a new line, set the Indentaion property to zero.

October 11, 2007

VS 2008 Beta 2 and Ajax 1.0 - Workaround

While using the VS 2008 Beta 2 Multitargeting support feature to develope websites targeting the 3.0 framework, I ran into a problem with Ajax 1.0 and the AjaxControlToolkit.  When trying to add a refernce to the AjaxControlToolkit, I got an error message that stated the framework version required by the assembly or one of it's dependencies was higher then the project target framework version.  After some research, I found a blog with a workaround for the problem.  I have posted the link below.  Make sure to read the side affects to the work around before using it.

http://blogs.msdn.com/webdevtools/archive/2007/07/30/using-vs-2008-to-target-asp-net-ajax-1-0.aspx

September 20, 2007

.Net Framework 3.5 and AjaxControlToolkit

After recently converting a web app to the 3.5 framework, I found that the pages that used the AjaxControlToolkit no longer worked.  With a little research, I found that there is a new release of the toolkit that needs to be used with 3.5 apps.  You can download the assembly by going to the following web page and selecting the link that reads "AjaxControlToolkit-Framework3.5.zip". Happy coding :)

http://www.codeplex.com/AtlasControlToolkit/Release/ProjectReleases.aspx?ReleaseId=4923

September 13, 2007

Ajax History Control

Hey All,  I just ran across an ajax control I hadn't seen before.  It's a history control.  The basics of it is that you use it to track steps made in the progression of a page with partial postbacks.  Like paging in a grid for example.  Then the control allows you to logicly go back a step in the partial postbacks when the user presses the back button.  Sounds cool, can't wait to try it.  Here is the url for the rest of you to give it a gander.  http://asp.net/learn/ajax-videos/video-149.aspx