Tuesday, August 24, 2010

Passing Data between Visualforce Pages with Controllers and Extensions

I spent a fair amount of time yesterday trying to figure out how to pass information back and forth between Visualforce pages, despite finding a pretty good article in the Force.com IDE Library.

"Creating a Wizard with Visualforce Pages"
http://www.salesforce.com/us/developer/docs/cookbook/Content/vf_wizard.htm

The article got me started, but then when I moved to the actual implementation in which I wanted to use controller extensions, I would be able to pass data between pages until I started including the extensions. I was left scratching away at my head for a while.

Finally, after many trials and errors, I came to the following conclusion: In order for data to be maintained from page to page, both the controller and the extension(s) referenced must be the same across all pages in the group.

For example, assume that the following Apex classes exist:
  • MyController
  • MyPage1Ext
  • MyPage2Ext

Also assume that I am trying to pass data between the following two pages, each of which uses the functionality included in the corresponding extension:
  • MyPage1
  • MyPage2

If I specify different attributes extensions="MyPage1Ext" and extensions="MyPage2Ext" for the two pages, then I am unable to pass data back and forth even if I specify the same controller. The trick is to use the same controller and the same extensions on both pages via the attribute extensions="MyPage1Ext,MyPage2Ext".

This is a bit depressing to know, but at least now I have a framework within I can build my actual application.

Wednesday, August 18, 2010

How to Fix Backspace in SSH Session to Unix ksh Terminal

I've been annoyed for a while now by the fact that when I start an SSH session to a AIX server that uses KornShell (ksh), my backspace key no longer deletes the character immediately preceding the cursor.

Luckily, I came across a forum thread that gave a solution for this annoyance.

"KSH Terminal Settings"
http://www.unix.com/unix-dummies-questions-answers/25310-ksh-terminal-settings.html

What I found out was that I could start the SSH session and then type the command stty erase ^H, which would enable me to delete correctly both within the SSH session and in my native Mac OS X Terminal after I ended the session.

The only (possible) problem is: Now that I've changed the erase character on the server, it appears to have "stuck". So, I hope other people who are accessing the server don't suddenly find that their backspace keys have now stopped working...

Monday, August 9, 2010

Salesforce CSV Format for Report Exports Is Not IETF RFC 4180-compliant

At the time of writing this post, I believe the published standard for CSV file formatting is the IETF RFC 4180.

Also at the time of writing this post, I believe that the Summer 2010 version Salesforce does not produce IETF RFC 4180-compliant CSV files for exported reports.

Here are a few differences in the Salesforce CSV file:
  • Salesforce uses a single LF ('\n') to start a new row of data instead of a CRLF ('\r\n').

  • Salesforce exports line breaks in street addresses with just a LF instead of the CRLF specified by the RFC.


A few more noteworthy considerations for the Salesforce report CSV files:
  • All values are delimited with double-quotes.

  • Salesforce does double double-quotes for values that contain the double-quotes character, as stipulated in the RFC.

  • For Text Area fields, Salesforce does convert line breaks in the field value to CRLF sequences, with the exception of native Street fields.

  • There is a footer in the CSV file that does not contain any data at all, which may complicate straight data imports into other systems or programs like Microsoft Access.

Wednesday, August 4, 2010

Putting a Name with a User ID in DegreeWorks

I came across a question once about what users all exist in DegreeWorks. I couldn't figure out the issue at first, so I created an SR with the AL and got some pointers that ultimately led me to the following query:

select shp_access_id, rad_name
from shp_user_mst, rad_primary_mst
where shp_access_id=rad_id
order by shp_access_id;


This query showed me the names associated with each of the logins to DegreeWorks.

On a side note: The DegreeWorks schema is not documented in any of the PDF publications. Instead, the schema is explained in files that are created during the server installation inside the .../app/schema/ directory:
  • dapdb
  • raddb
  • shpdb