简体   繁体   中英

Dynamics CRM workflow that triggers on record field change also triggers on record create

I'm guessing that because the field is going from "doesn't exist"/"has no value" to "exists and has a value" that this is triggering the change event. Is there an easy way around this? I am using Dynamics CRM 2011 OnPrem.

Your description does not match your title very closely for this question (no offence.) Going on your description, the answer would depend entirely on which field or fields you selected for the change event.

In order to understand this better you have to realize that both events fire server-side only when the entity is saved. The On Create event fires first and if configured, a workflow starts. However the workflow runs asynchronously so any changes it may make may not trigger an On Change event right away. As part of the save process, the built-in field “Created On” is populated and conceivably a second event On Change could fire. (I don't have an trigger on this field so I am not entirely sure).

It may be that you clicked the “select all” checkbox when selecting fields to monitor for change. This would cause several “auto-populating” system fields to be monitored and could cause workflows to fire at unanticipated times.

The way I look at it, every CRM configuration option has a “cost”. In this case if you simply select all, you are accepting a high cost. Conversely, if thoughtfully go through each field and considering the ramifications you can keep the cost low by selecting only those fields necessary to meet the requirements. Your results will be much more predictable as well.

By the way, when I mentioned “cost” earlier, I loosely define that as the time and effort that goes into troubleshooting and supporting any given piece of code or configuration selection.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM