Skip to main content

Notifications

Microsoft Dynamics CRM (Archived)

Is it possible to identify changed field in workflow?

Posted on by 515

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

  • Kenneth Leong Profile Picture
    Kenneth Leong 360 on at
    RE: Is it possible to identify changed field in workflow?

    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.

  • Kenneth Leong Profile Picture
    Kenneth Leong 360 on at
    RE: Is it possible to identify changed field in workflow?

    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.

  • ashlega Profile Picture
    ashlega 34,475 on at
    RE: Is it possible to identify changed field in workflow?

    @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:) )

  • tw0sh3ds Profile Picture
    tw0sh3ds 5,600 on at
    RE: Is it possible to identify changed field in workflow?

    @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 :)

  • Suggested answer
    shivaram Profile Picture
    shivaram 3,315 on at
    RE: Is it possible to identify changed field in workflow?

    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.

  • Suggested answer
    ashlega Profile Picture
    ashlega 34,475 on at
    RE: Is it possible to identify changed field in workflow?

    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..

  • Suggested answer
    tw0sh3ds Profile Picture
    tw0sh3ds 5,600 on at
    RE: Is it possible to identify changed field in workflow?

    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

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!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans