Hello,
I want to create child record (for logging purpose) when parent entity record being updated, for that I need to identify which field of parent entity is updated.
Is it possible to identify in worflow?
Thanks,
Ashish
*This post is locked for comments
btw, this idea (input parameter being available for referencing within a workflow assembly) works for both create and update of a record. ie. it works regardless if the workflow was triggered by a create / update of a record.
I would like to jump in here... if this thread is about finding what fields are changed in workflow, then yes, it is possible, via workflow assembly. And just like in plugin, to find out what's changed, you don't need a pre/post image. You just need to enumerate what's in the input parameters, because of a couple of assumptions - we're assuming that the change is done through the form and the form does not have javascript that sets alwayssubmit to true on a non-dirty field. ie. if the field is not changed, save will not carry that value over to crm. If the change is done via code or service, then it's possible to try to update a field with the same value (tsk tsk tsk, why would you do that)
so out of this 80/20 scenario, all you have to do in an assembly is just to have two parameters - one to pass in the attribute name and the other being a boolean result, indicating if the supplied attribute name is part of the input parameter of the current stage of the pipeline, and the following lines:
var entity = (Entity)context.InputParameters["Target"];
Result.Set(activityContext, (entity.Contains(AttributeName.Get<string>(activityContext))));
where AttributeName is the input and Result is the output.
@Pawel That's what I used to think as well:) Then I ran into an article by somebody else (would love to post a link, but don't remember right now). Turned out it does work - there are pre-defined images you have access to in the custom workflow activities.. they are there, but I could not find any references to them in the documentation (not that anything else is 100% documented in CRM:) )
@Alex I believe that Pre/Post images are not supported in workflows, but if it works then thanks for sharing, that a nice thing to know :)
Hi Ashish,
Using OOB workflow, you can't.Either you can create Plugin and use PreImage option or else create custom workflow and implement Audit Request. These are the possible ways.
Hope it helps,
Thanks.
It is possible with the worfklows as well, but you would need a custom activity(can't do it out of the box).. And it's a bit of a grey area whether it's, actually, ok to do it.
Anyway, I have that activity in my TCS Tools solution:
www.itaintboring.com/.../a-selfie-for-your-worfklow
Basically, custom worfklow activities will also have pre/post images, so you can compare the values..
No, this is not possible OOTB. Only using plugin you will know exactly which fields were changed to trigger it, but for the workflow it's not possible
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,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156