Use the New Force.com CLI for a Clean Quick Start…

Just got back from another exhausting by very fun Dreamforce!

If you were at the Dev Keynote, you would have the seen the legendary Dave Carroll demo a new Command Line Interface for Force.com. I have been trying it out this morning (thanks to Mike for his help getting me up and running!) and realized it is the perfect tool for something I seem to spend my life doing – cleaning up a new dev Org. I fire up new orgs every week, and I am always having to clear out the sample custom fields before I can get started. Why not just leave them there you ask? Soooo easy to accidentally include them in a managed package – and once there, no going back!

But with the CLI, you can just run a simple script to do that. For now, you first have to delete some references to those fields. You can probably do this via the Metadata import as well, but until I work that piece out, you still have to do the following:

    Delete Case Escalation Rules
    Delete Case Assignment Rules
    Remove Upsell Custom Links from Case from Page Layouts
    Delete Custom Upsell Link from Case

    Remove Delivery Status Custom Link from Opty Page Layouts
    Delete Link

Now you can download this file to where your force CLI binary is located, open up the terminal to that directory, type force login to run the oAuth, and finally run this command:
sh removesamplefields.txt

You’ll see it delete the fields, and now you can start building your new Salesforce1 App!

Leave a Reply