• Sudhi
  • NEWBIE
  • 0 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies

Hi,

 

I am writing an apex class where I have to refer certain pre-known values (I will run validation against these pre-known values). Initially I had thought to use a custom object with just one field and store as many object values as I can. Then I was planning to get those values using simple query against custom object.

 

But my customer insists that I should not be using a custom object. Rather, I should be using a static resource (some sort of text file with pre-known values) and I should read that text file using apex code. I have not done this thing before.

 

I know how to upload a text file as static resource but I have absolutely no idea of how would I read that text file in my apex code.

 

I have to read that file, get all the values that have been mentioned in text file (each individual entry  in new line) in a LIST.

I can take it from there. 

 

Just help in 'how to read static resource of text file' would be appreciated.

 

 

Thanks,

Anuj