You need to sign in to do that
Don't have an account?

File URL from Document Salesforce Schedulable
I have a code which gets information from a file-URL and creates a Document within the Salesforce.
I wish he created the document on the 10 am and then I used Schedulable.
But he has a problem and does not create the document.
Someone help me please!.
I wish he created the document on the 10 am and then I used Schedulable.
But he has a problem and does not create the document.
Someone help me please!.
global class UploadFileTest implements System.Schedulable { //Public Document mydoc; global void execute(SchedulableContext sc) { getFile(); } public void getFile(){ Http h = new Http(); HttpRequest req = new HttpRequest(); req.setEndpoint('http://download.finance.yahoo.com/d/quotes.csv?s=AAPL,IBM&f=sl1d1t1c1ohgv&e=.csv'); req.setMethod('GET'); req.setHeader('Content-Type', 'text/csv'); req.setCompressed(true); req.setTimeout(60000); HttpResponse res = h.send(req); string responseValue = ''; responseValue = res.getBody(); system.debug('Response Body for File: ' + responseValue); blob image = res.getBodyAsBlob(); Document mydoc = new Document(); mydoc.Name = 'UPDATE'; mydoc.Type = 'csv'; mydoc.folderid = UserInfo.getUserId(); mydoc.Body = image; insert mydoc; } }THANK YOU!
https://developer.salesforce.com/forums/ForumsMain?id=906F0000000AVgU