web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

CRM 2013: Differentiate various fields for update in a WFA plugin (C#)

(0) ShareShare
ReportReport
Posted on by

I have created a plugin (C# code dll) which I am using as step of a custom workflow. I want this workflow to kick in the case of

Update. But it is for multiple fields and the action would be different for each of them.

Now, I am wondering how in my C# code

protectedoverridevoidExecute(CodeActivityContextexecutionContext)

I could distinguish the different fields

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Mahendar Pal Profile Picture
    45,095 on at

    No sure, I understand your question, but you are looking for which field your custom logic is fired, then you can check if field value is changed or not, you can utilize images in workflow (although not exposed explicitly but you can use them in your code).

    refer: inogic.com/.../using-preentityimage-and-postentityimage-in-workflows

    pogo69.wordpress.com/.../using-preentityimages-and-postentityimages-in-custom-workflow-activities

    Thanks

  • Suggested answer
    Bruno Lucas Profile Picture
    5,421 on at

    Hi Hasibur,

    If that information is not on the InputParameter of IWorkflowContext, You can use pre and post image and compare the field's info before and after.

    zhongchenzhou.wordpress.com/.../dynamics-crm-2011-check-previous-value-in-preimage-in-workflow

  • Suggested answer
    Hasibur Rahman Profile Picture
    on at

    @Bruno and @HIMBAP- thanks for your reply.

    the information will be in one of the input parameters.  Let me try to explain it

    Say that the I have 2 input parameters X and Y. The workflow (which has the dll as step) will also get triggered  at the change of X or Y. So, my question is in the C# code (the following method)  - how can I determine if X or Y or both was changed

    protected override void Execute(CodeActivityContextexecutionContext){

        if (x changed)

        if (y changed)

    }

  • Bruno Lucas Profile Picture
    5,421 on at

    One way to find if the information has changed is comparing the value of the field on the preimage and the value of the field on postimage.

    If postimage field A value  is different from preimage field A value , that means that field has been updated.

  • Suggested answer
    Mahendar Pal Profile Picture
    45,095 on at

    Use can use Pre and Post images, and compare field value if ti is updated or not. Based on that you can follow your logic.

  • Verified answer
    Hasibur Rahman Profile Picture
    on at

    Reply from Bruno Lucas solved the issues

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
JS-09031509-0 Profile Picture

JS-09031509-0 3

#2
AS-17030037-0 Profile Picture

AS-17030037-0 2

#2
Mark Eckert Profile Picture

Mark Eckert 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans