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
red floydred floyd 

Contents of System Namespace?

Hi, I'm new to Apex programming, and I was wondering where I could find a reference to the contents of the System namespace? Thanks
zachelrathzachelrath

Your best friend in Apex development is this baby right here:

 

Apex Code Developer Guide (HTML)

 

Pretty much every standard Apex class is actually a System class, but you can generally do without the System namespace.

For instance, when coding to catch errors, you can use the shortcut names Exception, QueryException, DMLException --- but these are actually System.Exception, System.QueryException, System.DMLException, etc.

 

Likewise, when referencing a Visualforce Page in apex, you could just say Page.MyCoolVFPage, i.e.

 

public PageReference goToCoolPage() {

PageReference coolPage = Page.MyCoolVFPage;

return  coolPage;

}

 

but this is actually the same as:

 

PageReference coolPage = System.Page.MyCoolVFPage;

return coolPage;

 

 

As far as methods of the System class, look here:

 

Apex System class methods

 

(again, this is in the Apex dev docs, do a Search for "System methods"