Is there an easy way to import a 3rd party library...
# suitescript
t
Is there an easy way to import a 3rd party library into a suitelet script? I don't think adding it inline will work for my current instance
n
Copy code
define(['N/error', 'N/record', 'N/runtime', 'N/search', './EN_URB_ENUMS'],
    /**
     * @param{error} error
     * @param{record} record
     * @param{runtime} runtime
     * @param{search} search
     * @param{URBANENUMS} URBANENUMS
     */
    (error, record, runtime, search, URBANENUMS) => {
Note the last entry in the define and how it's declared in the param and param list
t
Thank you, does this work for a CS script and can i replace the path with a cdn url?
k
The file needs to be stored within the file cabinet for the define statement to pick it up. In a client script it is the same behaviour.
t
Okay thanks