Using Script to Enable a MiniButton

To enable a minibutton, it is strongly recommended that you use the declarative technique described in Using a MiniButton Control to Call a Custom Method. In most situations, declarative programming does not negatively impact performance as much as scripting does. However, in certain situations, you can use a script to enable a button and improve performance. For example, you can use script to avoid a complicated Value expression that is longer than 255 characters that requires multiple calculated fields and declarative programming.

To use script to enable a minibutton

  1. Complete steps 1 through 11 in Using a MiniButton Control to Call a Custom Method.

  2. In the Applets list, right-click the applet you must modify, and then choose Edit Server Scripts.

  3. In the Scripting Language dialog box, choose Visual Basic or eScript, and then click OK.

  4. In the Script Editor, expand the WebApplet tree, and then click the WebApplet_PreCanInvokeMethod function.

  5. In the Script Editor, add the following script:

      function WebApplet_PreCanInvokeMethod (MethodName, &CanInvoke)
      {
    
      if (MethodName == "MyTest")
    
      {
    
        CanInvoke = "TRUE";
    
        return(CancelOperation);
    
      }
    
      return(ContinueOperation);
    
      }
    
  6. Continue with step 13 in Using a MiniButton Control to Call a Custom Method.