1

It seems there are tons of ways to load data into salesforce - https://help.salesforce.com/HTViewHelpDoc?id=import_which_data_import_tool.htm&language=en_US

But I am specifically looking for the best option to manage reference data for our project. In ruby on rails you can create database migrations or load yaml files to do similar things.

Is there any command line tool that I can use to automate the creation of reference data in any new environment? Same thing for doing updates. Particularly interested in one that can create relationships between custom objects.

So my use case is Suzy creates some reference data records that need to be loaded into each environment for the business logic to work. Say there is a custom entity "task_templates" that relates to sf recordtypes of another custom entity. We want to baseline a script that will get run by other developers and also when pushed into the sandbox.

Bob comes along and needs to add more reference data and fix one of Suzy's records, so he needs to create a script that would be run after Suzy's script.

This seems like something every project would need. Is everyone just doing this manually?

1 Answer 1

1

The Salesforce Data Loader tool has a command line interface, you can read more about it here. It is actually a Java app, so good for being integrated into scripts etc you may want to run on different platforms. It consumes CSV files that contain the records, you can also use it's GUI to perform exports.

process ../conf csvInsertSuzyRecords

process ../conf csvInsertBobRecords

process ../conf csvUpdateBobRecords

If you want to build something more custom, that consumes your own data format and/or adds some more dynamic aspects, you can consume the Salesforce SOAP API from a Java or Ruby app and make database requests directly.

4
  • This this is helpful, I cant seem to find anyway to handle relationships with the data loader tool. Can you confirm there is no way to do this? Seems like I am going to have to roll my own to deal with relationships.
    – Joelio
    Commented Aug 7, 2013 at 18:01
  • You can do this, you can use external Id fields on the objects to include sudo Id's in your data being loaded. Here is an explanation, wiki.developerforce.com/page/Data_Loader_and_relationships Commented Aug 7, 2013 at 18:06
  • Thanks, I just found this, yuck, I am surprised the data loader doesnt have this built into it. This is a pretty trivial thing for the data loader tool to do by itself using either the original ids or some labeling scheme, but I guess is this is what we have work with, we will have to live with it.
    – Joelio
    Commented Aug 7, 2013 at 18:10
  • 1
    I think we are going to try the route of writing something like rails migrations for apex, will try to share if we can make it generic.
    – Joelio
    Commented Aug 7, 2013 at 21:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .