Hi everyone, I'm creating an assistant using a Su...
# suitescript
c
Hi everyone, I'm creating an assistant using a Suitelet. In one of the steps I have an assistant.addField with the type as 'serverWidget.FieldType.INLINEHTML', which then loads an html file. Within that html file, I have the code snippet shown in the picture attached to this message. What's important is the N/file in the window.require(...). N/record (I only use record.load) works just fine when I run the script, however I get the error message shown in the second picture. Anyone know why this error is occurring and how I could get around it? I'd like to upload content from another file in the NS file cabinet. I'd be happy to provide more details if need be.
b
N/file is only usable in server suitescript
c
is a suitelet not a server script?
b
inline html is rendered clientside
it runs in your browser
c
Oh that explains it
thank you
would you know any way of getting around this?
b
what are you trying to do with the file
c
I'm trying to make changes to an email marketing template. The assistant sets parameters on the suitelet's script deployment record in step one. In step two, those parameters are used to render certain parts of an email marketing template. I'm trying to use file.load to get the file content from that marketing template but that's not working as you mentioned.
b
post to a suitelet that saves the file instead
c
can you elaborate?
b
use N/https to post to a suitelet
or a restlet
your choice
you can also use fetch if you want
c
Fetch was the method I was thinking of using
But I see what you mean with the post method. I'll give those a try, thanks for your help and advice.