Customize the Retail Order Save Process

To customize the retail order save process, create a callable Apex class as a customization hook.

  1. Log in to your Salesforce org, and go to Developer Console.

  2. Create a global Apex class that implements the System.Callable interface.

  3. Override the global call method that has these parameters.

    • action: String. The behavior for the method to exhibit.
    • params: Map<String,Object>. Arguments to be used by the specified action. The object is of type RE_Order. The RE_Order class exposes methods to access the retail order sObject. For a list of all the exposed methods, see RE_Order Class Reference.

    Here’s the Apex class structure.

  4. To modify the order fields, use the methods exposed by the RE_Order class.

    Add your customizations in the Apex class to:

    • Create retail order records.
    • Modify and delete existing retail order records.

    Here’s a sample Apex class that adds a custom sObject record during the order save process.

    For use cases related to the order save process customization, see Retail Order Save Customization Use Cases.

  5. From Setup, in the Quick Find box, enter Custom Metadata Types, and then expand Custom Metadata Types.

  6. Click Manage Records on the CGCloud Process Customization row.

  7. Click New, fill in these details, and then save your work.

    • Label: RE_Order_Save
    • DeveloperName: RE_Order_Save
    • Class: <Your Callable APEX Class>
    • Method: save
    • Enabled: Select the checkbox

The Apex customization hook is enabled. When a retail order is saved, the call method modifies the saved order based on your custom logic.