Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Regarding execute process on all contacts

Posted on by Microsoft Employee

Hi,

I have a requirement in which I need to run a workflow on all contacts.

Thanks

*This post is locked for comments

  • Suggested answer
    Somesh2207 Profile Picture
    Somesh2207 1,563 on at
    RE: Regarding execute process on all contacts

    In this case, one suggestion would be to:

    1. Create one configuration entity with 2 Fields:

    a. Next Run Date. (Date)

    b. Flag - (Boolean)

    2. Configure workflow which will trigger on creation of the above configuration. Create a child workflow which will  wait till the next run date. Then set the Flag = true and Update the next run date by 1 day. Call the child workflow again in the Parent workflow step.

    4. On Flag = true, write a CRM Plugin which will update all the contacts' flag (dummy field to trigger the workflow you want)

    5. Create only 1 record with the Next Run date as Date you want to run it first and Flag = No in the configuration entity

    Using this process, you will be able to schedule it on a daily basis and run your workflow daily.

    [Note: Plugin may timeout, if your flag operations take more than 2 mins. This may happen if you are updating 1000s of records. you need to test this with the amount of data]

    Ideally, you should update your contacts from external systems like Azure jobs or Task scheduler on any server if you have. CRM Online is not designed for this type of request. you can still try this.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Regarding execute process on all contacts

    Hi Somesh,

    This is not just a one time requirement, I have to run this job every day and I don't want to use local machine and also not want to use azure machine. I have to run this job more than 1000 records everyday.

    Thanks

  • Suggested answer
    Somesh2207 Profile Picture
    Somesh2207 1,563 on at
    RE: Regarding execute process on all contacts

    Hi Utkarsh,

    [Edit]: You don't need Azure to run console application. It can run from a local computer with internet connection and .NET framework

    PranavShroti is correct. If you want to execute the workflow on thousands of records, and if this is just a one-time requirement, you should rather opt for console application than executing an on-demand workflow. 

    You should do the below steps:

    1. Create a new Boolean field, say executeWorkflow with default value = No (False)

    2. Configure the workflow to trigger on change of the new field (execute workflow)

    3. Write a console application, which will update execute workflow field of all the contacts to True.

    This will trigger the workflow for all the contacts.

    If you want to do an on-demand workflow, you can go to the view and select all the records.

    (You can change in system settings to have Max 250 records per page)

    Pic792017_5F00_.png

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Regarding execute process on all contacts

    Hi Pranav,

    Thanks for suggestion, but I don't want to spend money on buying Azure machine to run Console application.

  • PranavShroti Profile Picture
    PranavShroti 4,510 on at
    RE: Regarding execute process on all contacts

    Hi Utkarsh,

    If you want to execute on existing contacts records, I will suggest you write a simple console application to do the job rather then running WF on each contact records. I am not sure about the business requirement however running on each existing record will not be advisable as you may have hundreds of contact records which will create unnecessary stress on Dynamics CRM.

    For newly created records you can have WF/Process/Plugin to do the same job.

    Regards,

    Pranav

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans