Asked by:
Trigger a workflow if an field gets updated

Question
-
When a field gets updated you can set an trigger......even if nothing has changed. I only want to execute an trigger if something changed.
Is that possible?
Wednesday, November 6, 2013 3:31 PM
All replies
-
Hello,
Yes, I think it is.
When creating a standard workflow, you can edit the Options for Automatic Processes.
Please try to start the workflow when Record fields change and select the field according to your need.
Does it work for you?
-- Thomas Canaple
Wednesday, November 6, 2013 3:43 PM -
No. Example:
Let say I have an field with this combination in it: 12345
When i change that combination to: 12345
nothing realy changed but CRM thinks the field is updated so the trigger is running.
I only want to run the trigger when something realy changed
M.C. Diks
Wednesday, November 6, 2013 3:47 PM -
I understand and the workflow probably should not trigger in that case.
Do you have JavaScript code running on the form, performing the following method on this attribute?
attribute.setSubmitMode("always");
Sorry that my first guest was wrong.
By the way, what is your version of Dynamics CRM?
-- Thomas Canaple
Wednesday, November 6, 2013 4:01 PM -
The general design of CRM makes it the responsibility of code that updates CRM to only send fields if they are changed. Based on that design principle, ideally you wouldn't update a field to the same value. However, I appreciate that is not always possible.
Within a workflow, you do not have access to the previous value, so you cannot solve this purely with a workflow. However, you could create a plugin on the Pre event of the Update. This plugin could check if the attribute value in the Target InputParameter is being set to the previous value (which you get from a PreImage registered on the plugin step), and if it is the same value, then remove the attribute from the Target InputParameter. This would mean the workflow would not fire
Microsoft CRM MVP - http://mscrmuk.blogspot.com/ http://www.excitation.co.uk
Wednesday, November 6, 2013 5:09 PMModerator -
2011...and within 3 months 2013
M.C. Diks
Friday, November 8, 2013 7:56 AM