Salesforce, Bugs & You
Bugs. Bleh. As far as I know Salesforce doesn’t maintain a list of ‘Known Issues’ and sadly this can mean hours poring over code, trying to find where you went wrong, and eventually finding that it wasn’t your code at all. Of course it wasn’t, because you are perfect. Go on give yourself a hug.
To this end I’ll post bugs as I find them and if you feel like contributing, mail me a few of your own. Some buggy areas are quite obscure, so I’ll start with a common one, the infamous ‘Null Param passed by a CommandButton’. Dun dun duh.
This bug is a tricky one, especially when you’ve just started working with Salesforce. There are so many things that you could’ve done wrong passing data from one page to another, so you examine each tiny area until you run out of patience and hit the discussion boards. Gotta love the boards.
A description of this bug would be something along the lines of:
I’m passing a value to a page using a param of a commandButton but the value is null on the receiving end. I’ve checked the debug logs and the value is not null at the time the button is pushed, please help!!!
If you’d like to recreate this bug your code would look something like this:
<apex:commandButton action="{!myAction}" value="SendANullParam"> <apex:param name="nullParm" value="{!myValue}"/> </apex:commandButton>
There are various workarounds for this, mostly depending on your situation, but the quickfix is simply to swap the commandButton for a commandLink and use the salesforce standard styleClass=”btn”.
<apex:commandLink action="{!myAction}" value="SendANullParam" styleClass="btn" style="color:white;text-decoration:none"> <apex:param name="nullParm" value="{!myValue}"/> </apex:commandLink>
Note that you’ll still have to do a bit of styling, but this will get you pretty close to where you need to be. Take that bugs, pew pew.
Written by Wes
June 12, 2009 at 4:54 pm
Posted in Bugs, SalesForce, VisualForce
Tagged with Apex, Bug, commandbutton, force.com, null, param, SalesForce, VisualForce
3 Responses
Subscribe to comments with RSS.
And always open a support case if you can. Depending on the issue it can sometimes be an easy fix. I have probably found and submitted at least 10 bugs, probably more. Some of these still aren’t fixed. While others were fixed in a week or two.
Jason
July 21, 2009 at 6:08 am
[…] Nolte has done a great job on his blog and the Salesforce.com message boards pointing out the problem and workarounds. A popular option is […]
Passing Parameters with a CommandButton | Jeff Douglas – Technology, Coding and Bears… OH MY!
March 4, 2010 at 12:21 pm
I know this is an old post, but Salesforce now has a Known Issues list!
http://success.salesforce.com/issues_index
vijay swamidass (@vijayswamidass)
May 2, 2012 at 1:30 am