Simon Fell > Its just code

Friday, February 18, 2011

Hudson/Jenkins plugin for Chatter notifications

Hudson is a popular continuous integration build server, I've been working on a plugin for it that will post build notifications to chatter. The plugin is configurable, so that it can post updates to its own wall, to a specific group (perhaps the project team that owns the build), or to a specific data record (perhaps you have a custom object that represents a build).

You can grab the source and a prebuilt plugin binary from the projects home page on github.

< 9:08 AM PST # > tags : Salesforce.com [playing "Orbital - Leeds 96 05 - The Box (Part 2)" by Orbital]

Monday, June 07, 2010

ZKSforce now with iPhone OS support.

ZKSforce is the Cocoa library i wrote to make it easier to access the Salesforce.com API from Cocoa / Objective-C. I just posted a new version that uses the Salesforce.com v19 API, and has switched out its use of NSXML & NSCalendarDate with libxml & NSDate and so is now compatible with both OSX and iPhone based projects. (iPhone OS 3.2 and up should be good).

< 8:40 PM PDT # > tags : OSX Salesforce.com [playing "I Feel You [Renegade Soundwave Afghan Surgery Mix]" by Depeche Mode (from Remixes 81-04)]
AppleScript connector

The Applescript Connector for Salesforce.com allows you to write applescript that can interact with the salesforce.com API, login, create, update & delete data, run queries, retrieve your scherma's metadata all from Applescript. Now you can more easily integrate Salesforce.com with your OSX desktop and applications.

< 8:37 PM PDT # > tags : OSX Salesforce.com [playing "Strangelove [Blind Mix]" by Depeche Mode (from Remixes 81-04)]

Friday, May 14, 2010

Schema visualization with GraphViz

A friend recently turned me onto Instaviz, a great iPhone / iPad diagraming tool based on graphviz. Graphviz lets you define your diagram as a set of nodes and connections, and it will perform the layout for you. I have something of an interest in being able to visualize your salesforce.com schema, and some lines of python code later, i had something that would generate a graphviz description of your schema, starting from a primary object, and with the option to go 1 or more levels deep from there. Here's an example for Opportunity, just 1 level deep. (click for full size version)

And here's the generated oppty.gv file that produces that graph. If you have Instaviz or one of the desktop viewers for graphviz, you can open the .gv file directly in those apps. (and/or you can use the commandline tools to generate a png or other formats).

Here's the actual python code, it uses beatbox to call the describeSObject API to discover the schema for your login. You run it as

python gv.py someuser@sample.org mypassword Opportunity > oppty.gv

Here's an even larger model that's 5 levels deep from Account - png rendering (ouch its 6MB), gv (33k)

[Also available Belorussian translation provided by Patricia]

< 11:35 AM PDT # > tags : Salesforce.com [playing "Fa-Out Son Of Lung And The Ramnlings Of A Madman" by The Future Sound Of London (from Teachings From The Electronic Brain (The Best Of FSOL))]

Tuesday, April 20, 2010

Uploading files to Salesforce Content

The API allows you to create new entries for Salesforce content by creating new ContentVersion records, you'll at a minimum need to fill out the VersionData which is the actual binary data for the file, and the pathOnClient, which is used to derive the file type, and its title. This will automatically create a new content record and put it in your personal workspace. For a twist here's an example in VisualForce rather than a SOAP based client (the Web Services API & Apex both share the same data model, so everything transfers over).

Here's the controller, called contentController, this just has a Blob property and a go method to create the actual ContentVersion row

public class contentController {

    public blob file { get; set; }
    
    public PageReference go() {
        ContentVersion v = new ContentVersion();
        v.versionData = file;
        v.title = 'from VF';
        v.pathOnClient ='/foo.txt';
        insert v;
        return new PageReference('/' + v.id);
    }
}
And for the VisualForce page, i just used the apex:inputFile to bind to it, nothing pretty, but it'll get you going. You'll probably want to do something more interesting with the title and pathOnClient properties.

<apex:form controller="contentController">
<apex:inputFile value="{!file}" />

<apex:commandbutton action="{!go}" value="go"/>
</apex:form>
</apex:page>
One variation is to have your controller expose a ContentVersion object directly, e.g.
public class contentController {

    public contentController() {
        file = new ContentVersion();
    }
    
    public ContentVersion file { get; set; }
    
    public PageReference go() {
        insert file;
        return new PageReference('/' + file.id);
    }
}	
And have the page bind directly to its properties.
<apex:page controller="contentController">
<apex:form >
<apex:inputFile value="{!file.versionData}" fileName="{!file.pathOnClient}" />
<apex:commandbutton action="{!go}" value="go"/>
</apex:form>
</apex:page>

If you want to experiment with the Content APi, you'll need to have signed up for a developer edition org recently (or go sign up a new one), and turn on the content license for the admin user.

< 9:42 PM PDT # > tags : Salesforce.com [playing "Marine Machines" by Amon Tobin (from Supermodified)]

Thursday, February 25, 2010

Updates

I updated the Quicksilver plugin for Salesforce.com to support Chatter, you can easily post status updates, URLs & Files to Chatter now from Quicksilver.

There's a minor revision to Trapdoor that adds Google Chrome to the list of available browsers.

SoqlX was updated to support the Salesforce.com v18 API, so that you can do aggregate queries etc, it also now tries much harder to preserve the field ordering in the table from the query.

< 8:34 AM PST # > tags : OSX Salesforce.com [playing "Voodoo Ray" by A Guy Called Gerald (from 24 Hour Party People)]

Sunday, November 22, 2009

OSX / Salesforce tools updates

I updated the OSX build of the data loader to v17, so now you can access v17 specific objects (like content) and use the new bulk api. And I also updated the TextMate Plugin for apex to v17 as well.

< 10:14 AM PST # > tags : OSX Salesforce.com [playing "Junglist Rmx -Drumsound & Bassline Smith" by Drumsound & Bassline Smith (from Assassin Vol 1)]

Sunday, August 16, 2009

PocketSOAP v1.5.5

I just posted PocketSOAP v1.5.5, this is updated to use the latest version of PocketHTTP, and the dateTime & time support has been updated to support milliseconds. However because the COM APIs do not expose milliseconds accessors for the dateTime type, this is likely only useful for c++ based clients that can access the underlying double directly.

< 3:53 PM PDT # > tags : PocketSOAP [playing "Sweet pea" by Soul hooligan (from rough technique vol 1)]

Saturday, July 04, 2009

v16 Data Loader for OSX

I built an up to date (api v16) OSX version of the data loader, and feel free to vote for the idea to make it official.

< 3:57 PM PDT # > tags : OSX Salesforce.com [playing "Poison" by The Prodigy (from Their Law (The Singles 1990-2005/Limited Edition) [UK] Disc 1)]

Saturday, April 18, 2009

App Updates

I released an updated SoqlX a couple of weeks back, it has a number of tweaks, exposing relationship names to make building SOQL-R queries easier, and the filtering object/field list I discussed earlier. And I just posted an updated version of SFFS, the file extension information is now bundled into the filenames for those files that don't have it in the name directly (depending on how your documents got into salesforce to start with, they might have the extension separate to the name). Follow me on twitter to find out these things as they happen.

< 11:54 AM PDT # > tags : OSX Salesforce.com [playing "Phoenix" by The Prodigy (from Always Outnumbered, Never Outgunned [Bonus Track])]

Thursday, March 12, 2009

SoqlX Filters

Following on from the filtered object/field list discussion, seems like showing all the fields and highlighting the matching ones seems like the best bet (but filtering the list of objects based on the object name, or the object having a field matching the filter), expect to find this in the next release of SoqlX.

< 10:22 PM PDT # > tags : OSX Salesforce.com [playing "Butterfly (Tilt's Mechanism Mix)" by Tilt (from Resident: Two Years Of Oakenfold At Cream (Disc 1))]

Tuesday, March 10, 2009

SoqlX Filters

I've been thinking about adding a filter widget to the object/field list in SoqlX, right now i have so that the object list is filtered based on whether the object name or any of its fields match the filter criteria, but the actual list of fields for the object remains intact. (as shown on the left). Is that what you would find most useful? should it also filter the field list itself ? something else? (I also thought about leaving it with the full list of fields, but having it highlight the fields that match the filter). Ping me on twitter and let me know what you think.

< 10:24 PM PDT # > tags : OSX Salesforce.com [playing "Song For Life (Steppin' Razor Mix)" by Leftfield (from Renaissance: The Mix Collection [Disc 1])]

Thursday, March 05, 2009

SoqlX tips'n'tricks

Everything you wanted to know about SoqlX but were afraid to ask.

Login


Remember that SoqlX uses the API to connect to Salesforce, and so depending on how your admin configured it, you may need to use your api security token in addition to your password to login (just add the token to your password, so if your password is beerisnice and your security token is abv123, enter beerisniceabv123 as the password). getting a LOGIN_MUST_USE_SECURITY_TOKEN error means you most likely forgot to include your security token (search for security token in the salesforce.com online help for more info)


Let SoqlX store your login credentials on the keychain, you'll be much happier, next time you run soqlX it'll remember your username & password (and if you have multiple salesforce.com logins, tryout trapdoor)

Queries

To execute a SOQL query, type the SOQL query into the box at the top, click Query (or Query All), the results will appear in the table, or for count queries, in the bottom left hand corner.



SOQL-R is supported, so you can do both queries that access foreign key relationships (like accessing account from a contact), and also aggregate child queries (like select accounts, and the contacts for each account). Double click the magnifying glass to expand the 2nd query table at the bottom, showing the child rows for that particular parent row.


If you queried the Id column, then you can edit data inline, just double click the cell and type in your new value, when the cell looses focus, the reecord in salesforce will be updated. You can also check the deleted checkbox and hit the delete button to delete row(s). click the Delete column header to quickly toggle the checkbox on all rows.

Using the Window menu, you can open launch the salesforce.com web application, for the user you're currently logged in as. You can also open the recent queries window, which'll show you the last 10 queries you've executed, double click a query to copy it to the SOQL query textbox. Watch the recent queries list animate the changes as you run new queries!.


Use File -> Save Query Results to save the results of your current query as a CSV file.


Schema
The list of objects & fields appear in the list view on the left hand side, double click an object to automatically create a query to select all the fields. Use the details button at the bottom left to turn on the details window which shows all the properties for the object or field selected in the list.

Hit the schema button at the bottom right to switch to a graphical view of your schema, showing how objects are related.

Use the +/- widget inside each object to control the set of fields that appear (id + name field, all standard fields, all fields). Double click an object (or select from the list view) to make that the primary object of the view.
Right click on any object in the listview and pick 'generate schema report' to generate the schema report for that object, this contains the graphical schema view, along with a table detailing all the fields for the object, you can print or export to PDF the schema report.

Got questions, or suggestions for new features, catch me on twitter.

< 8:37 PM PST # > tags : OSX Salesforce.com [playing "Run Wild" by New Order (from Get Ready)]

Wednesday, February 04, 2009

all the way to 20

bah, forget 11, this baby goes all the way to 20!

But seriously, memory is dirt cheap right now, why short change yourself

< 7:51 PM PST # > tags : OSX Technology

Saturday, January 03, 2009

Ritual Coffee now at Whole Foods

You can now get fresh (with roast dates) Ritual Coffee Roasters coffee at Whole Foods, (at least at the Whole Foods on California St in SF), this is a big deal most supermarket coffee is both gross and stale, having no roast date marked, and no idea how long its been sat on the shelf. I just picked up some LifeSaver espresso that was roasted Dec 30. Nice work by the Ritual crew. I also believe you can get the excellent Barefoot Coffee at Whole Foods in the south bay.

< 1:38 PM PST # > tags : Coffee