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

Need some general help on csv's and java.
Not sure if this is the right section to ask, but I've been tasked with rebuilding an old java application that used SOAP calls for upserting data. The problem is the size of our org often lead to time out issues which is a pain with this app being run on a windows scheduler.
Was thinking of bulk api is a good solution for the upsert, the question is though, haven't really used java in a decade or so and not familiar with the options out there for CSV generation off off of like a map or other list options?
Anyone have experience developing apps that dl data from salesforce, repackage and bulk api upsert back?
thanks!
Was thinking of bulk api is a good solution for the upsert, the question is though, haven't really used java in a decade or so and not familiar with the options out there for CSV generation off off of like a map or other list options?
Anyone have experience developing apps that dl data from salesforce, repackage and bulk api upsert back?
thanks!
I am also a java developer (becoming an Apex developer) and I solved this problem using the powerful parser of Univocity. http://www.univocity.com/pages/parsers-download
https://github.com/uniVocity/univocity-parsers
https://github.com/uniVocity/csv-parsers-comparison
The common mistake of beginners is to use the simple split method of String for getting the CSV fields.
You need a real parser for CSV files and this parser is excellent (Detection Enabled everywhere from the header and content).
The sample concise code below will reformat of the exported Account.csv according the fields of the array (cols).
All the work is prepared by the CsvParserSettings and the CsvWriterSettings.
For filtering:
int recordtypeid = parser.getRecordMetadata().indexOf("RecordTypeId");
if (row[recordtypeid ] != null) { ... }
Regards
Alain
Best regards
Alain