Skip to content

Option

An option is an action that can be executed by the user. It can be a link to another view, a command executed on the server, or a link to an external resource

Attributes

All required fields are marked as required; the rest are optional.

  • name (required): The name of the option.
  • command: Multiple values available, separated by commas.
  • title: Title associated with the name.
  • label: Label for the option.
  • text: Url or command to be executed when the option is selected.
    • server side variables [[variable]] are available see server side variables
    • client side parameters are available {parameter} , which will be replaced with (in order of priority):
      1. client side parameters passed to the srs
      2. query string parameters
  • acl: Permission settings for the option.
  • css: CSS class for styling.
  • opts: extra options can be used to modify behavior of the option on the client side for example opts="clipboard"
  • scope: Limits the scope of the option to a single command in the user interface, can be separated by commas scope="orders,items".
  • opts:
    • uimenu: Renders directly in the options menu without a dialog.
  • type:
    • pa_post: Executes a POST request with a single object selected in the user interface.
    • pa_post_many: Executes a POST request with an array of selected objects.
    • pa_post_single: Executes a POST request with with a query object.
    • pa_blink: Opens an external link in a new window.
    • pa_elink: Opens an external link in the same browser tab, replacing the current content.
    • pa_mlink: Opens in a modal dialog within the application, typically used to display content or perform actions without navigating away from the current view.
    • pa_download: Downloads a file from an external link; the download is initiated automatically without user interaction.
    • pa_info : simple msg , required value
    • v_(Name_of_the_component): Opens the specified component (given in the Name_of_the_component section) at the top of the SRS view. The type name must start with the 'v_' prefix.

Examples

XML
1
2
3
4
5
6
7
8
9
<itm model="option" label="Show all " css="xd-success"  scope="orders">
  <![CDATA[/srs/301-all orders/view?firmid={firmid}&amp;date_to=&mp;]]>
</itm>
<itm model="option" css="xd-success" label="Remove Selected" scope="documenttypes"  type="pa_post">
  <![CDATA[/api/srs/delete]]>
</itm>
<itm model="option" label="Create account" css="xd-success"   type="pa_elink" >
  <![CDATA[/pages/crm/account]]>
</itm>

pa_post

Type pa_post require opts="clipboard" on command

XML
<itm model="option" label="Zapisz" type="pa_post">/api/srs/506-api-nest-set/run</itm>
XML
1
2
3
4
5
6
7
8
9
<srs>
  <def>
    <itm>
      <![CDATA[
        update table set x= @column1 where y=@column2
        ]]>
    </itm>
  </def>
</srs>

These types are used to open links in different ways.

  • Url can be a relative path or an absolute path.
  • server side variables [[variable]] are available see server side variables
  • client side parameters are available {parameter} , which will be replaced with (in order of priority):
    1. client side parameters passed to the srs
    2. query string parameters
XML
1
2
3
<itm model="option" type="pa_mlink" css="xd-blue0" scope="items" name="comparestock"  label="Compare stock" >
  <![CDATA[/srs/419-compare/view?remoteSource=invoice&remoteID={invoiceid}]]>
</itm>

Display custom component

Type attribute must start with the 'v_' prefix and contain the name of the component.

XML
1
2
3
4
5
<srs label="Hello World">
  <def>
    <itm model="option" label="Report time, resources" type="v_timesheet" />
  </def>
</srs>