Knowledge found and lost while working with Microsoft Dynamics CRM
RSS icon Home icon
  • Working with Currencies, Revisited

    Posted on June 13th, 2009 mitch Print Print No comments

    In a previous article, I reviewed an error I was receiving when performing some JavaScript calculations on a CRM form.  I ran into the same error message this week, but under different circumstances.

    The user was receiving the following error message when opening a record of a custom entity we created:

    image

    Hmm, I thought to myself, I’ve seen this before.

    It turns out that I was creating this record via a plug-in and had forgotten to include the transactioncurrencyid in the record.

    Remember: You must always include the transactioncurrencyid attribute on any record you create if there is a money attribute contained anywhere within the entity.

    How do you know you have a problem with the record?  Instead of your money fields looking like this:

    image

    They look like this:

    image

    Notice the lack of a currency symbol to the left of the edit box?

    The only way to correct such a record is to add the transactioncurrencyid attribute to the form and change the value on the form, and either use JavaScript to add the currency or have the user set it manually.

    Again, the above statement applies to records that have been created programmatically. Records created manually should have the transactioncurrencyid populated automatically.

    So, to keep from having issues, just add the transactioncurrencyid attribute to your list of attributes that are created.

    Here is a method in C# that will pull back the information for the US Dollar:

    public static transactioncurrency GetCurrency(ICrmService crmService)
    {
        // Build a query for US Dollar currency.
        QueryByAttribute dollarQuery = new QueryByAttribute();
        dollarQuery.EntityName = EntityName.transactioncurrency.ToString();
        dollarQuery.Attributes = new string[] { "currencyname" };
        dollarQuery.Values = new string[] { "US Dollar" };
        dollarQuery.ColumnSet = new AllColumns();
    
        // Create the US currency request.
        RetrieveMultipleRequest dollarRequest =
            new RetrieveMultipleRequest();
    
        dollarRequest.Query = dollarQuery;
    
        RetrieveMultipleResponse dollarResponse =
            (RetrieveMultipleResponse)crmService.Execute(dollarRequest);
    
        return (transactioncurrency)dollarResponse.BusinessEntityCollection.BusinessEntities[0];
    }

    which is used like this:

    transactioncurrency usCurrency = GetCurrency(crmService);
    
    myEntity["transactioncurrencyid"] =
        new Lookup(EntityName.transactioncurrency.ToString(),
                   usCurrency.transactioncurrencyid.Value);

    The above assumes you’re working with Dynamic Entities inside the CRM plug-in framework.

    Misc
    1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
    Loading ... Loading ...
    95 views
  • test2

    Posted on April 27th, 2009 mitch Print Print 1 comment
    Misc
    1 Star2 Stars3 Stars4 Stars5 Stars (2 votes, average: 5.00 out of 5)
    Loading ... Loading ...
    225 views
  • New Poll Added: Do you think on-line video training is worthwhile?

    Posted on April 9th, 2009 mitch Print Print 3 comments

    I am curious what you think about on-line video training.  What I am describing is viewing a “screen cast” of a procedure, step, or process as a user is performing it.

    I am curious if you find that more valuable than standard documentation.

    Misc
    1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
    Loading ... Loading ...
    307 views
  • Off Topic: CRM Find of the Day

    Posted on April 8th, 2009 mitch Print Print 1 comment

     

    So I’m wandering around a custom CRM entity’s form this morning looking for ways to improve the user experience on one of the associated Entities, which is linked to the parent via a N:N relationship.

    On the More Actions menu button on the associated entity grid, there is a Remove option.  Here is the ID for that that menu item ( dashes were added by me for formatting purposes):

    _MIdoActionExcrmGrid10012topcrmFormSubmitcrmFormSubmitId-valuedisassociatetopcrmFormSubmitcrmFormSubmitObjectType-valuetabareaaccproducttypetohcpcscodeassociationNameaccproducttype-tohcpcscoderoleOrd1

    Microsoft word tells me there are 197 characters in that name.  Holy cow Batman.  That’s a long name for an ID.

    Misc
    1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
    Loading ... Loading ...
    488 views
  • Headed to the 2009 MVP Summit

    Posted on March 1st, 2009 mitch Print Print No comments

    One of the coolest benefits of being an MVP is the annual MVP Summit, which starts today in Seattle.

    Last year we had an absolute blast and while some of the CRM MVP's couldn't get the Summit into their schedules this year because Convergence starts on the 9th, there will be a bunch of new CRM MVP faces in the crowd so we should again have a great time, meet great people, and learn a whole bunch of new things.

    Our patron and guardian angel, Jim Glass, already has our quality time with the CRM Product Teams scheduled so we'll be well taken care of, as always.

    Anyway, even though it's now March, I consider the MVP Summit one of the highlights of the year and a great way to start off 2009.

    So, for those of you in Seattle at the Summit or on Campus, I hope to see you this week some time.  Otherwise, look for me at the Microsoft booth or community lounge at Convergence in New Orleans next week.

    Have a great week.

    Misc
    1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
    Loading ... Loading ...
    246 views
  • MVP Renewed

    Posted on January 1st, 2009 mitch Print Print 2 comments

    Happy New Year everyone.

    I just received the email confirming that I am an MVP for Dynamics CRM for 2009.

    This is the third year I've received the MVP award and it is still one of the greatest accomplishments of my career.

    To top that off, I find myself in the most excellent of company, in the other CRM MVPs.

    Misc
    1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
    Loading ... Loading ...
    529 views
  • Happy Thanksgiving

    Posted on November 27th, 2008 mitch Print Print No comments

    For those of us here in the U.S., today is our Thanksgiving holiday.  It's a really good excuse to eat a lot of turkey and otherwise hang out with family and friends.

    I wish all of you a happy and safe holiday.  For those of you not in the States, have a great weekend.

    Misc
    1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
    Loading ... Loading ...
    445 views
  • Progress message of the day

    Posted on September 29th, 2008 mitch Print Print 1 comment

    My main workstation is running Vista and lately I've been having disk-related issues that I am having a hard time tracking down.

    While copying one of the Microsoft CRM VM file sets to another computer this afternoon, I encountered the following message:

     

    image

     

    Hmm. I am not totally sure, but I would bet that waiting another 56 years for this copy to finish is pushing my expectations just a little.

    Misc
    1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
    Loading ... Loading ...
    742 views
  • Happy weekend everyone

    Posted on September 26th, 2008 mitch Print Print No comments

    It's been a while since I posted anything of relevance so I wanted to say hi to everyone and let you know I'm still alive and kicking and to wish everyone a happy weekend.

    I've been heads-down in about three separate CRM or CRM-related projects and haven't had time to write anything new – but I do have things coming.

    Being so CRM focused sometimes leaves me out of the loop when it comes to other, development-related matters.  Case in point: Just this morning, I was looking at the Visual Studio start page and I see this article:

    How Do I: Create a Basic Language Service Using the Managed Babel System?

    Which, as everyone knows, is about this:

    Create a basic language service by using the Managed Babel System infrastructure provided in the Visual Studio 2008 Software Development Kit (SDK). Incorporate the syntax for your language using the Managed Package Lex Scanner Generator (MPLex) and Managed Package Parser Generator (MPPG) tools and set up and register your language service into the Visual Studio environment. Hilton Giesenow demonstrates how.

    Huh?

    I think I'll crawl back into my CRM cave and worry about managing my Babel at some point in the future…

    Peace out.

    Development, Misc
    1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
    Loading ... Loading ...
    643 views
  • Stupid web site design

    Posted on July 28th, 2008 mitch Print Print No comments

    I am a huge music fan and watch a lot of videos, from many categories and country music is one of my favorites.  That means I watch CMT a lot – and visit CMT.com quite frequently.

    Unfortunately, whoever is in charge of their web design is smoking crack – or something….

    Take a look at this page:

    image

    As a consumer, I am mostly thinking that I'd like to see music videos, when I click on the "music video" page.  The above is what I get.

    To make things even more confusing, the pictures you see are mostly related to nothing regarding the actual people in the pictures.  These are categories – not actual individual music videos. 

    Which is the whole point to me wasting your time.

    If you can't show people what they are actually going to get when they click on a link, or a picture, then why the heck are you even showing it to us?  To make matters even worse, even some of their pictures and other links don't actually take you to the song or video in question. They take you to a general "artist" page where you get to select the link yet again…

    Note to self, Mr./Ms. Web Designer: Bad thing.  Don't do it.

    Show people what they expect. Deliver on that expectation, and I think most people will be happy.

    PS. The previous site design actually showed music videos on this page…

    Misc
    1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
    Loading ... Loading ...
    818 views