Thursday, October 21, 2010

Default Status for Emails Synced through Salesforce for Outlook

The default Status value that is assigned to emails synced via Salesforce for Outlook is not the oldest Status value, but rather the first Status value on the list that marks an Activity as Completed.

For example, the Status picklist had the following options:
  1. Not Started
  2. In Progress
  3. Completed
Then, I inserted a new option before "Completed":
  1. Not Started
  2. In Progress
  3. Completed through another activity
  4. Completed
When I sync an email with Salesforce for Outlook, the email is not recorded with Status set to "Completed". Instead, the email is now logged with Status set to "Completed through another activity".

To fix this problem, all I have to do is reorder the picklist so that "Completed" comes before "Completed through another activity". There is no need to delete any picklist options and then recreate them.

Wednesday, October 20, 2010

IETF RFC 4180-compliant CSV Reader for Salesforce

After several failed attempts at creating an IETF RFC 4180-compliant CSV reader for Salesforce, I finally have a candidate of an Apex Class that may be able to fit the bill for reading a compliant CSV file and returning a nested List where the outer List contains row records, and the inner List contains the sequential values in that row.

Edit

Posting the code within a PRE tag did not work. Let's try this download link instead.

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

Tuesday, July 27, 2010

Salesforce, Internet Explorer 8 and the Missing DOCTYPE Declaration

All of my frustration with IE8 is now divided 25-75 between IE8 and Salesforce, with most of the frustration on Salesforce.

The layout scheme I described in my previous post works in all browsers except in IE8 when implemented as a Salesforce Visualforce page. Offline, I was able to reproduce the issue with the source code saved from the offending Visualforce page. Then, furthermore I was able to fix the issue by adding a simple DOCTYPE declaration at the top of the page.

The layout issues appear to be caused by the fact that Salesforce does not generate a !DOCTYPE tag at the top of the page, and IE8 just happens to assume a different !DOCTYPE than Firefox or Chrome. The !DOCTYPE that IE8 assumes must not be compatible with CSS 2.1 and HTML 4.1, the standards that I am trying to follow (although I'm probably making some mistakes along the way as well).

Regardless, Salesforce's Developerforce article "Using the Salesforce CSS in Your Apps" explicitly states (at my last viewing of the page on July 27, 2010 at 6:13 PM EDT):

Please ensure that you define the following DOCTYPE at the top of your HTML:

<!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">


Ironically, if I try to add the !DOCTYPE tag before the apex:page tag, I get the following error:

Error: java.lang.NullPointerException
Error: null


Furthermore, if I try to add the !DOCTYPE tag immediately after the apex:page tag, I get a different error:

Error: A DOCTYPE is not allowed in content. at line 2


I found a Salesforce Community thread that talked about this issue, but the resolution is ambiguous to me and does not clearly show how to get the infinitely important !DOCTYPE tag into the page. The thread "Changing doctype of a Visualforce Page" shows many people having success with getting the !DOCTYPE tag to stick, but for some reason it is still not working for me.

I'm going to log a case with Premier Support and poke around some more to see if I can't get this to work in the next 15 minutes before the lights shut off here in the office.