How to Show/Hide a Button Using the Business Process Flow Stage
How to Show/Hide a Button Using the Business Process Flow Stage
First, we will create one new record in the Opportunity entity. After creating the new Opportunity record, the Close as Won button is displayed.
![](https://powerobjects.com/wp-content/uploads/2021/01/word-image.png)
To achieve the Show/Hide button functionality as per Business Process Flow (BPF) stages:
Create a custom JavaScript in which we will check the BPF stage and accordingly we are showing and hiding the button.
Go to the customizations and create one new solution and add an Opportunity form; also, create one new web resource for Javascript.
JavaScript :
1.2 Creating new web resource (JavaScript)
Once JavaScript is created, open the ribbon workbench and select the solution that contains the Opportunity form.
1.3 Customize the “close as won” button on form.
Select the button and click Customise command. Next, create a new Enable Rule and add CustomRule inside that. Use below property for CustomRule:
Default : True , invertResult="" , funcationName: closeAsWonCustomEnable ,Javascriptname : new_ showhidebutton
Once you create a new Enable Rule, add that rule inside “Close as won” button command and publish.
1.4 Create new enable rule for “close as won” button and add that to “close as won” button command.
After publishing the custom rule for Close as Won button, we will go to the Opportunity entity and create one new record.
Once we create a new Opportunity record, we can see in the below screenshot that the Close as won button is not showing:
Now, move to the next stage, and when the last BPF stage arrives for this opportunity (BPF last stage: Opportunity Close) then the JavaScript (new_showhidebutton) will return TRUE and Close as Won button will show:
1.6 “Close as won” button showing on last BPF stage.
posted on 2022-10-14 14:15 lingdanglfw 阅读(379) 评论(0) 编辑 收藏 举报