Hi, I’ve created a workflow that adds a button to sales orders. Clicking that button generates a .xls(xml)-file that is sent through e-mail. I’ve been trying to change it so it gets downloaded instead, but I can’t figure out how to redirect the browser to the url of the file. This is mostly done in a custom workflow action.
I’ve managed to submit the file and return the URL, but window.location.href = xmlfileURL didn’t work and I can’t get nlapiSetRedirectURL to redirect to the file (external of RECORD/’file’)
And a “go to record” action in the workflow can’t lead to a file from what I can tell.
Any suggestions?
Code:
var xmlfile = nlapiCreateFile(OrderNumber + ‘.xls’,’XMLDOC’,stringxml);
xmlfile.setFolder(206205);
var xmlfileID = nlapiSubmitFile(xmlfile);
var xmlfileURL = nlapiLookupField(‘file’,xmlfileID,’url’);
This is a cached copy. Click here to see the original post.