Get class fields bookmarklet

Usage

Drag Get Fields into bookmark bar and navigate to any Apex class, Trigger, or Visualforce page/component.

Motivation

I wanted something to list all the new fields for the class I have added to my helper also to add to a SOQL query. Parsing with sed is an option, but why not use what Salesforce already gives you? By applying .join(",\n") you can copy/paste directly into your code.

How it works

It gets class name by sniffing the URL. Then it is using undocumented Developer Console API to list all dependencies. Then another metadata API requests fullName from customField object. Salesforce only allows to query one record when querying fullName field.