Knowledge found and lost while working with Microsoft Dynamics CRM
RSS icon Home icon
  • Bulk Attribute Deletion Utility Updated

    Posted on July 28th, 2010 Mitch Milam Print Print 1 comment

    I’ve modified the Bulk Attribute Deletion Utility to support Internet Facing Deployment ( IFD ) for CRM 4.0.

    Download it here.

    Thanks to my friend George Doubinski I was able to connect to a CRM installation via IFD for testing.

    Please let me know if you run into any issues.

    Customization, Development, Dynamics CRM
    1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
    Loading ... Loading ...
    235 views
  • Exception handling when working with the CRM Web Services

    Posted on July 26th, 2010 Mitch Milam Print Print 2 comments

    I just ran into something that I have never seen before related to a SoapException:

    I was updating my Export JavaScript utility when I received an error message that was blank.  Very odd, I thought.  After a bit of digging, I found the error:

    Server was unable to process request.
    —> Exception has been thrown by the target of an invocation.
    —> The type initializer for 'Microsoft.Crm.WebServices.CrmAuthenticationSoapExtensionBase' threw an exception.
    —> The server is not operational.

    Now at this point, I really don’t know what happened, but my development CRM 4.0 server was in some type of non-functional state that required me to perform an IISRESET to recover from.  That is not the interesting thing here today.

    The interesting thing is where the error message was found.  Here is an example the code that normally use to detect an error when using the CRM Web Service:

    catch (SoapException ex)
    {
        MessageBox.Show(ex.Detail.InnerText,
                        Properties.Resources.MSG_AN_ERROR_HAS_OCCURRED,
                        MessageBoxButtons.OK,
                        MessageBoxIcon.Error);
    }

    Usually, the actual error message is found in the SoapException.Detail property and you can access it via the InnerText or InnerXml properties, depending on how you wish to handle it.

    Today, the error message was actually in the SoapException.Message property, which I find very odd.  As I said, I’ve never seen this before so I don’t know what happened, but in order to prevent a blank error message from appearing to the user, I created the following work around:

    catch (SoapException ex)
    {
        string errorMessage = ex.Detail.InnerText;
    
        if (string.IsNullOrEmpty(errorMessage))
        {
            errorMessage = ex.Message;
        }
    
        MessageBox.Show(errorMessage,
                        Properties.Resources.MSG_AN_ERROR_HAS_OCCURRED,
                        MessageBoxButtons.OK,
                        MessageBoxIcon.Error);
    }

    As you can see, I just take into account the possibility that the Detail.InnerText property is blank and if so, just use the standard Message property to be safe.

    Customization, Development, Dynamics CRM
    1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
    Loading ... Loading ...
    273 views
  • Changing Column Width of a Section using JavaScript

    Posted on July 22nd, 2010 Mitch Milam Print Print 3 comments

    Hi everyone.  Well it’s been a long time since I showed you how to do something horribly unsupported so let’s do something like that today.

    Background

    Ad you may know, CRM allows you to pick the layout style for a section within a CRM form.  For the most part, their settings work just fine.

    In January I did a short presentation on CRM User Interface tips and tricks for the XRM Virtual User’s group where I reminded everyone that even once you have picked a format for a Section, you can still change the width of the fields labels within the section.

    It’s highlighted below:

    image

    Unfortunately, it has a maximum value of 250 pixels, which is usually fine, but what if I have a really, really, long label?

    The Scenario

    Let us pretend that I am creating a questionnaire inside CRM to gather some type of relevant data.  I either create a Questionnaire Entity or just add some question attributes to an existing Entity.  Either way, I have a lot of question text and not much room to show it and it might look something like this:

    image

    Note: This is using the default column layout for a Section.

    Notice that my answers are also really small – basically Yes or No, or a short amount of textual information – and they are taking up over 50% of the Section area.

    We need to fix that.

    The Solution

    Ok, we’re going to change the column width of both columns within the Section using JavaScript.  But let’s start with a look at the HTML that makes up our Form:

    image

    CRM uses something called a Column Group ( colgoup ) to help define how the columns of the table are to be sized.  As you can see from the picture above, the column that contains the label is 250 pixels wide and the column that contains our data entry field is 270 pixels wide.

    Using the following JavaScript, we can modify those values to be more representative of both the data and the label requirements:

    var tableObj = crmForm.all.new_q1_c.parentNode.parentNode.parentNode;
    var col0 = tableObj.getElementsByTagName("col")[0];
    var col2 = tableObj.getElementsByTagName("col")[2];
    
    col0.width = "60%";
    col2.width = "40%";

    How This Works

     

    Step 1:

    First we need to get a handle to our form field’s parent table, which we do with the first line of JavaScript.  crmForm.all.new_q1_c is actually the table cell that contains the label of our first form field ( which is the attribute new_q1, by the way ).

     

    Step 2:

    Next we need to get the handle to the first and third col objects that belong to the parent table which we accomplish by using the getElementsByTagName function.

     

    Step 3:

    Once we have that information, we can set the width of the first column to 60% of the container’s space ( the table ), and set the third column width to 40%.

    Your new section layout should look like this:

    image

    You can change the values for each column to meet your requirements.

    Note: I actually have a question at the bottom of this list that occupies much of the form but it contains customer-specific information so I can’t show it.

     

    Conclusion

    As I mentioned, this is very unsupported and I can’t guarantee it will work in every circumstance, but it seems to fit the need I had.

    Also, If you’re good with jQuery, you can probably do something very similar with less code.

    Administration, Dynamics CRM, Unsupported
    1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
    Loading ... Loading ...
    7,576 views
  • Microsoft Dynamics CRM 4.0 Edition Differences

    Posted on July 21st, 2010 Mitch Milam Print Print 3 comments

    I’ve had discussions recently with both customers and partners regarding the differences in the three editions of Microsoft Dynamics CRM 4.0 so I thought I’d quickly cover these today.

    Note: For this discussion, I am purposefully not covering CRM Online since the end-customer has no control of that environment.

    Editions

    We have three editions available to us:

    Microsoft Dynamics CRM 4.0 Workgroup.

    This edition is limited to five, or fewer, users. It can be installed on Microsoft Windows Small Business Server 2003 R2 Premium Edition, any of the supported Windows Server 2003 editions, or Windows Server 2008. This version is limited to a single organization and a single computer that is running Microsoft Dynamics CRM Server.

    Pretty self explanatory: 5 users, one CRM Organization.

     

    Microsoft Dynamics CRM 4.0 Professional.

    This edition has no user limit and is limited to a single organization. However, Microsoft Dynamics CRM 4.0 Professional can be installed on more than one computer in the same deployment.

    Microsoft Dynamics CRM 4.0 Enterprise.

    There is no user limit for this edition. Additional features include support for multiple organizations, multiple server instances, and role-based service installation. Role-based services let you increase performance by installing component services on different computers.

     

    Why is this important?

    Most companies run into issues because they purchase the Professional Edition knowing that they will always have a single organization or tenant.  Most people know that the Enterprise edition allows you to specify multiple organizations, but what is not really clear, if you don’t know the terminology, is something called role-based services.

    CRM 4.0 is divided into a series of server roles that perform various tasks related to the operation of the system as a whole.  Unless instructed otherwise, when you install CRM all roles are placed on a single server, which is usually not a problem.  But, there may come a time when you need to move one of the roles to a separate server to help ease the processing burden.

    And in many cases, this has nothing to do with the number of users but is totally related to what those users are doing.  Some operations, such as the application of complex business logic, batch updates, etc., may require a tremendous amount of processing power for a short period of time.  Since all of the server roles are on a single server, that one server must perform all of the processing directly.

    If the server roles are split, say by moving the Asynchronous Processing service to another server, the load is shared between multiple physical machines so that one set of processes doesn’t affect others.

    So, keep that in mind when you start planning your own CRM installation.

     

    Licensing

    A Microsoft Dynamics CRM 4.0 deployment operates by using a single license key. Unlike earlier versions, Microsoft Dynamics CRM 4.0 no longer requires additional license keys to be added when changes are made, such as adding a client access license (CAL). The single license key contains the Microsoft Dynamics CRM version, server license, and the CALs.

    You can view and upgrade a license in Deployment Manager.

    You can view and modify client access license types for each user in the Users area of the Settings area in the Microsoft Dynamics CRM Web client.

    Note: There is no difference in the licensing for the CRM Clients, no matter which edition of Dynamics CRM 4.0 you have installed.

     

    References

    Dynamics CRM, Installation
    1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
    Loading ... Loading ...
    597 views
  • Marketing List Manager Screencast Uploaded

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

    I took a break from recording some training videos tonight to record a quick screencast of the Marketing List Manager solution I created for CRM 4.0.

    I walk you through creating workflows that use the Marketing List Manager to add and remove a Contact from a marketing list.

    You may view it here, under the Additional Downloads section.

    Customization, Dynamics CRM, Workflow
    1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
    Loading ... Loading ...
    230 views
  • Creating a query to find all users with a specified security role

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

    I ran into an interesting requirement this morning that let’s me show off one of my favorite CRM add-on utilities: Stunnware Tools.  Let’s cover both.

    The Requirement

    I needed to create a list of users that were members of a specific security role.  Rather than writing an application or designing a SQL query, I opened Stunnware Tools for Microsoft Dynamics CRM so that I could create a query in the FetchXML Wizard.

    Using the FetchXML Wizard

    The FetchXML Wizard allows you to query CRM by building a FetchXML query.  Here is a screen shot of the Designer:

    image

     

    Designing the Query

    The following steps were required to created the desired query:

    Step 1:

    Query the SystemUser entity and return the Full Name of the user.

    Step 2:

    Include a Linked Entity that links the SystemUser Entity to the SystemUserRoles Entity

    Step 3:

    Add another Linked Entity from SystemUserRoles to Role.  This link will have a filter applied where the Name of the Role is equal to salesperson.

    Here is the resulting FetchXML query:

    <fetch mapping="logical" count="50" version="1.0">
      <entity name="systemuser">
        <attribute name="fullname" />
        <link-entity name="systemuserroles" from="systemuserid" to="systemuserid">
          <link-entity name="role" from="roleid" to="roleid">
            <filter>
              <condition attribute="name" operator="eq" value="salesperson" />
            </filter>
          </link-entity>
        </link-entity>
      </entity>
    </fetch>
    

    Which produces the following result set:

    image

     

    This whole process took me less than 5 minutes because the FetchXML Wizard Query Designer understands the links between CRM Entities and allowed me to quickly select those links and specify the necessary filter to produce the dataset I needed.

    The Export to Excel module included in Stunnware Tools allows me to export the above result set to an Excel worksheet.

    More About Stunnware Tools

    There are two editions:

    • The Community Edition: It's free and contains the Metadata Viewer, FetchXml Wizard and Excel Export.
    • The Professional Edition: A subscription-based version with access to all tools of the Community Edition plus the Code Generator for C# and VB.NET, the CRM Help File Generator, additional features of the FetchXml wizard and the Customization Comparer.

    Stunnware Tools is probably the most valuable Dynamics CRM add-on that I have.  I use it on a weekly, if not daily basis and which makes me a much more productive developer.

    Administration, Customization, Dynamics CRM
    1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
    Loading ... Loading ...
    418 views
  • Free Utility Released: Bulk Delete CRM Attributes

    Posted on July 19th, 2010 Mitch Milam Print Print 10 comments

    I’ve released a new free utility for CRM users that allows you to bulk-delete CRM Entity Attributes.

    The user interface is fairly straightforward, as you can see below:

    image

    How It Works

    The operation is pretty simple:

    1) Select if your organization is OnPremise or CRM Online.

    2) Enter the name of your server and the credentials required to connect properly.

    3) Select the organization you wish to connect to.

    4) Select the Entity you wish to delete attributes from.

    5) Select the attributes to delete.

    6) Click the delete button.

     

    Behind the Scenes

    This utility uses standard CRM SDK methods to delete the attributes you specify.  A log file is written to the location where the application is stored.  All actions will be logged and if errors are encountered, the log file will be displayed at the end of the processing cycle so you can see what happened.

    Remember: The same rules that would apply if you were to delete an attribute through the CRM user interface apply here.  For example: if the attribute is used on a form, a view, or within a workflow, the deletion will fail and you will be given a list of locations where the attribute is in use.  You must remove the attribute from those locations before you can continue.

     

    Download

    You may download it here.

    Administration, Customization, Dynamics CRM
    1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
    Loading ... Loading ...
    745 views
  • Verifying CRM 4.0 Installation File Dates the Easy Way

    Posted on July 15th, 2010 Mitch Milam Print Print No comments

    This morning I was verifying the version of a CRM 4.0 installation when I realized that instead of opening individual files and checking their properties, I could just ask the Windows Explorer to show me the information.

    Perform the following steps:

    1) Navigate to your CRM 4.0 installation folder, ( c:\program files\Microsoft Dynamics CRM ).

    2) Open the Setup folder.

    3) Set the View of the folder to be Details.

    4) Right click on the file list grid to display the pop-up menu:

    image

    5) Click the More… menu.

    6) Scroll down the Details list until you find File Version and check the box beside it:

    image

    7) Click OK and your file list will update to show something like this:

    image

     

    Fairly simply, I know, but it just occurred to me that this feature was available and it is surely easier than checking files individually.

    Administration, Dynamics CRM
    1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 5.00 out of 5)
    Loading ... Loading ...
    250 views
  • CRM JavaScript Export Tool Updated

    Posted on July 12th, 2010 Mitch Milam Print Print 1 comment

    I have updated the CRM JavaScript Export Tool to include the following major enhancements:

    1) Added support for CRM Online.

    2) Added support for the generation of a Visual Studio 2010 project.

    3) Changed the naming convention of the export folder so that it also contains the date and time of the export.

    Here is how the new user interface looks:

    image

    You can find it on the Free Utilities page.

    Customization, Development, Dynamics CRM
    1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
    Loading ... Loading ...
    389 views
  • Sales Centric is back in action

    Posted on July 6th, 2010 Mitch Milam Print Print No comments

    Well, it looks like Sales Centric and their Relationship Charts product is back on the market after having taken quite a long “vacation:”

    http://www.salescentric.com/relationship_charts.asp

    Dynamics CRM
    1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
    Loading ... Loading ...
    207 views