Monthly Archives: March 2012

SQLForce – ANSI SQL for SalesForce

There are great tools for SalesForce that we don’t hear much about:

SQLForce – Command line interpreter with ANSI SELECT/DELETE/MODIFY//INSERT commands that work with Salesforce.


How to resize the Apex/VisualForce Editor in the Salesforce UI

When using the Salesforce UI to edit apex/visualforce pages in a larger monitor, usually there is a lot of unused space on the screen.

Salesforce UI default editor

So if you like to use the Salesforce UI instead of Eclipse and have a big monitor, here is a little javascript URL to resize the editing box.

I have created a bookmark with it and use it everytime I need to edit something:

javascript:document.getElementById(“frame_ApexClassEditPage:theTemplate:theForm:thePageBlock:editor:codeeditor:buffer”).style.height=prompt(“What size in pixels?”,”750″)+”px”;return false;

It will ask how many pixels the height should be. 750 is usually a good size for a maximized window in a 20″ monitor.

Salesforce UI editor resized

My 1st little App Exchange: SOQL Query Tool

As a little exercise, I’ve created a small tool comprised of a VisualForce page/tab that allows system administrators to run ad-hoc SOQL (SOSL and aggregate queries) from within their applications and do mass update on every page of 100 records. Basically, it reproduces a little of the functionality of the DeveloperForce utility Mass Update Anything.

This tool is available at the AppExchange for free:

(The listing is private because SalesForce seems to only allow SalesForce Pardners – that is, companies – to take their apps to security review and make them public.)

SOQL Query Tool screenshot

The results of an ad-hoc query executed in SOQL Query Tool (click to expand).

In one class I used ApexPages.StandardSetController with a Database.QueryLocator to implement pagination of the query results.

objStdSetCtrl = new ApexPages.StandardSetController( Database.getQueryLocator( SOQLText ) );

In the VisualForce page I used the tag apex:repeat to display a dynamic list of columns nested in an apex:pageBlockTable that iterates on the query results’ rows.

<apex:pageBlockTable id="ResultsTbl" value="{!QryResults}" var="row">
    <apex:repeat id="ColumnsRpt" value="{!LstColNames}" var="col">
         <apex:column >
                <apex:outputLink rendered="{!( col == 'Id' || col == 'Name' )}" value="/{!}" target="new">
 <apex:outputText value="{!row[col]}" />