Skip to content
Custom

Custom

The Custom step is designed to execute underlying Apex logic and register it within a Step Group. Every Custom Step must extend the forvendi.Step abstract class.

To learn more about how custom steps work, check out Understand Custom Steps in Practice.

Step 1: Create the Step Class

To streamline creating your custom class, use the Generate Step Code tool.

  1. Navigate to Breezz Setup → Step Groups → Select Step Group and click Generate Step Code.

Generate Step Code Button

  1. Copy the code below by clicking Copy to Clipboard and paste it into the Class window. The name will be fullfiled automatically. The generated boilerplate code is ready to use. Your custom functionality should be placed within the initRecordProcessing method.
// The class must extend the forvendi.Step abstract class
public with sharing class UppercaseNameFieldStep extends forvendi.Step {

    public UppercaseNameFieldStep() {
        // A public default constructor is required.
        // For technical reasons, the class name must be passed to the super constructor.
        // This ensures the framework can execute the step asynchronously and generate correct logs.
        super(UppercaseNameFieldStep.class.getName());
    }

    public override Boolean initRecordProcessing(Object record, Object optionalOldRecord) {
        // Cast the record parameter to SObject (assuming we are passing Account records)
        SObject sfRecord = (SObject)record;
        String recordName = (String)sfRecord.get('Name');
        
        // Manipulate the object data
        sfRecord.put('Name', String.isBlank(recordName) ? '' : recordName.trim().toUpperCase().replace('  ', '_'));
        
        // Return false to indicate we have all the data needed to finish the process in this context
        return false;
    }
}

Generate Step Code

  1. Click Deploy.

Note: The provided class simply formats the Name field of an SObject. Deploy this class to your Salesforce org before proceeding to the final step.

Step 2: Configure the Step

With the Step class successfully deployed, you must link it to the Step Group.

  1. Create a new Step, navigate to Breezz Setup → Step Groups → Select Step Group and click New Step, or simply create a step from the Dashboard by clicking the Create Step tile.

Add Step To Step Group

  1. Populate the configuration form with the following details:
  • Parent Group: Select a Step Group and provide a clear identifier for the step.
  • Description: Enter a comprehensive explanation of the step’s purpose (e.g., Changes all characters of an object field to uppercase.).
  • Order: Determine order of execution (e.g., 1).
  • Is Active: Determine if a step is active.
  • Feature Availability: Determines feature availability. For more information refer to the Feature Flags section.

In the Entry Criteria section, you can set the conditions a record must meet to trigger this step.

In the Action Configuration section:

  • Type: Select Custom.
  • Step Class Name: Provide the name of the deployed class (e.g., UppercaseNameFieldStep).
  1. After filling out all required fields, click Save.

Step 3: Verify the Step

To confirm that the step was created successfully, navigate to the Breezz Setup → Step Groups → Select Step Group on which you created a step.

You should see your new Step record listed here.

Step Record