It is up to the plugin to watch what page was loaded, and act appropriately. A plugin that wants to create a new menu bar button, should naturally execute its payload on every request. A plugin that wants to rearrange product card, should first check if the current page is a product form.
var url_install = 'https://t1.erply.com/1234/'; var child_window = null; var conf_name = 'mt'; var conf_subname = ''; var page_lang = 'eng'; var section = 'prodmoves'; var subsection = ''; var conf_dateformat = 'm/d/Y'; var conf_date_monthdayformat = 'm/d'; var datepicker_format = conf_dateformat.replace("Y", "yyyy").replace("m", "mm").replace("d", "dd"); var datepicker_firstDay = 0; var thousandsSeparator = ','; var decimalSymbol = '.'; var priceDecimals = 2; var conf_attendants = '0'; var new_menu = 1; var customerCode = '1234'; var apiSessionKey = 'abcd1efgh'; …
Variable "section", for example, defines the type of the current page — is it the product form, the list of invoices, or something else?
Variable "recordID" provides the ID of the currently opened record, if user is on a form. (If user is entering a new record and it has not been saved yet, "recordID" equals 0.)
There is a variable "apiSessionKey" with which the plugin can issue calls to API.
These variables are documented below, in section "Context Variables".