Syntax Highlighter JS

Thursday, September 13, 2012

Retroactive undocumented changes in the force?

If you have programmed for a while, you might be familiar with the component object model.  This isn't new technology as it was introduced by MS way back in 1993 and is well documented.

One of the big parts of COM was the fact that interfaces were not versioned.  If any change was made to an interface then that became a totally new interface.  It is because of this design that any time you call an interface you should know exactly how it behaves because it never changes.

Salesforce provides version settings for apex and visual force pages for exactly this reason.  Here is a quote from their documentation:

"This ensures that as Apex, the API, and the components in managed packages evolve in subsequent released versions, a class or trigger is still bound to versions with specific, known behavior."

As I have previously reported,  Salesforce sometimes makes undocumented changes that affect apex classes and/or visual force pages - even if they are set to a previous version.

Today I noticed another interesting but undocumented change in the force platform.  Previously, if you tried to use an action component with a input file tag in your visual force page you would receive an error like this:

"apex:inputFile can not be used in conjunction with an action component, apex:commandButton or apex:commandLink that specifies a rerender or oncomplete attribute."

While working on another post, I tried to recreate this error in a page set to version 20.  To my surpise, I was able to save the page.   Of course, the action status didn't actually work with the file upload.

EDIT:  After wrapping the form in an output panel and setting the command button to rerender said output panel, I now receive the above error upon clicking the button on the page (as opposed to saving the page file).  So the error checking was moved from an obvious place to one where you can only find the issue by testing.

I made some changes to the page and changed the version to 25 and still no error and no functionality.   I checked the visual force developers guide to see if it still mentioned these limitations (as it did in the past) but they were no where to be found.  I know from previous experience this used to be a documented limitation.

Why did sales force remove the error checking and documentation for this limitation without actually making it work?   Also shouldn't such changes be limited to the new version?

This is important because it causes things to mysteriously break after updates.  If you are an independent software vendor or large corporation then you will most likely avoid these kinds of issues due to through testing of your system upon each release.

With the push to have more and more businesses move to the cloud, what about the smaller businesses? or the sole proprietor?  They end up spending money on consultants or spending time to figure out the cause and work around to problems that simply shouldn't have existed in the first place.  

With these kinds of undocumented changes going on, it can be very profitable for consultants go 'fix' code that was already working.

This case was a very limited example that had little to no actual impact but these kinds of changes go by unnoticed until something breaks.  I mean seriously, how often would you notice something behaving slightly different?  Most of the time you aren't going to notice this kind of thing until an actual error occurs.

No comments:

Post a Comment