Order and Inventory Management Apex API Developer Reference

scmc.RecurringPurchaseOrderService

global with sharing class RecurringPurchaseOrderService

A service to provide recurring Purchase Order functionality.

Methods

create

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

Creates recurring purchase orders from a given purchase order. Recurring purchase orders created from an approved purchase order have the same record type value as the original purchase order by default. The purchase order from which the recurring purchase order is created must have the Recurring Purchase Order? check box checked and a status of Approved.

Input Parameters

Name Type Description
purchaseOrderIdSet Set<Id> The IDs from the purchase orders from which the recurring purchase order will be created.

Exceptions Thrown

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

Return Value

Map<Id, List<Id>> where the key is the given purchase order ID and the 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);

createFromPurchaseContract

global static void createFromPurchaseContract(scmc.CreateFromPurchaseContractRequest request)

Creates a recurring purchase order from the specified purchase contract. The new purchase order is an Approved Internal Purchase Order record type by default.

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–2023 Certinia Inc. All rights reserved. Various trademarks held by their respective owners.