Initializing help system before first use

View Global Scope

Several objects are implicitly within scope in views and available to expressions.
They are considered as view globals.
  • scenario —the first scenario on the shelf.
  • scenario.entities —an object containing a map of all model entities. For example: scenario.entities.MyScalar, scenario.entities.MyArray and scenario.entities.MySet.
  • scenario.parameters —a function to access model parameters. For example scenario.parameters('MyParam').
  • scenario.props —an object containing scenario properties. For example, scenario.props.name and scenario.props.id. Refer to the JavaScript API documentation for further information - https://www.fico.com/fico-xpress-optimization/docs/latest/insight/javascript_api/ScenarioProperties.html.
  • scenario.summaryData —an object containing scenario summary data. For example, scenario.summaryData.hasResultData and scenario.summaryData.modelStatus. For more, see the JavaScript API documentation.
  • scenarios —the array of scenarios on the shelf, in the same order as they are displayed on the shelf. This array is used to access entities from scenarios other than the first scenario. For example, scenarios[1].MyArray, scenarios[1].props.name, and scenarios[1].summaryData.hasResultData.
  • vars —a map of all of the registered dynamic variables. For example, vars.MyVariable. See Using Dynamic Variables for more on dynamic variables.
  • user —an object containing information about the currently logged-in user. It contains the properties firstName, lastName, userName and authorities, which returns an array of authority names as strings.
    You can also call the function hasAuthority(), passing an authority name as a string. For example, to loop over the authorities, use:
    <vdl-column vdl-repeat="=auth in user.authorities"
    vdl-text="=auth">
    </vdl-column>
    To check for a particular authority, use:
    <span vdl-if="=user.hasAuthority('PROJECT_DELETE')">
    Can delete app
    </span>
    Note For more on why this authority is named PROJECT_DELETE see the section A Word About Terminology.