Is there a way to pass file.getcontents() to a cli...
# suitescript
a
Is there a way to pass file.getcontents() to a client script from a suitelet? When I use
functionName: "myFunc(" + file.getcontents() + ")"
I get a syntax error.
b
the solution I would use is to put the file contents in a field on the form and get that value from your client script instead
if you really want do it in the functionName, then your functionName is essentially a string used with eval. Follow all the normal rules of eval, pay extra attention to all the warning telling you to stop
a
It's a base64 representation of an excel file. I don't know why it would give me an error.
b
Copy code
"myFunc(" + "ABDE1234" + ")"
is equivalent to
Copy code
"myFunc(ABDE1234)"
your file contents will be interpreted as a variable, not a string
s
yeah putting that data in a field and just reading it in the client script is usually the simpler/easier approach
s
Just curious - what the use case is that requires a base64 encoded file string to be injected into your client script like that?