Customize the Retail Order Save Process
To customize the retail order save process, create a callable Apex class as a customization hook.
-
Log in to your Salesforce org, and go to Developer Console.
-
Create a global Apex class that implements the
System.Callableinterface. -
Override the global
callmethod 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 typeRE_Order. TheRE_Orderclass 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.
-
To modify the order fields, use the methods exposed by the
RE_Orderclass.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.
-
From Setup, in the Quick Find box, enter
Custom Metadata Types, and then expand Custom Metadata Types. -
Click Manage Records on the CGCloud Process Customization row.
-
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
- Label:
The Apex customization hook is enabled. When a retail order is saved, the call method modifies the saved order based on your custom logic.