首页 > 其他分享 >How to Show/Hide a Button Using the Business Process Flow Stage

How to Show/Hide a Button Using the Business Process Flow Stage

时间:2022-10-14 14:24:48浏览次数:43  
标签:Hide Business Show button BPF Close new Opportunity stage

How to Show/Hide a Button Using the Business Process Flow Stage

 

In today’s blog, we’ll discuss how to show and hide a button using the Business Process Flow (BPF) stage. In the example, we are going to hide the Close as Won  button for all BPF stages on the Opportunity entity except for the last stage, Opportunity Close, where we will show the Close as Won button. 

First, we will create one new record in the Opportunity entity. After creating the new Opportunity record, the Close as Won button is displayed.

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 : 

function closeAsWonCustomEnable(primaryControl) { try { debugger; var formContext = primaryControl; var isShowCloseAsWon = false; // Show/Hide Variable for "Close as won " Button   //Get active process details var activeProcess = formContext.data.process.getActiveProcess(); var getActiveProcessName = activeProcess.getName();   //Get active Stage details var activeStage = formContext.data.process.getActiveStage(); var getactivestagename = activeStage.getName();   var state = formContext.getAttribute("statecode").getValue();   //If Opportunity is already Won then return false if (state !== 0) // 0 = Open { return isShowCloseAsWon; }   //Check the BPF stage name if (activeProcess != null && getActiveProcessName == "Opportunity Sales Process") {   if (getactivestagename === "Opportunity Close") { isShowCloseAsWon = true; }   } return isShowCloseAsWon; } catch (e) { alert("An error has occurred : " + e.message)   }   }

 

  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. 

标签:Hide,Business,Show,button,BPF,Close,new,Opportunity,stage
From: https://www.cnblogs.com/lingdanglfw/p/16791477.html

相关文章

  • 【750】Business Email Template
    参考:150+UsefulEmailPhrasesThatWillMakeYourLifeEasierWritingbusinessemailscanbetime-consuming,butlearningsomeusefulphraseswillsaveyoulo......
  • ctfshow文件上传总结
    简单总结下 文件上传前端限制绕过:抓包修改对应项即可,不过本人更习惯上传一个符合要求的文件,然后抓包后只修改后缀名,看看能不能上传成功文件上传后端限制绕过:一般都是检......
  • ctfshow 文件包含总结
    一些php伪协议就不具体介绍了,也不讲太详细filter伪协议可以利用过滤器来读或者写php://filter/read=convert.base64-encode/resource=flag.php  如上图,不能让......
  • linux用户权限su sudo chmod shown
    linuxshell主要分为如下几类:   bashshell配置文件介绍(文件主要保存用户的工作环境)  登录系统后,华宁变量配置文件的应用顺序是?  说了这么多预备知识,这些和su命令切......
  • Markdown Table shows multi lines text All In One
    MarkdownTableshowsmultilinestextAllInOneMarkdownTable显示多行文本/换行namedesconelineabcmultillinesabc\nxyzrefs......
  • java中列表 Not showing null elements 列表中去除null 使用 list.removeAll(Collec
    java中列表Notshowingnullelements列表中去除nullNotshowingnullelements有时候看见list的size与结果不一致,例如下面这样导致原因:list集合允许null值,......
  • v-show 动画
    <transitionname="fade"> <spanv-show="isShow">动画效果</span></transition>.fade-enter-active,.fade-leave-active{transition:opacity.25s}......
  • ctf.show新手杯
    ctf.show新手杯目录ctf.show新手杯1.warmup✔解题方法2.web1easy_eval✔解题方法3.crypto1easy_base✔解题方法4.crypto2天知地知✔解题方法5.你newbee吗✔解题方法6.......
  • mPaaS x Menxlab | 1024程序员节:Talk is cheap,Show me the AppID
    有这样一群人他们的灵魂和身体总有一个在写代码他们自称码农/程序猿/程序媛但无论使用的是JAVA、PHP、Python、GO、SQL……在计算机面前,他们都简单直接程序员群体,往往......
  • ctfshow新手杯剪刀石头布(session反序列化)
    看到ini_set('session.serialize_handler','php');让我不由自主的想起了session反序列化漏洞的一道题。直接百度会有很多文章这里不多介绍。因此我们的解法就是:1.post一......