Looking for PowerObjects? Don’t worry, you’re in the right place! We’ve been part of HCL for several years, and we’ve now taken the final step in our acquisition journey: moving our website to the HCL domain. Nothing else is changing – we are still fanatically focused on Microsoft Business Applications!

PowerObjects Blog 

for Microsoft Business Applications


Using Workflows To ‘Fix Stuff’ on thousands of records in Dynamics CRM

Post Author: Joe D365 |

Workflows in dynamics crm 4 allows us to easily manipulate records, change data, and do various things. In addition to being great for automation, they are great for 'fixing stuff'. For example, let's say after a big data migration you forgot to set the primary contact on your accounts. You could then re-write the whole migration OR run a workflow in batches of 250 records at a time. But, with a small unsupported sql change, you can run this same workflow in much larger batches. This is unsupported and we are explaining here only for test purposes.

So here's the workflow. In our case, it is a simple workflow that checks to see if the contact's parent account has a primary account. And if not, sets this contact as the primary contact.

Now we have to make a small change behind the scenes to allow us to run this on many contacts. In this case I set it to 2000 rows at a time.

UPDATE    UserSettings

SET        PagingLimit=2000

WHERE    SystemUserId IN

    (Select SystemUserId

     from    SystemUserBase

     where FullName like
'system administrator')

Now you can run the workflow in all 2000 records at a time:


To reset the max number of records back to normal, just go to 'personalize workplace' and pick one of the standard options: 50, 100 , etc.

If you need assistance feel free to reach out to the CRM Experts as PowerObjects – the only thing we do is Microsoft Dynamics CRM and with 100's of customers we found solutions to most anything you can think of.

Happy CRM'ing

Joe CRM
By Joe D365
Joe D365 is a Microsoft Dynamics 365 superhero who runs on pure Dynamics adrenaline. As the face of PowerObjects, Joe D365’s mission is to reveal innovative ways to use Dynamics 365 and bring the application to more businesses and organizations around the world.

3 comments on “Using Workflows To ‘Fix Stuff’ on thousands of records in Dynamics CRM”

  1. Hi ,
    I am new to CRM.
    I have a scenario where I have a value in the Javascript which i pass to a crm field using crmForm.all.Fieldname.Datavalue = value.
    Now based on the value in this field I need to update a column value in the database.
    Is it possible using the workflows in CRM.
    If yes... please let me know how

    1. Hi Pia,

      Sure - you could write a workflow that does this. Workflows can have if then logic and update any field on the entity and related entities. They are very robust for modifying values.

  2. Hi,

    I am using CRM 2011. Were do I have to place that SQL statement to increase the limit of records per page?

    Regards,

    Ruendry

PowerObjects Recommends