+ Start a Discussion
Tobias HaggeTobias Hagge 

Query certain set of fields


We have a built a custom save class and want to only compare values of a certain set of fields, in our case all fields that are updateable and on the Visualforce page. Is there a way to query this subset of fields? It tries to get all fields that exist on the object, rather than only the ones from the controller.
What code are you using to compare fields?  And is you class part of an extension?  You should be able to limit the fields compared to only those you specify in a SOQL statement.
By using field sets you can be sure you always use the right set of fields both in the VisualForce page and in every query you use in the controller.
Refer to this docs http://www.salesforce.com/us/developer/docs/pages/Content/pages_dynamic_vf_field_sets.htm

May The Force.com be with you!