Skip to main content

Custom scripting API

parameters()

The parameters object contains context about the current page. This is available on all pages, but the properties will vary depending on the page.

api.fetch(url, options?)

The fetch method is a wrapper around the native fetch method. The wrapper adds the necessary headers and authentication for the Elfsquad API to the request.

Method parameters


url required (string)

The URL to fetch.

options optional (object)

The options object to pass to the fetch method.

ui.openDialog(options)

The ui.openDialog function allows you to open a dialog and embed one or more scripts in that dialog. These scripts can be used to add your own custom behavior and content to the dialog.

Method parameters


options required (object)

The options object to pass to the openDialog method.

ui.reload()

The ui.reload method allows you to reload the current page. Note: this method is only implemented on the quotation & order entry pages.

dialog.close()

The dialog.close method allows you to close the current dialog. This method is only available in dialogs.