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
Puneet Mehra 14Puneet Mehra 14 

Clearing all the values of fields in a field-set

Hello there! I have a requirement to clear just a subset of an object's fields. I thought I could use the fieldset and define a StandardController Extension class to work with the fieldset and clear the fields. The only other option I can think of is obj.fieldName = null; for the 50-odd fields that I have. 

Is this possible? Please let me know how. Thanks!
 
Rajiv Bhatt 16Rajiv Bhatt 16
just wondering if these 50 fields have anything in common? naming pattern, datatype, or anything else from the metadata that can help you to  distinguish them from other fields? if so there is an alternative solution.