Skip to main content

Notifications

Microsoft Dynamics CRM (Archived)
Answered

Calling a plugin from an action called on a workflow

Posted on by 45

Hello,

I am working on D365. I have a workflow that calls an action and that action is taken as a step on the plugin registration for a plugin.

But the plugin is not firing, do you know if what I am trying to do is possible?

I made it this way because I need to update some related items when the status of one entity changes, and as I cant get a retrieve on the workflow, I knew this should be done with a plugin, but I made an action to call it because I need to send the id from the changed entity to be referenced on the related items.

Thanks for your help

Gaby

*This post is locked for comments

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Calling a plugin from an action called on a workflow

    Gabriela, can you plz post more details regarding your solution? 

    I am working on functionality exactly like yours (plugin in custom action, invoked in custom worklfow) and getting problems with parameters. 

    1. What Process Argument needs to be set up in Action?

    2. How to set up properties in the Action step in Parent Workflow?

    My task is to use an existing plugin to update fields in the Order entity based on some business critieria. 

    Thank you,

    Greg

  • Verified answer
    Gabriela C Profile Picture
    Gabriela C 45 on at
    RE: Calling a plugin from an action called on a workflow

    It seems like my problem was the parameter I was sending, I changed it to entity reference and now its working.

    Thank you all.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Calling a plugin from an action called on a workflow

    Hi Gabriela,

    I can see in the screenshot of Workflow it is made as run in background, which means it is an asyc workflow.

    Which in turn make the whole this as asynchronus.

    Can you make the workflow as real-time and test the functionality.

    Hope this helps.

    Thanks

    Phanidhar

  • tw0sh3ds Profile Picture
    tw0sh3ds 5,600 on at
    RE: Calling a plugin from an action called on a workflow

    You did not post the whole code here - are you sure you are not checking the Depth in the plugin at the beginning of Execute method?

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Calling a plugin from an action called on a workflow

    Hi,

    Workflows run as realtime which is synchronous and background workflows runs as asynchronous. If it is realtime then make the pluggin registration also as synchronous.

    Please update your response here.

    Best Regards,

    VC Suresh Kumar

  • RaviKashyap Profile Picture
    RaviKashyap 55,410 on at
    RE: Calling a plugin from an action called on a workflow

    Hi Gabriela,

    Can you check the workflow instance (background process) to see if the custom action step is actually called?

  • Nuno Profile Picture
    Nuno 2,005 on at
    RE: Calling a plugin from an action called on a workflow

    Hi Gabriela,

    This approach is possible. Are you sure your workflow executes the line where the action is called?

  • Gabriela C Profile Picture
    Gabriela C 45 on at
    RE: Calling a plugin from an action called on a workflow

    I know this can be made with custom wf, but is not what my client wants. And my doubt is about why the action is not calling the plugin with the step I registered to do so. I want to know if the approach I proposed is possible.

    Thanks

  • sandeepstw Profile Picture
    sandeepstw 4,601 on at
    RE: Calling a plugin from an action called on a workflow

    Hi,

    You can do retrieval of data in custom workflow and update record. There is not need to make plugin for the same. Follow this article for creating custom workflow -

    mahenderpal.wordpress.com/.../step-by-step-creating-custom-workflow-in-microsoft-crm-2011

    Please verify my answers.

    Thanks,

    Sandeep

  • Gabriela C Profile Picture
    Gabriela C 45 on at
    RE: Calling a plugin from an action called on a workflow

    I think I dont understand. I already posted the screenshot of the workflow and marked where the action is being called. Its the first image. And the code called is a plugin that receives the context, not a wf action.

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!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans