I want to get the name and label of all the fields for multiple sobjects in one transaction and that will easily hit the governor limits. Is there anyway I can get the label/name without using a describe for each field? A mass describe for fields?
- Anybody can ask a question
- Anybody can answer
- The best answers are voted up and rise to the top
No, but the limits around field describes are probobly much more generous than you think. You're allowed up to 100 static compile-time field references (e.g.
The limits for dynamic describes are even more generous in most situations, and can be combined with this compile-time format for more flexibility. Quoting a very related answer of mine:
You can get a
Which limit are you concerned about hitting?
You can get all field Names for an object using a single describe. But I think not the label. The
Here's an example using exactly
If you want the Label that strikes me as more of a UI concern. And if you break out into Visualforce, you can do as many