You need to sign in to do that
Don't have an account?
sp08830
CSV upload to update existing cases
Hi,
I am trying to develop a Visual Force page to upload a csv to update existing cases. I know we can do this with a Data Loader but we need it on a VF page. we are planning to release this tool for a small group users in our org so they can update case details from using CSV they receive from various sources. Looking for pointers or a sample code. Any help would be greatly appreaciated. thanks,
There's already a related list for Attachments on Cases... you could save yourself the trouble by using that existing feature.
I am sorry not sure if I understood your response.. I need to update case details via CSV upload, not sure how the related list can help me.
Ah got it, from your original message it just sounded like you wanted to upload a csv file to a case record. I'll see if i can find anything
sorry about the confusion. thanks for your help.
I did something like this before, and I can tell you it was an awful process. Apex does not have a native CSV parser, so you probably have to make one yourself. Try to google for java code samples to help you out.
thanks Scott.
Does any one know an alternate process instead of CSV parsing? As I mentioned above I need this tool for users who are not technical enough to run a data loader process.
This is a CSV parser I got from: http://blog.nicocrm.com/2011/03/06/parse-csv-file-in-salesforce-apex/ with some slight modifications by me.
Note that CSV needs to be in UTF-8 if you are using accented characters in the input; a discussion of this (context was inbound email handler) is given here: http://boards.developerforce.com/t5/forums/forumtopicprintpage/board-id/apex/message-id/93677/print-single-message/true/page/1
Hi
i hope this code will hepl you try this.
Actually i upload the csv file in my custom object employee you can change wt ever u r scenario
i am sending controller and vf page just try it.
@Eric, @Venkatesh, thanks a lot for your responses. I will try and let you know.
I think I am almost there. just got stuck with this. Not sure why, but I get this error with code listed below. Any idea
line 34 is : case c= new case(id=updlist.get(inputvaluess[0]));
never mind. I was using the list instead of the map where I am fetching the data.
Does any one know how to handle commas within the data? Say a value in billing address "New York, NY" is parsed as 2 different columns.
The CSV parser that I posted handles commas inside of " " and also line breaks inside of " "