Posted a couple of minor updates to Cloud Converter, mostly small bug fixes that affected the metadata explorer feature. If you already have it installed as a web tab in your org, there’s nothing you need to do. You automatically have access to these. Enjoy!
Had an interesting challenge the other day: all the best last data migration plans were failing. Why? The tool of choice — which one is not important — failed. What to do?
I used Cloud Converter. Quelle surprise, right? I could have used something else, but it’s some decent code that I’m familiar with — so I used it. How?
I first did a test to be sure the API was working using a SalesforceSession object. Why test? Well, you never know. Why the Cloud Converter provided "SalesforceSession"? It’s easy. One line of code or so with a valid user and I established that the user was good, that the API was functional and that the user had rights to the API.
Sweet!
Then I moved to the source documents. I had two kinds: Simple CSV’s and Complex CSV’s.
Simple CSV’s were easy. I added a standard Java FileReader to the sample code, pointed it at the file, and split the data into component parts. Then I built a collection of "Sproxy" objects, added the SalesforceSession to a SalesforceDAO and executed an upsert. Start to finish, about 5 minutes for the first file.
Complex CSV’s were tougher. The difference between simple and complex was that the data contained commas. I know, this seems like it should be relatively easy, but at the time I was drawing a blank. So I imported those Complex CSV’s into Excel, saved them as Excel files and then used another Cloud Converter class, ExcelConverterService.
ExcelConverterService reads an XLS and breaks the data in the cells into a collection of type safe objects. Then I did the same thing I had done with Simple CSV’s: iterated through the data, added it to a Sproxy collection and threw it at the API.
Eh voila – instant data load.
Truth be told, I would rather not have had to do it this way. But when all else failed, it was nice to have an extra tool in my kit.
I’ve been working on a new feature for Cloud Converter, the ability to import an app from an Excel spreadsheet. Here’s a walk through. You can use this for free, link code at the bottom.
You can add this to your org — DE, EE, UE — by creating a web tab with this URL:
Note that this is a beta release — you should treat it as such. I recommend you try it out on a dev org or in a sandbox before doing something in a production org.
Also, you can see it’s hosted over on Amazon Web Services. It’s always possible that the URL will change to something more Model Metrics Esque when it goes GA at some unknown point in the future.
Had a great note today from a Salesforce Sales Engineer in Belgium. David wrote:
(After David, I have one more screen shot.)
*****
Just wanted to let you know that I’ve spent some time with the new version of the Cloud Converter code you’ve got up on Code Share : It works like a charm and it will be very useful for us and our customers.
I’ve tested it on a local [MS] SQLExpress Server.
Converts nicely to:
I’m sure you’ve seen this in action before but I hadn’t, it’s very cool. Beautiful usage of our Metadata API. The java code is really easy to adapt to any db or table.
*****
Thanks, David.
This next screen shot shows a few other things — namely, the lookup relationship and long field types.
I’ve been working on some Cloud Converter enhancements for the last few days.Everything is uploaded to Google Code and ready for you to use.
The details:
After an extremely helpful note from an early user, I have changed the way we connect to databases. It’s now more generic.This is a good thing.You specify your DB driver, credentials and query string and CC does the rest.Remember that you’ll need to import your database driver JAR file if you’re hitting something like Oracle, etc.
You can now specify an “external id” field type.This is extremely useful for tables that include a surrogate id (identity field, etc).
You can now create picklists from any data you like.So, for example, if you have a field which contains “red”, “yellow” or “blue”, and that field today is controlled by the UI rather than the DB, you can convert that into a picklist by specifying the field name and query.
You can now create lookup fields that reference other objects perfect for keeping track of your one-to-many type relationships.
You can use foreign keys to determine your lookup field values.This is the standard upsert based foreign key resolution that’s included as part of the regular salesforce API.
Data can now be loaded as either upsert or insert depending on your needs.
There’s a class that illustrates these pretty clearly – CloudConverterScript_Sample.Open it in your favorite IDE and you can take a look through how it all works.I’ve also added a road map section to the readme.txt to keep track of some longer-term goals.
Note: Cloud Converter is undergoing active development.If you have code modifications that you do not want overwritten by a simple update from Google Code, you should copy those off to a different project before downloading this latest update.
Questions? Comments? Suggestions? Love to hear them.