Categories
Salesforce

Salesforce Add Action To apex:EnhancedList

There’s no quick way to add actions to a Salesforce VisualForce page with an EnhancedList. Here’s the workaround.

<apex:page>
    <script type="text/javascript">    
    function endsWith(str, suffix) {
        return str.indexOf(suffix, str.length - suffix.length) !== -1;
    }
    function setActions() {        
        Ext.ComponentMgr.all.each( function(item, index, length) {
            if(endsWith(item.id, "grid")) {        
                var store = item.store;                    
                item.store.each( function(record) {
                    record.set("ACTION_COLUMN", ["My Action"]);
                });
            }
        });
    }
    </script>
    <apex:enhancedList type="Systems__c" height="300" oncomplete="setActions();" />
</apex:page>

Salesforce uses the Extjs framework (Sencha.com) to implement list views. All user interface components on an Extjs page are registered with a component manager. The code accesses the component manager, looks for a component whose id corresponds to a grid (our EnhancedList), and then changes the action items in the store associated with the grid.

Categories
Salesforce

Salesforce Group Tables with Conga Composer

For a recent client project working with the Salesforce.com platform I used Conga Composer to create custom quotes. The client is an engineering firm and one of the quotes required employee hours billed under dynamic categories. The quote needed each employee’s hours listed under the associated category.

Here’s how to create the quote.

1. Create a report table in Salesforce using the schema builder. Give the table 10 or so text columns, and an identifier column that will store the object id of the associated Salesforce Opportunity object (i.e. a key in normal database nomenclature).

2. Create a hours master-detail object in Salesforce using the schema builder. In my example each hours billed will be grouped by a project role and part.

3. Create an APEX trigger that will fill the report table each time an hours item is added to our opportunity. I keep my APEX logic code in individual classes with a single APEX trigger – this keeps everything clean and easy to debug if you have multiple APEX triggers that are order dependent.

Categories
Salesforce

Salesforce Custom Hours Billed Quote with Conga Composer

For a recent client project working with the Salesforce.com platform I used Conga Composer to create custom quotes. The client is an engineering firm and one of the quotes required employee hours billed under dynamic categories. The quote needed each employee’s hours listed under the associated category.

Here’s how to create the quote.

Categories
Salesforce

Salesforce.com Data Download via Java Swing, RSSBus JDBC Driver, and Apache Commons Daemon

I recently developed an application that synchronizes Salesforce.com data to a local PC. The application is developed in Java using the Swing graphical framework and uses a Salesforce.com JDBC driver provided by RSSBus. The application stores Salesforce.com credentials and synchronization interval timing data in a Java properties file. The application allows non-graphical execution via the “nogui” command argument. I also include an Apache Commons Daemon class and script that allows running the application as a service.

Categories
Heroku, Google App Engine, Django

Developers and Side Projects

There’s a great article on Medium about Developer ADHD. The author explains why some developers have lots of unfinished side projects. Like the author I too have several unfinished side projects. I find I usually will give up on a side project after I’ve fully learned the underlying technology. Here’s the rundown of a few of these projects.

  1. Autodesk Revit PDF Printouts
    This app was actually the idea of one of my clients that I created during a lull in work. I tried a Kickstarter project to get funding but was unsuccessful so abandoned the project. There was a working demo that printed PDF drawings from Revit that were interlinked. Everything coded in C#.
    Revit1
    Revit2
    Revit3
  2. Business Foot Traffic Social Media Statistics
    I had the grand idea of tracking Facebook and Foursquare usage at a place of business. Unfortunately, Foursquare fell out of favor and I never finished the demo.

     

    Foursquare1
    Foursquare2

  3. World Newspaper App
    I did this demo almost 10 years ago when Extjs was the rage and YUI was still relevant. Its a map of the world with clickable newspaper icons that pulled in a RSS feed.

     

    Menkyo1
    Menkyo2

  4. Law School Notes App                                                            Instead of paying attention during classes in law school I created this app in Extjs to automate note taking.

    notes1
    notes2

5. DeliciouRSS Reader

This was my first project on Google App Engine in order to get acquainted with the platform and technology. https://deliciourss.appspot.com/

Categories
Uncategorized

Not a common thing when I get to point out a bug in Google’s code base.

Here’s a code fix I submitted to Google for a bug I found in their 3D serialization library.

https://github.com/google/draco/issues/29