How to generate a file and store it under Document using Apex in Salesforce?

Sample Code:          

            Document d = new Document();       
            d.FolderId = '00l90000001KHtg';    //Id of the folder under Documents
            d.Name = e.Name + Date.Today();       
            d.ContentType = 'text/plain';       
            d.Body = Blob.valueOf(e.Name + ' ' + e.State__c);               
             insert d;


No comments:

Post a Comment

Sharing is Caring!!! Share this with your friends!!!

submit to reddit