With loadData(), however, I sometimes ran into an issue with the static resource required by the call. According to the documentation, it supports four kinds of MIME types for the resource used:
- text/csv
- application/vnd.ms-excel
- application/octet-stream
- text/plain
The only way to remedy the situation seems to be using something Metadata API based (say Force.com IDE) to manually edit the MIME type to text/csv, after which it would work fine. That's a bit of annoyance when all you need is to quickly whip out the data file with Notepad++ but ended up spending 10 minutes to get the type right, almost just as long as writing those boring insert statements. So there's an idea out there to make MIME type editable on static resources, which I think everyone who uses loadData() should vote for.
No comments:
Post a Comment