You are here:
Create Follow-on Order API
The createFollowOnOrder API is invoked when customers want to capture a change to an inflight order after the inflight order has reached the Point of No Return (PONR).
In CPQ, you can create and submit a follow-on order for Order Management to fulfill. The follow-on order captures changes with respect to the order it is following. The changes can be:
-
Add a new order item, product, or promotion.
-
Remove an existing product or promotion.
-
Modify an order item that was part of the previous order, such as changes to an attribute.
-
Change an existing product line item, such as configuration, price, adjustments, and promotions.
-
Modify the order header data.
-
Disconnect the order item that was added or modified in the original order.
A follow-on order is queued until the original order is fulfilled (activated), then automatically submitted. The actual submission of the follow-on order happens through the Apex job that is scheduled from the Queued Orders tab.
The createFollowOnOrder API is only invoked for orders, not quotes or opportunities.
Apex
This API is exposed from the CpqAppHandler class. For example:
Id ordId = '8016g000000L4yG';
String methodName = 'createFollowOnOrder';
Map<String, Object> inputMap = new Map<String, Object> {
'cartId' => ordId
};
Map<String, Object> outputMap = new Map<String, Object>();
Map<String, Object> optionsMap = new Map<String, Object>();
CpqAppHandler handler = new CpqAppHandler();
handler.invokeMethod(methodName, inputMap, outputMap, optionsMap);
