Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer Service forum

how to change the business process flow stage based on status reason and based on field selected and on clicking of custom button

(0) ShareShare
ReportReport
Posted on by

I have a option set field called  reason

if reason is pending then  i need to change the incident status as put on hold and change the business process flow  stage to a custom stage(proccess approval)
 These things should be called on clicking of a custom button

on clicking of the custom button  these things should be validated and the status and stage should change  accordingly.
i am unable to get the exact solution.?

Any idea how to achieve this.?
code or javascript ,plugin.?

Categories:
  • Suggested answer
    Johnny Gong Profile Picture
    6,482 Moderator on at
    RE: how to change the business process flow stage based on status reason and based on field selected and on clicking of custom button

    Hi Dineshpallineni,

    You could use following two ideas to achieve your above requirement:

    1. Non coding Workflow(OOB, Simple ):

        Operation: New a workflow(check 'As on demand workflow' if you want to bulk operate incidents in the future) under incident and triggered by incident reason field changed to 'pending'. Then update the incident status and current BPF Stage as your mentioned.

       If you want to trigger above operation with  custom ribbon. You need to download Ribbon Workbench and copy above workflow's Guid to your custom ribbon's custom JS Action Parameters. Following step by steo operations could be for your reference:

    community.dynamics.com/.../call-workflow-directly-from-a-button-using-ribbon-workbench

    2. JS Command to call fields update and changing Stage step:

     You can change the stageID of the business process flow to change the active stage by code. Use executionContext.getFormContext().getAttribute(“reason”).getValue(); 

    to validate reason field and use setVaule() to update incident status. Then you could update the stage ID according your stage name like 'process approval'.

    Following 'Changing Stage step on a ribbon button click' thread could be for your reference.

    community.dynamics.com/.../changing-stage-step-on-a-ribbon-button-click

    The first idea is simple and could be triggered without ribbon button. You could call the workflow by bulk to check and update all incident status according one specified view.

    Pls kindly mark any helpful answer if it truly resolved your issue. Thanks in advance.

    Regards

    Johnny

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard > Customer Service

Featured topics

Product updates

Dynamics 365 release plans