function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Tobias HaggeTobias Hagge 

Query certain set of fields

Hello.

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.
BHinnersBHinners
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.
EnreecoEnreeco
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!