Discussions
Stay up-to-date with the latest news from NetSuite. You’ll be in the know about how to connect with peers and take your business to new heights at our virtual, in-person, on demand events, and much more.
Now is the time to ask your NetSuite-savvy friends and colleagues to join the NetSuite Support Community! Refer now! Click here to watch and learn more!
Stay in the Know
Be sure you're subscribed to NetSuite communication to stay in the know about monthly happenings, updates and announcements. Subscribe
Be sure you're subscribed to NetSuite communication to stay in the know about monthly happenings, updates and announcements. Subscribe
Need Help with first 2.0 Script FTP
Hello,
I am trying to do my first 2.0 script, and it is just downloading a file from an FTP. I made it a scheduled search and when I try to run it at the debugger I get the following:
Cannot find function createConnection in object [object Object].
/** * @NApiVersion 2.x * @NScriptType ScheduledScript * @NModuleScope SameAccount */ define(['N/file','N/sftp'], /** * @param {file} file * @param {sftp} sftp */ function(sftp,file) { function execute(context) { var myPwdGuid = "XXXXXXXXXX"; //var myHostKey = "XXXXXXXXXXXXXX"; var connection = sftp.createConnection({ username: 'usernameXX', passwordGuid: myPwdGuid, // references var myPwdGuid url: 'sft.testnet', directory: '/Outbound/', hostKey: myHostKey }); // download the file from the remote server var downloadedFile = connection.download({ directory: '/Outbound/', filename: 'test.csv' }); } return { execute: execute }; });
0