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