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.?
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