Can the N/file module be used in a scheduled scrip...
# suitescript
g
Can the N/file module be used in a scheduled script? getting the below error trying to create a file: org.mozilla.javascript.EcmaError: ReferenceError: "file" is not defined. (ShippingConfirmation.js$228914$debugger.user#96) var fileObj = FILE.create({         name: 'searchresults.xml',         fileType: file.Type.XMLDOC,         contents: xmlString     });
b
depends on how you setup your define
but its likely that you dont have both a
FILE
variable and
file
variable
variable names are case sensitive
i
In this setup you must define N/file and match it with parameter FILE
g
I did, FILE = file. Anyhow the error is for "file".....
n
@Gail Kasnett file.Type.XMLDOC maybe: FILE.Type.XMLDOC That's the only other file you mention in that statement...
g
@NElliott THANK YOU!! (how on earth did I miss that, i must've re-writting that 5+ times)
n
Fresh eyes I guess 🙂