Skip to main content
fusionCore groups common multi-step tasks into service classes. A service bundles the code, the event-framework hooks it fires, and the supporting metadata behind one entry point, so callers get a single, well-defined method instead of re-implementing the steps themselves. Before you write new logic, check whether a service method already exists for the task — or whether your new logic belongs inside an existing service rather than in a fresh class. Reaching for a service first keeps the multi-step flow (and its event hooks) consistent everywhere it runs. For the lower-level helpers these services build on, see Utility Functions.

Platform Services (FCORE_BASE)

The Platform services are available to every package. Reference them under the FCORE_BASE namespace. JobRunService.createAndRunJob(Id jobGroupId) returns List<Job_Run_Stage__c> — the staged work it created and queued.

Commerce Services (FCORE_PAY)

The Commerce services handle order, financial-event, payment, and form/table configuration flows.

Subscriptions (FCORE_MEM)

The Subscriptions package does not expose *Service classes. Its multi-step tasks live in engine classes that are invoked through event-framework hooks rather than called directly — see the subscription events on the Event Framework page.
  • SubscriptionRenewalEngine — creates renewal orders from renewal paths; invoked by GenerateRenewalOrderEH when the GenerateRenewalOrder event fires.
  • ProrationPriceCalculator / AdvancedJoinProrationPriceCalculator — proration pricing for mid-term subscription purchases, plugged into the Commerce CalculatePrice flow via the pricing engine.
  • SubscriptionTermCalculator — calculates subscription term start and end dates.

Services Fire Event Hooks

Package services fire event-framework hooks at key steps. For example, activating an order fires the GenerateInvoice event. Those hooks are what let other packages extend a flow — by registering an event handler — without modifying the service that fires them. When you build a new service, fire an event at the points where another package might reasonably need to add behavior, and document the event on the Event Framework page.