My code correctly creates a file in document repository as well as attach it to a record in NetSuite. However, the file type is 'Other Binary File' when it should be a PDF. I read that for PDF we must encode in base 64 but even then it doesn't generate the PDF. Anyone see an issue?
var fileobj = nlapiCreateFile(docname, doctype, doccontent)
fileobj.setName(docname)
fileobj.setFolder(folderid)
fileobj.setIsOnline(true)
fileobj.setEncoding('UTF-8')
var fileid = nlapiSubmitFile(fileobj)
Passed in data:
{
"filecontent" : "test",
"filename" : "PO Doc Test",
"filetype" : "PDF",
"folderid" : 521,
"recordtype": "purchaseorder",
"recordid": 13832
}