Knowledge found and lost while working with Microsoft Dynamics CRM
RSS icon Home icon
  • Using CRM workflow to overcome laziness, I mean, become more efficient

    Posted on January 22nd, 2010 mitch 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 ...
    492 views
  • Using Workflow to Create Marketing Lists

    Posted on January 19th, 2010 mitch 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 ...
    486 views
  • Automating Task Notification

    Posted on November 2nd, 2009 mitch Print Print No comments

    If you have ever assigned a task to someone and wondered when or if they completed it, this workflow process may help.

    This workflow is based the Task activity, but you can perform the same process on other activities as well.

    The workflow will execute when the record’s status changes.

    Here is a quick picture of how it is configured.

    image

    Our first check is to see if the Task was closed with either a Completed or Canceled status.

    If so, then we check the owner.  Is it the same person who created it?  If not, then we will send an email to the creator of the Task, using the following email:

    image

    When published, the workflow will generate an email that looks like this:

    image

    Customization, Dynamics CRM, Workflow
    1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
    Loading ... Loading ...
    206 views
  • Processing Activities using Workflow and Queues

    Posted on August 13th, 2009 mitch Print Print 1 comment

    One of my customers has a fairly interesting process that I thought I would share with you.

    They move activities from one department to another by setting a Current Stage field to indicate the current state of the work being performed on the activity.  It looks something like this:

    image

     

    Routing Activities to Queues

    On of the rather interesting things about the CRM 4.0 workflow process is that you can actually route activities to a queue by simply assigning the activity to the desired queue.  I use that technique in the following workflow:

    workflow1

    This workflow works using the following criteria:

    • When an email is created
    • When the attribute Current Stage is modified

    The workflow will review the value of the Current Stage attribute then assign the email to the appropriate queue.

    Note: To make things easier for the user and administrator, we make the Current Stage picklist values and the names of the queues the same.

    For each activity type that you need this process performed on, you’ll need to add the Current Stage attribute to the form, then create a corresponding workflow rule to handle the routing.

     

    Conclusion

    While this solution may not seem like much at first, it does showcase the power of the CRM 4.0 workflow process and can save small amounts of time that add up to big overall savings.

    Customization, Dynamics CRM, Workflow
    1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 4.00 out of 5)
    Loading ... Loading ...
    519 views
  • Enhancing CRM 4: Workflows vs. Plugins

    Posted on June 4th, 2008 mitch Print Print 7 comments

    Back in the dark ages, like with CRM 3.0, we were often faced with writing .NET code to provide certain enhanced data manipulation capabilities as either Callouts or Workflow Assemblies.  CRM 4.0 totally changes that mind set – and as a solution developer, you really need to keep that in mind before you jump off into the depths of Visual Studio and the CRM SDK.

    An Example

    To illustrate my point, let's take the PostInvoicePlugin example from the CRM SDK ( v4.0.5 ).

    Note: this example is found in the SDK folder: sdkserverfullsamplepluginpostinvoice

    The purpose of this sample code is to show you how to update a custom field on the Account record whenever a user closes out an Invoice as Paid.  The plugin checks the state of the Invoice, and if Paid, it will update the value of a custom field on Account, using the following code:

    // If the Total Invoiced exists, update it... otherwise set it
    if (parentAccount.Properties.Contains("new_totalinvoiced"))
    {
        ((CrmMoney)parentAccount.Properties["new_totalinvoiced"]).Value += totalAmount;
    }
    else
    {
        parentAccount.Properties.Add(new CrmMoneyProperty("new_totalinvoiced",
                                     new CrmMoney(totalAmount)));
    }
    

    Pretty cool, huh?

     

    An Alternative

    If you haven't spent much time reviewing CRM 4.0 workflows, you should.  You can perform some amazing things without ever writing code.  Let's perform the exact same steps using CRM 4.0 workflow.

    First, we create a workflow based on the Invoice Entity that has the following properties:

    image

    Step 1:

    Create a Check Condition using the following information:

    image

    Step 2:

    Add and Update Record step, on the Related Entity Customer (Account):

    image

    Step 3:

    Click the Set Properties button, then set the Total Invoiced Attribute to the following:

    image 

    Note: Total Invoiced is a custom Money Field.

    By using the Increment by Operator, we are able to increment any existing Total Invoiced amount by the amount found in the Invoice's Total Amount field.

    Final Step:

    Save and Publish this workflow.

    Conclusion:

    So, is there a difference between these techniques?  Not really.  Both accomplish the job in a very similar manner but the Workflow solution requires zero code maintenance and a normal user or administrator can create the workflow.

    The biggest difference between the two techniques is in the timing of the actual update. Plugins can be executed either Synchronously or Asynchronously.   Workflows function in an asynchronous manner.

    The Synchronous operation will modify the data stream as it is being saved to the database, which can introduce a delay in the user's experience, but will provide results back to the user in a quicker fashion.

    Asynchronous operations will happen shortly after the data has been saved which will not impact the user, but which may result in a slight delay between the time the user saved the record and when the value will be updated.

    If you can live with the time delay, I feel that workflow is the way to go, in most cases.  If you can't, then download the SDK and start working through their examples.

    Customization, Development, Dynamics CRM, Workflow
    1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 4.00 out of 5)
    Loading ... Loading ...
    10,292 views
  • CRM 4.0 Workflow: Adding a timestamp to a field

    Posted on May 22nd, 2008 mitch Print Print No comments

    One of my current projects required that we have, more or less, an audit log for completion of tasks.  This can be easily accomplished using a CRM 4.0 workflow, using the following variables:

    image

    When the workflow is run, it will produce the following results:

    image 

    In this particular case, we are actually creating a task, then setting the Task Status to Completed so that it gets placed in the history for the record.

    Dynamics CRM, Workflow
    1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 4.00 out of 5)
    Loading ... Loading ...
    1,485 views
  • Guest article on CRM Team blog. 2/6/2008

    Posted on February 6th, 2008 mitch Print Print No comments

    I have an article on the CRM Team Blog describing how to automate the sending of a welcome email to new CRM users using CRM 4.0 workflow.

    Dynamics CRM, Workflow
    1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 3.00 out of 5)
    Loading ... Loading ...
    2,276 views
  • CRM 4.0 Workflow: Setting the Primary Contact's Parent Customer

    Posted on January 21st, 2008 mitch Print Print 10 comments

    I am becoming more and more impressed with the workflow capabilities of CRM 4.0.  I am finding that I can create workflows to automate minor tasks to enhance CRM's functionality or to correct what I consider to be "annoyances."

    One of these involves the relationship between the Primary Contact for an Account and that Contact's Parent Customer field. 

    When I set the Primary Contact on an Account, I would like it to automatically edit that Contact's record and update the Parent Customer field to point back to the Account.  It's always seemed fairly logical to me to have these two fields linked, but that's not the way it has worked, until now.

    We're going to define a workflow based on the Account Entity ( I've renamed my Account Entity to be Company, but it works just the same ).  Here's how the initial workflow configuration will look:

    image

    Options:

    Start when:

    • Record is created
    • Record attributes change ( select the Primary Contact Attribute )

    Available to Run:

    • On demand

    Steps:

    1) Check for existing data

    1a) If the Primary Contact's Parent Customer Attribute does not contain data, perform the next step:

     image

    ( Basically, if the user has set the Attribute manually, we don't wish to overwrite their work. )

    2) Update the Related Entities: Primary Contact record.

    3) Set the Parent Customer Attribute:

    image

    This will make our workflow look like this:

    image

    Publish the workflow.  From this point forward, every time you set the Primary Contact for an Account, the workflow rule will run and if you have not already, it will update the Primary Contact's Parent Customer Attribute to point to the Account.

    Dynamics CRM, Workflow
    1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 3.00 out of 5)
    Loading ... Loading ...
    5,340 views