Hi,
I have a requirement in which I need to run a workflow on all contacts.
Thanks
*This post is locked for comments
Hi,
I have a requirement in which I need to run a workflow on all contacts.
Thanks
*This post is locked for comments
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.
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
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)
Hi Pranav,
Thanks for suggestion, but I don't want to spend money on buying Azure machine to run Console application.
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
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,280 Super User 2024 Season 2
Martin Dráb 230,235 Most Valuable Professional
nmaenpaa 101,156