June 4, 2013

Adding new fields can break existing visualforce pages

I recently came across an interesting discussion where adding new field to a Object broke some of existing code. It’s strange right, mostly removing or renaming fields is risky, as they could break some String expressions or merge fields.

Here is the error in one of the possible form for “Name” field

Unknown property 'VisualforceArrayList.Name'
Error is in expression '{!Contact.Location__r.Name}' in component <apex:page> in page abhinav:contactss

Here is one quick way to end up in this problem: