Customize the Retail Order Proposal List Creation Process
To customize the order proposal list creation 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.
Here’s the Apex class structure.
-
Modify the list of products displayed on the order proposal list UI based on your custom logic.
Here’s a sample Apex code that adds additional product IDs from a custom object,
Proposed_Products__c, and the IDs that belong to the beverages product category to the list of proposed products. -
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_Proposal_List - DeveloperName:
RE_Order_Proposal_List - Class:
<Your Callable APEX Class> - Method:
proposalList - Enabled: Select the checkbox
Before invoking the customization hook, ensure that the Consider Listing setting in Order Template is set to Yes.
- Label:
Your Apex customization hook is enabled. When an order proposal list is created, the call method modifies the proposed product list based on your custom logic.