1

I have many groups of fields and I'm planning on using these groupings to create both list views and Visualforce pages.

Is there any way to create each grouping once and use it in both places, or do I need to create both a separate list view and a separate field set for each grouping?

1

Without using the Metadata API, you certainly need to create these two components separately. There is no option when configuring a List View to use a predefined Field Set. You just select them one at a time.

Step 3. Select Fields to Display

  • If I made a call to the metadata api each time the visualforce page loaded, I'd be worried about the load times being too long. My thought now is to keep a single separate master list for each grouping and write a script to update both the related list view and field set whenever a change to the master list. – martin Aug 4 '16 at 3:01
  • It would be easier to make one or the other master and then just run a job periodically. @martin Probably easier to use the Field Set as master since you don't even need the Metadata API to read it, which I think you do for List View, at least to get the fields on it. – Adrian Larson Aug 4 '16 at 3:04
  • Also each field grouping will be used on multiple list views. – martin Aug 4 '16 at 3:12
  • @martin Right, so you would probably want a custom setting that allows you to track each Field Set > List View mapping and then loop through them to execute the Metadata API, probably as a batch, but I'm not sure. – Adrian Larson Aug 4 '16 at 3:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.