Are there any docs on custom GL entries using Suit...
# suitescript
c
Are there any docs on custom GL entries using SuiteScript?
c
The 'good luck' sounds ominous 🙂
Am I too naive asking if there's an SS2 version?
b
i have not done plugins so im not sure which supports what
hence the good luck
c
Guess that's my time allocated for the next week then
thanks!
s
It does not support SS2. You can kind of write modular code, using the old IIFE way, but still have to use the SS1 api calls. SuiteGL also has it's own unique api calls.
I referred frequently to this document when I wrote some recently. It's a decent guide: https://docs.oracle.com/cloud/latest/netsuitecs_gs/NSCGL/NSCGL.pdf
Also, deploying and testing GL plugins is unlike a regular suite script. The only way to trigger it is by saving a transaction. Once configured, the plug-in will be called every time a transaction is submitted/saved, either through the UI or via script, so you can use a scheduled script to create and save various test transactions.
c
Thanks @scottvonduhn
What's the standard way to limit this to one subsidiary?
s
@Craig what I have done is to break the plug-ins into two parts: at the highest level, just do quick filtering to exclude any transactions that should be ignored, based upon whatever criteria you have (subsidiary, etc.), then if it passes all of the filters, send it to another module which actually does the custom GL processing, like this:
glEntryPoint.js
myGlModule.js
When you define the Plug-in Implementation, you'd choose the top level script (which must have
function customizeGlImpact(transactionRecord, standardLines, customLines, book)
defined in it globally, then you can add the second module as a Library script file.
There are lots of gotchas with GL plug ins, but one of the big ones is that you can't have the plugin run as Administrator. In fact, it doesn't run as a User/Employee at all, but rather with a defined Role. It is highly recommended to make a custom role specifically for GL plug-ins, so that removing permissions form some other role will not cause transaction saves to suddenly break.