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)

workflow approach?

(0) ShareShare
ReportReport
Posted on by

Hello, I'm trying to implement a decoupled approach for saving data from cRM. I'd like to do this via workflows. Based on SDK.SAMPLES.ExecuteWorkflowRequest, I created an encapsulated workflow request call. I simply parameterized some of the values that were hard-coded:

https://www.dropbox.com/s/rriji0qzz0g9cyu/ExecuteWorkflowRequest.js

This allowed me to call a basic workflow based on an incident ID. However, now I have a scenario where I need to execute a workflow to execute logic based on the following parameters:

* A set of case ID's
* textParameter1
* textParameter2

I'd like to keep the call to ExecuteWorkflowRequest generic and reusable. However, I need a way to pass the parameters above to the workflow. I could save this data to fields on the incident. However, this feels like a hack. So can you recommend an approach for keeping my workflow request calls generic while avoiding adding parameters as field columns to the entity?

*This post is locked for comments

I have the same question (0)
  • Community Member Profile Picture
    on at

    Ok I figured out how to set an input parameter on the w/f CodeActivity:

    [Input("TestInput")]

    public InArgument<string> TestInput

    {

      get;

      set;

    }

    Then in my Execute method I can get the input value like this:

    string input = TestInput.Get(executionContext);

    So now I just need to figure out how to pass this parameter value via my ExecuteWorkflowRequest js.  Any suggestions?

  • Suggested answer
    Community Member Profile Picture
    on at

    look at my blog

    makdns.blogspot.com/.../dynamics-crm-2011-activities-code.html

  • Community Member Profile Picture
    on at

    @mn - I see where you're setting custom step input properties.  However, I'm still not clear if/how I can provide these property values dynamically through js at runtime?

  • Community Member Profile Picture
    on at

    CRM will pick the dynamically for the regarding entity value , if you see the above blog "set properties." image, Parameter Value {Match(Match)} , so it will pick the match entity id for the workflow.

  • Community Member Profile Picture
    on at

    @nm - {Match(Match)} in your example would refer to the Match field on the Match entity. Is that some type of custom entity and field you created?  If so then how does that refer to passing custom parameter values through js?  If it's an alternative approach that you feel is more appropriate or you think will work better then please explain the implementation and rationale.  Thanks.

  • Community Member Profile Picture
    on at

    it take Match entity's match entity id. i am not getting it, why do you want call javascript from workflow?

  • Community Member Profile Picture
    on at

    if it help, please verify it

  • Suggested answer
    ScottDurow Profile Picture
    21 on at

    Hi Andrew,

    Unfortunately there isn't any way of passing parameters to a workflow from Javascript - you might think about creating an entity that stores the parameters and run the workflow on create of that entity - you can then create a record in the javascript which will kick of the workflow.

    A bulk delete job could then tidy up these records when they are no longer needed.

    Hope this helps,

    Scott

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 April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans