Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Add a string parameter to the script. For this example it will be called $aRandomValue .

    Code Block
    #Multiple instances of this script will run for the same colour value
    param(
        [Parameter(Mandatory = $false)] [CBSingleSelect]        $aSelect,
        [Parameter(Mandatory = $false)] [String]                $aRandomValue
    )

  2. On the Script Parameters tab, edit the Javascript for the $aRandomValue parameter for the OnLoad event -set it as:

    Code Block
    //load a random value into the field
    $('#aRandomValue').val(Date.now());
    //hide the field and it's label
    $('#aRandomValue').hide().closest('tr').prev().hide();

  3. The run dialog will then look like this:

    Image Modified
Info

Since the $RandomVal $RandomValue parameter will always have a different value, the dispatcher will always allow the script to run (the dispatcher only denies multiple runs of scripts attempting to run with the same parameter values).

...