Creating Active Classes
This page covers the administrative work of creating an Active Class record: choosing a class type and setting metadata. Authoring the source code is done in the IDE (/sys/ide) and is documented in the Developer Guide. Most developers work entirely in the IDE; this Setup page is the administrative entry point for creating the record.
Requirements
- Administrator System Role.
- If the new class will be a Trigger or Controller for an existing entity or page, that entity or Active Page should already exist.
Open the Classes & Triggers List
- From the Setup home page, go to Develop > Classes & Triggers.
- The list shows every Active Class in the portal with its Label, Name, Type, Version, and last-modified-by metadata.
Create an Active Class
- From the list, click New.
- Choose the class Type:
- Class / Interface — a reusable unit of business logic. Used directly from Active Pages, from other Active Classes, from Triggers, or as a Controller backing a page.
- Controller — an Active Class that handles requests for one or more Active Pages. Synchronous actions returning ActionResponse; can render Active Pages with View().
- AsyncController — a controller whose action methods are all asynchronous. Suited to async REST endpoints, Iris data endpoints, file streaming, and outbound integrations. Cannot render Active Pages with View(). See the Developer Guide for the AspxAsyncController base class details.
- Trigger — runs automatically before or after entity record events. Pick the entity and the lifecycle event in the IDE.
- Test — a unit-test class that verifies other Active Class behavior.
- Fill in the class properties:
- Label — the human-readable name shown in admin lists.
- Name — the API name used in code. Must start with a letter and contain only letters, digits, and underscores. No spaces or special characters. Cannot be changed after creation if the class is referenced.
- Version — pick a framework version (2.0, 3.0, 4.0, or 5.0). Choose the latest version unless you have a specific reason to target an older one.
- Description — an internal note describing the class's purpose.
- Click Save. The class is created with default starter code. You are now on the class's detail view.
Open the IDE
The IDE is the workspace for authoring source code. The Setup record view only manages metadata; the IDE is a separate environment.
Two ways to open the IDE for an existing class:
- From the class's detail view at Setup > Develop > Classes & Triggers, click the Open in IDE button. The IDE opens in a new tab with the class loaded.
- Or open the IDE directly at /sys/ide. Most developers work this way once they're actively building.
The Update form on the Setup page does include a small inline code editor with an Open in IDE toggle, but for non-trivial work the full IDE is the productive choice. Save any changes in the inline editor before switching to the IDE so you don't lose work.
Authoring source is a developer activity. See:
After Creating the Class
- If the class is a Controller, attach it to one or more Active Pages by editing those pages and selecting it in the Controller field.
- If the class is a Trigger, the IDE associates it with a specific entity and lifecycle event during code authoring; once saved and active, it runs automatically.
- Configure sharing if non-administrators need to execute the class's public actions.
Cloning a Class
To create a similar class quickly:
- From Setup > Develop > Classes & Triggers, open the Active Class.
- Click the kebab menu and select Clone.
- The new class opens with a copy of the original's source, Type, and Version. Provide a new Name and Label.
- Click Save.
Cloning does not copy sharing settings.
Troubleshooting Tips
- If a class won't save because the Name is invalid, verify it starts with a letter and contains only letters, digits, and underscores.
- If a Controller doesn't appear in an Active Page's Controller dropdown, verify its Type is Controller and the class compiled successfully on its last save.
- For execution and access symptoms, see Active Pages Troubleshooting.
<< Creating and Managing Active Pages | Managing Active Classes >>