An effort to bring a revolution in Salesforce.

Wednesday, 3 August 2016

How to read text file from static resource Salesforce.

 Method to read Text File from static resource.

 
public String textFromSomeUniqueName {

    get {
        StaticResource sr = [
                select Body
                from StaticResource
                where Name = 'SomeUniqueName'
                ];
        return sr.Body.toString();
    }
}
, ,

No comments:

Post a Comment

Get Gmail, Docs, Drive, and Calendar for business