SCM Apex API Developer Reference


global with sharing class RecurringPurchaseOrderService

A service to provide recurring Purchase Order functionality.



global static Map<Id, List<Id>> create(Set<Id> purchaseOrderIdSet)

The create method creates Recurring Purchase Orders from a given Purchase Order. The Purchase Order from which the Recurring Purchase Orders are created must have the Recurring Purchase Order? check box checked and the Purchase Order must be approved.

Input Parameters

Name Type Description
purchaseOrderIdSet Set<Id> The IDs of Purchase orders from which recuring Purchase orders will be created.

Exceptions Thrown

Value Description
An exception indicating a problem encountered during the recurring process.

Return Value

Map<Id, List<Id>> where key is the given Purchase order ID and value is a list of ids for the newly created recurring Purchase Orders against the key.

Sample Code

//Note: This sample code is for demonstration purposes only. It is not intended for
//use in a production environment, is not guaranteed against defects or errors, and
//is in no way optimized or streamlined.

Set<Id> purchaseOrderIds = new Set<Id>{'a069E0000004NBO'};

Map<Id,List<Id>> recurringPOIdsByPOIds = SCMC.RecurringPurchaseOrderService.create(purchaseOrderIds);


global static void createFromPurchaseContract(scmc.CreateFromPurchaseContractRequest request)

Creates a recurring purchase order from the specified purchase contract.

Input Parameters

Name Type Description
request scmc.CreateFromPurchaseContractRequest A CreateFromPurchaseContractRequest object containing the data required to create the recurring purchase order.

Exceptions Thrown

Value Description
RecurringPurchaseOrderServiceException Indicates a problem during the creation of the purchase orders.
© Copyright 2009–2022, inc. All rights reserved. Various trademarks held by their respective owners.