Knowledge found and lost while working with Microsoft Dynamics CRM
RSS icon Home icon
  • Error message when you try to save a record in Microsoft Dynamics CRM 4.0: "Object reference not set to an instance of an object"

    Posted on January 27th, 2010 Mitch Milam Print Print 1 comment

    http://support.microsoft.com/kb/954018

    I ran into this issue again this week and since it had been so long since I had seen it, it took me a while to remember the solution- which I thought I’d share with you know.

    Problem

    You receive the following message when attempting to save a record:

    Object reference not set to an instance of an object.

     

    Cause

    This problem occurs because a money attribute is created for the entity. When you do this, Microsoft Dynamics CRM 4.0 creates an exchangerate attribute to work together with the money attribute. The money attribute is published as part of the entity.

    However, if you delete the money attribute, the exchangerate attribute is not removed. Therefore, when you try to run a Microsoft Dynamics CRM plug-in, the plug-in can find the exchangerate attribute. However, the plug-in cannot find the money attribute

     

    Solution

    Create a new money attribute on the entity.  This attribute will remain unused and does not need to be on the form.

     

    Comments

    Seeing this error is rare.  It occurred in my instance because another developer originally added a field as a money type then realized it wasn’t actually money, it was a float type.  He deleted and recreated the attribute which inadvertently create the problem.

    Dynamics CRM
    1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 5.00 out of 5)
    Loading ... Loading ...
    738 views
  • Using CRM workflow to overcome laziness, I mean, become more efficient

    Posted on January 22nd, 2010 Mitch Milam Print Print 2 comments

    CRM workflow can be used for all sorts of interesting things and can sometimes help you do your job in a surprising number of ways.

    Let’s take the following example as a “surprising” way.  I have entered some sample data, but after I entered the data, I realize that I really didn’t make most of the records verbose enough to be useful, as you can see from the following screen shot:

    image

    I now have two choices: Edit by hand all of the single-word records or come up with some fancy bulk editing technique to get the work done for me.

    Let’s go with option number two and see where we end up.

    What Won’t Work

    I can’t use the bulk edit feature because I want all of my records to be different.

    I also don’t want to edit them by hand, as mentioned above.

    Finally, I don’t want to write any code because that would be a real waste of my time.

    How about a Workflow?

    Have you ever considered using workflows for editing?  No?  Well then, let’s give it a shot.

    Step 1: Create the workflow

    This is pretty basic workflow at this point.  We have given the workflow a name and selected the entity, which is a custom entity called News.

    We’re using CRM Online so the Scope defaults to Organization.

    Finally, we will be executing this workflow manually so we want to clear all of the check boxes except for On demand.

    image

    Step 2: Add a workflow step

    Now we need to add an Update step to our workflow.  In this step, we will be updating both the Headline attribute and the Body attribute, as you can see below:

    image

    If you look closely at what we’re updating we are adding new text into each field then we are adding the field to itself.  Huh?  Will that work?  You bet.

    Here is what is happening ( using the Headline attribute as an example ).  We are actually performing the following calculation:

    “This is important news headline number “

    +

    [the existing contents of Headline]

    Which results in something like:

    This is important news headline number one.

    We then perform a similar calculation on the Body attribute.

    After publishing our workflow, we can put it to use.

    Step 3: Executing the workflow

    After returning to our News View, we need to select all of the News records that need to be updated.  When you click run workflow button, the following dialog will appear:

    image

    You need to click OK to select the workflow then OK again to run actually it.

    Step 4: Viewing our results

    After waiting a short amount of time for the workflows to execute, we can then refresh the News view and see the results of our handiwork:

    image

    Is that not cool or what?

    Conclusion

    So what did you think?  Does that open up your eyes a little as to the possibility of using workflow to edit data?

    And how long did it take?  Less than two minutes. And that is with me taking screen shots and pasting them into Windows Live Writer so I could write this article.  Since it was only two fields, I could have actually done the whole thing in less than a minute if I was really trying.

    Good luck with your own workflow efforts.

    Dynamics CRM, Workflow
    1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 5.00 out of 5)
    Loading ... Loading ...
    743 views
  • New survey posted: What CRM feature interests you the most?

    Posted on January 21st, 2010 Mitch Milam Print Print 6 comments

    Since it’s the beginning of a new year, I thought I would again check to see what people are interested in this year.

    If you have a minute, I’d love to hear what you have to say.

    The survey is located on the upper-right side of this blog.

    Thanks, Mitch

    Dynamics CRM
    1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
    Loading ... Loading ...
    2,439 views
  • Useful Tools for Working with Windows Azure Storage

    Posted on January 21st, 2010 Mitch Milam Print Print 1 comment

    I wanted to make quick note of two tools that I’ve found invaluable during my recent development efforts.

    Cloudberry Explorer for Windows Azure Blob Storage

    Allows you to manage your Windows Azure blob storage using a Windows Explorer-like interface:

    It’s very useful should you wish to create blob containers or quickly move large files from your file system to Windows Azure.

     

    Windows Azure Management Tool (MMC)

    This is an Windows MMC snap-in that allows you to manage both Windows Azure Blobs and Queues.

    WindowsAzureMMC3.png

    This tool is indispensible for creating and monitoring Azure Queues.

    Azure, Development
    1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 5.00 out of 5)
    Loading ... Loading ...
    636 views
  • Working with Azure Queues: Learning things the hard way.

    Posted on January 20th, 2010 Mitch Milam Print Print No comments

    There are times when I do something so stupid that I feel the need to share with everyone, just to reinforce the point that I don’t need to do it again. :) 

    Today would be one of those days.  Here is what I did:

    I was working on my new web site which uses a Windows Azure Queue as a Message Processing System.  Basically I drop a specifically formatted string into a queue and a Azure Worker Role retrieves the message and processes it based on the contents.

    I was adding a new message type today it it wasn’t being processed.  Not because the message wasn’t being decoded properly, because the message was never being seen.

    What the heck, over?  It’s worked for the past two weeks, what would make the messages just disappear from the queue or maybe not be added?

    Well, after wasting about 30 minutes tracing the message through the system, I realized what I was doing wrong ( and where the stupid part comes in ).

    Since my site is still under development I haven’t broken the internal mechanisms into Development and Production versions.  I do, however, have Development and Staging version of my application running on Azure.

    And that was the problem.

    I was running my site locally but pointing to the Cloud instances of my storage.  Every time I placed a message in my queue, either the Production instance or the Staging instance would see the new message and process it.  The last part of processing involves deleting the message from the queue.

    Since two other instances of my site were running, by the time my local instance woke up to look at the queue contents, one of the other instances had already processed it.  This made me think things were not working.

    Anyway, note to self: Make sure the instance of the application you are working on is in sole control of any assets required to properly build and test it

    Azure, Development
    1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
    Loading ... Loading ...
    376 views
  • CWR Mobility Ships Clients for Microsoft Dynamics CRM for BlackBerry, iPhone and Windows Mobile

    Posted on January 20th, 2010 Mitch Milam Print Print No comments

    CWR Mobility has released version 4.2 of its flagship product CWR Mobile CRM which includes a native mobile CRM client for BlackBerry and iPhone.

    Read the full article here.

    Dynamics CRM, Mobile
    1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
    Loading ... Loading ...
    528 views
  • Using Workflow to Create Marketing Lists

    Posted on January 19th, 2010 Mitch Milam Print Print 4 comments

    One of the more obscure facts when working with the CRM 4.0 workflow engine is the ability to actually create a marketing list.  Actually, you can create records for almost any entity, but I always found it interesting that Marketing Lists were on that list.

    So why would this be useful and how would you use it?

    That’s the question I have been asking myself for quite some time and to be quite honest, I really didn’t have an answer until a couple of weeks ago.  Here’s what I’m doing:

    The Scenario

    I am starting a new venture which involves providing Internet-based training for CRM users.  The training will be broken down into courses and lessons – pretty standard stuff.

    I decided that I would like to have a marketing list for each course so that I could communicate with each person who had purchased the course.

    The Solution

    Create a workflow that will automatically create the Marketing List when a new Course is created.  Here’s what the main workflow screen looks like:

    image

    The workflow needs to fire when the Course is created.  I also added On demand so that I could start the workflow manually.

    There is only one workflow step involved, which is the actual creation of the Marketing List record, and I’ve supplied the following fields:

    image

    The name is the Title from the Course.  The Member Type is Contact, since all of my users are Contacts. And finally, the Purpose is just a summary of reason for the Marketing List exists.

    Conclusion

    While it has always been easy to create new records using CRM workflow, I think the use of automatically created Marketing Lists is pretty unique and I hope this inspires you to rethink the use of CRM workflows.

    Finally, you are probably wondering how members of the Marketing List are maintained.  This is pretty simple: When you purchase a course, the code-behind the web site automatically adds you to the Marketing List for the specified course. This means there is zero used-intervention in this entire process.

    Dynamics CRM, Workflow
    1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
    Loading ... Loading ...
    941 views
  • New CRM case study released: Access MediQuip

    Posted on January 18th, 2010 Mitch Milam Print Print No comments

    One of my customers is the subject of a new Microsoft case study which describes how the implementation of Microsoft Dynamics CRM has benefited their company.

    I’ve been working with them for almost a year and the amount of “cool stuff” we’ve implemented within Dynamics CRM to help them improve their business is immense and the case study barely scratches the surface.

    You can find the case study here:

    http://www.microsoft.com/casestudies/Case_Study_Detail.aspx?casestudyid=4000006368

    Dynamics CRM
    1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
    Loading ... Loading ...
    433 views
  • New CRM Case Studies

    Posted on January 13th, 2010 Mitch Milam Print Print No comments

    Girish Raja has pointed out several CRM/xRM-related case studies that you may find interesting:

    xRM ISV Case Study: CSSI

    xRM ISV Case Study: Spenta

    xRM ISV Case Study: Peak 15 Systems

    xRM ISV Case Study: Client Profiles

    Dynamics CRM
    1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
    Loading ... Loading ...
    395 views
  • Working with Windows Azure Queues

    Posted on January 12th, 2010 Mitch Milam Print Print No comments

    Since Windows Azure was only officially released in the past month, you may find a lot of the prior examples do not work because of changes made between the CTP versions and the production version. The StorageClient sample included in the Windows Azure SDK is no exception.

    There are many issues you’ll face getting this working, but the first involves recompiling the StorageClient assembly using the production-level Windows Azure references.

    This article walks you through what’s required to make that happen.

     

    Connecting to Your Production Queues

    One of the biggest problems I faced was actually connecting to the production queues on my Windows Azure Storage instance.  After spending quite a bit of time troubleshooting and browsing the Internet, I realized that StorageClient was looking for the storage endpoints, which you place in your configuration file, in a very specific format. 

    Within your ServiceConfiguration.cscfg file, your role configuration should look something like this:

    <Role name="WorkerRole">
      <Instances count="1" />
      <ConfigurationSettings>
        <Setting name="AccountName" value="myaccountname" />
        <Setting name="AccountSharedKey" value="secretkey" />
        <Setting name="TableStorageEndpoint" value="http://table.core.windows.net/" />
        <Setting name="QueueStorageEndpoint" value="http://queue.core.windows.net/" />
      </ConfigurationSettings>
    </Role>
    

    All you really need to change is the AccountName and AccountSharedKey settings. 

    If you look at your Windows Azure management console, the AccountName is the name of your account as represented in the storage URL ( basically the first word after the http:// ). 

    Note: I’ve not seen documentation on this, but it appears the only accepted format is all lower-case.

    The AccountSharedKey is the Primary Access Key for the storage account.

    The TableStorageEndpoint and QueueStorageEndpoint are the base URLs for your services.  The StorageClient will actually prepend your account name to the base URL to create the proper endpoint.

     

    Connecting to Your Local Development Queues

    It appears that you connect to your local development queue using the following configuration:

    <Role name="WorkerRole">
      <Instances count="1" />
      <ConfigurationSettings>
        <Setting name="AccountName" value="devstoreaccount1" />
        <Setting name="AccountSharedKey" value="Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==" />
        <Setting name="TableStorageEndpoint" value="http://127.0.0.1:10002" />
        <Setting name="QueueStorageEndpoint" value="http://127.0.0.1:10001" />
      </ConfigurationSettings>
    </Role>
    

     

    Final Notes

    I also found the Windows Azure Management Tool (MMC) to be of great assistance when needing to work with Queues.  It also has Blob support, but I’ve been using CloudBerry Explorer for Azure Blob Storage for uploading blobs.

    Azure, Development
    1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
    Loading ... Loading ...
    678 views