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

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

How to call on demand workflow using alert.js?

(0) ShareShare
ReportReport
Posted on by

I'm venturing into dangerous territory, but am going to try my hand at some javascript.  I would like to use  https://alertjs.codeplex.com/ to call an on demand workflow.  I have a rather complex custom solution with is tightly coupled with on demand workflows fired from business process flow stage changes but I don't want the user to ever selectively fire those using the RUN WORKFLOW button so need to hide it.  However, there is one they do need to use specifically so was thinking I would use this JS.  

I will need the JS to fire an on demand workflow.  And I need to attach the JS to a button on the button bar.

*This post is locked for comments

I have the same question (0)
  • Cyclefitness Profile Picture
    on at
    RE: How to call on demand workflow using alert.js?

    SOLVED the above issue.  The GUID was wrong.  WHAT A GREAT SOLUTION ... and great documentation, Scott Durow!!

    Thanks for everyone's help!

  • Cyclefitness Profile Picture
    on at
    RE: How to call on demand workflow using alert.js?

    I've found a great post by Scott Durow for running an on demand workflow from a ribbon button using OOTB functionality configured using the Ribbon Editor.  https://ribbonworkbench.uservoice.com/knowledgebase/articles/132235-create-a-workflow-short-cut-ribbon-button-no-code.  

    I've followed all steps (except I didn't put the button the form, just on the grd) and see the button on my button bar but get this error after selecting records and clicking it ...

    60011.Error.png

    Not real helpful to determining what's wrong.

    Here is the button configuration:

    60011.Error.png

  • Verified answer
    Guido Preite Profile Picture
    54,084 Moderator on at
    RE: How to call on demand workflow using alert.js?

    Hi Debra, regarding codeplex, the author of both tools (Paul Nieuwelaar) is aware of the situation and he will move the tools before the codeplex shutdown.

    Regarding your question about multiple records, what CRM does is to launch the WF for each record, so you need to do the same (using a for cycle for example), this for example is a tutorial using ribbon workbench

    ribbonworkbench.uservoice.com/.../129783-pass-the-currently-selected-grid-row-s-to-a-custo

    hope it helps

  • Cyclefitness Profile Picture
    on at
    RE: How to call on demand workflow using alert.js?

    Do you happen to know if this will work on a multiple record selection from a View if I attach it to a button on the View?

  • Verified answer
    Gopalan Bhuvanesh Profile Picture
    11,401 on at
    RE: How to call on demand workflow using alert.js?

    Hi

    Please refer this:

    blogs.msdn.microsoft.com/.../shutting-down-codeplex

  • Cyclefitness Profile Picture
    on at
    RE: How to call on demand workflow using alert.js?

    OK .. thanks, guys!  I will go after that.  Does anyone know where this code will live once codeplex shuts down?  https://alertjs.codeplex.com/

  • Verified answer
    Nithya Gopinath Profile Picture
    17,078 on at
    RE: How to call on demand workflow using alert.js?

    Hi Debra,

    As suggested by Gopalan Bhuvanesh, you could call a workflow using the Process.js library.

    Process.callWorkflow("WorkflowGUID", 
        Xrm.Page.data.entity.getId(),
        function () {
            alert("Workflow executed successfully");
        },
        function () {
            alert("Error executing workflow");
        });

    See: https://processjs.codeplex.com/

    Hope this helps.

  • Suggested answer
    Gopalan Bhuvanesh Profile Picture
    11,401 on at
    RE: How to call on demand workflow using alert.js?

    Hi

    You can use process.js library.

    processjs.codeplex.com

  • Gopalan Bhuvanesh Profile Picture
    11,401 on at
    RE: How to call on demand workflow using alert.js?

    Hi

    I could not see any function in Alert.js for this.

  • Suggested answer
    Community Member Profile Picture
    on at
    RE: How to call on demand workflow using alert.js?

    We create a field (mostly boolean) and place it on the form. Then on change of that field we run the workflow. We change the value of that field using JS on button click. There is also a way to execute workflow using ribbon workbench rules but I have never used it.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
Aric Levin - MVP Profile Picture

Aric Levin - MVP 2 Moderator

#2
MA-04060624-0 Profile Picture

MA-04060624-0 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans