2. Development Tips

July 14, 2021


How to develop plugins?

On an ERPLY account, go to the Settings → Configuration page and click on the link "Edit plugins". A new page opens, containing a text field. Paste your Javascript code into that field and click "Save". Now reload whichever page you want your plugin to take action and watch the results.

ERPLY back office uses jQuery. To make sure that your code executes at the right time, wrap it into a "document.ready" event handler:
 
$(function() {
    // Your code here
});
Please note that Berlin back office and Classic back office use different jQuery versions, and these version WILL NOT be updated. Berlin back office has jQuery 1.11, Classic has jQuery 1.3.

You are strongly advised to not use neither direct jQuery calls, nor direct manipulation with the Document Object Model. 
 

Instead, do your operations through the Javascript API. If you are an internal developer, you are welcome to contribute to the project if it does not provide sufficient functionality.

Recommendations

Some important notes to keep in mind when writing plugins.

  1. The code copied to the "Edit plugins" window gets executed as-is, not transpiled. You may want to transpile ECMAScript 6 yourself, but with rapidly improving browser support, it should generally not be necessary.

  2. Do not declare any global JavaScript variables. There are other plugins that may overwrite these.