locked
Automatically update a field RRS feed

  • Question

  • Greetings,

    I am very new to MS Dynamics 2011 CRM and I would like to automate the update of a field when a condition occurs.  We have an extension called Assets within Dynamics.  It is a link between Accounts and Products and basically shows which products of ours is owned by an account, the quantity of products, when maintenance is due, and if they have paid maintenance on the product.  Currently we are running a report that shows which accounts and assets are overdue in their maintenance and manually changing the radio button that indicates Maintenance Paid (YES/NO) to NO.

    I would like to have a workflow that automatically checks the Maintenance Due date and updates the Maintenance Paid (YES/NO) if the date is earlier that today's date.

    As mentioned... very, very new to Dynamics.

    Thursday, November 8, 2012 2:45 PM

Answers

  • Julio, Richard Knduson's blog and book can help you learn everything you need to know about using workflows to solve requirements like this one. http://www.dynamicscrmtrickbag.com/.

    Neil Benson, CRM Addict and MVP at Slalom Consulting. Find me on Twitter. Join over 20,000 other CRM professionals on the Microsoft Dynamics CRM group on LinkedIn.

    Thursday, November 8, 2012 4:07 PM
    Moderator
  • Julio,

    Just so you know: workflows can be run manually, by the user clicking the workflow button and then selecting the desired workflow to run; or automatically, after the record is saved.  However, CRM workflows cannot be "scheduled" like a SQL job.  You can run workflows in a loop, so that they 'wake up' each day to check on a condition, which may be the way you want to go here, but be aware that this can bog down your system over time if you have thousands of workflows running.  (To do this, you add a "wait" step in the workflow. But I really wouldn't recommend this approach for you.)

    If you are currently running a report and manually editing records, a quick and easy way to make that process more efficient would be to:

    - create a view on the Assets entity called "Overdue maintenance". 

    - In the view criteria, you can specify "show me all records where the MaintDue date is in the past".  I would also add "and maintenance paid = Yes", so you eliminate any that already state that maintenance isn't paid.   (Alternatively, you could leave htis condition out and instead add that field to the advanced find grid.  This would let you see all of the overdue maintenance, and then you could sort on the yes/no field, and select only the ones that are Yes to be updated.)

    You users then simply have to select this view to see all of the ovedue assets.  Then, you could simply select the box at the top of the grid to "select all" of those records.  Finally, click on the Edit button.  This is called "bulk edit", and it will apply the changes you make to all selected records.  When the Asset form displays, change the maintenance paid from yes to no.  (Note that you cannot use a checkbox for this field; leaving the box unchecked is not seen as a change in bulk edit.  So, leave that maintenance paid field as radio buttons, or change to an option set...)

    HTH,

    Dave

    P.S. If you find that you have the need to do other conditional logic, that either requires Javascript, or, you might be interested in my add-on product, crm-rules.com, that will generate Javascript for you.  Perfect for the new CRM "accidental admin"...

    Thursday, November 8, 2012 6:42 PM

All replies

  • Julio, Richard Knduson's blog and book can help you learn everything you need to know about using workflows to solve requirements like this one. http://www.dynamicscrmtrickbag.com/.

    Neil Benson, CRM Addict and MVP at Slalom Consulting. Find me on Twitter. Join over 20,000 other CRM professionals on the Microsoft Dynamics CRM group on LinkedIn.

    Thursday, November 8, 2012 4:07 PM
    Moderator
  • Julio,

    Just so you know: workflows can be run manually, by the user clicking the workflow button and then selecting the desired workflow to run; or automatically, after the record is saved.  However, CRM workflows cannot be "scheduled" like a SQL job.  You can run workflows in a loop, so that they 'wake up' each day to check on a condition, which may be the way you want to go here, but be aware that this can bog down your system over time if you have thousands of workflows running.  (To do this, you add a "wait" step in the workflow. But I really wouldn't recommend this approach for you.)

    If you are currently running a report and manually editing records, a quick and easy way to make that process more efficient would be to:

    - create a view on the Assets entity called "Overdue maintenance". 

    - In the view criteria, you can specify "show me all records where the MaintDue date is in the past".  I would also add "and maintenance paid = Yes", so you eliminate any that already state that maintenance isn't paid.   (Alternatively, you could leave htis condition out and instead add that field to the advanced find grid.  This would let you see all of the overdue maintenance, and then you could sort on the yes/no field, and select only the ones that are Yes to be updated.)

    You users then simply have to select this view to see all of the ovedue assets.  Then, you could simply select the box at the top of the grid to "select all" of those records.  Finally, click on the Edit button.  This is called "bulk edit", and it will apply the changes you make to all selected records.  When the Asset form displays, change the maintenance paid from yes to no.  (Note that you cannot use a checkbox for this field; leaving the box unchecked is not seen as a change in bulk edit.  So, leave that maintenance paid field as radio buttons, or change to an option set...)

    HTH,

    Dave

    P.S. If you find that you have the need to do other conditional logic, that either requires Javascript, or, you might be interested in my add-on product, crm-rules.com, that will generate Javascript for you.  Perfect for the new CRM "accidental admin"...

    Thursday, November 8, 2012 6:42 PM
  • Thanks folks for the reply.

    In the interim, I went ahead and created a scheduled task on the Dynamics server which runs on the 1st of every month.  It is set to run a SQL statement that checks the maintenance date and changes the maintenance paid field to NO if it is overdue.

    I'll go ahead and order the book also.  I need all the help I can get when it comes to workflows and dialogs.

    Julio

    Friday, December 7, 2012 10:04 PM