SCM Apex API Developer Reference

scmc.PurchaseContractsService

global with sharing class PurchaseContractsService

This class is used to support all the various actions that are performed on a purchase contract.

Enums

DeleteChangeRequestLineAnswerResultType

Methods

cancelPurchaseContract

global static void cancelPurchaseContract(Set<Id> purchaseContractIds)

Cancels the specified purchase contracts.

Input Parameters

Name Type Description
purchaseContractIds Set<Id> The IDs of the purchase contracts to be canceled.

Exceptions Thrown

Value Description
DMLException Indicates an issue with a DML statement, such as an "insert" statement missing a required field on a record.

activatePurchaseContract

global static void activatePurchaseContract(Set<Id> purchaseContractIds)

Activates the specified purchase contracts and their purchase contract lines.

Input Parameters

Name Type Description
purchaseContractIds Set<Id> The IDs of the purchase contracts to be activated.

Exceptions Thrown

Value Description
DMLException Indicates an issue with a DML statement, such as an "insert" statement missing a required field on a record.

applyChangeRequest

global static scmc.PurchaseContractsService.ApplyChangeRequestAnswer applyChangeRequest(Id changeRequestId)

Applies the specified change request to its purchase contract. Only approved change requests can be applied.

Input Parameters

Name Type Description
changeRequestId Id The ID of the change request to be applied.

Return Value

This method returns an ApplyChangeRequestAnswer object.

createChangeRequests

global static Map<Id, scmc.PurchaseContractsService.CreateChangeRequestsAnswer> createChangeRequests(Set<Id> purchaseContractIds)

Creates change requests for the specified purchase contracts. Change request can only be created for active contracts.

Input Parameters

Name Type Description
purchaseContractIds Set<Id> The IDs of the purchase contracts that change requests will be created for.

Return Value

This method returns a map of purchase contract IDs and CreateChangeRequestsAnswer objects.

deleteChangeRequestLine

global static Map<Id, scmc.PurchaseContractsService.DeleteChangeRequestLineAnswer> deleteChangeRequestLine(Set<Id> changeRequestLinesIds)

Deletes the specified change request lines. Lines associated with an original contract line are set to a status of Expired.

Input Parameters

Name Type Description
changeRequestLinesIds Set<Id> The IDs of the change request lines to be deleted.

Return Value

This method returns a map of line IDs and deleteChangeRequestLineAnswer objects.

scmc.PurchaseContractsService.ApplyChangeRequestAnswer

global inherited sharing class ApplyChangeRequestAnswer

This class is used as the object returned by the applyChangeRequest global service. This object contains a change request ID and the ID of the purchase contract it is applied to. If a change request ID is invalid and cannot be applied, an error message is returned instead of the purchase contract ID.

Properties

Name Type Description
ChangeRequestId Id
OriginalContractId Id
ErrorMessage String

Methods

ApplyChangeRequestAnswer

global ApplyChangeRequestAnswer()

scmc.PurchaseContractsService.CreateChangeRequestsAnswer

global inherited sharing class CreateChangeRequestsAnswer

This class is used as the object returned by the createChangeRequests global service. This object contains the IDs of the created change requests. If a change request is not created due to one or more errors, a list of error messages is returned instead of the change request ID.

Properties

Name Type Description
ChangeRequestId Id
ErrorMessagesList List<String>

Methods

CreateChangeRequestsAnswer

global CreateChangeRequestsAnswer()

scmc.PurchaseContractsService.DeleteChangeRequestLineAnswer

global inherited sharing class DeleteChangeRequestLineAnswer

This class is used as the object returned by the deleteChangeRequestLine global service. This object contains the ID of the change request that the deleted line belongs to and the status that the line is set to (Expired or Deleted). If a line cannot be deleted because its ID is invalid, an error message is returned instead of the line status.

Properties

Name Type Description
PurchaseContractId Id
Result scmc.PurchaseContractsService.DeleteChangeRequestLineAnswerResultType
Errors List<String>

Methods

DeleteChangeRequestLineAnswer

global DeleteChangeRequestLineAnswer()

© Copyright 2009–2022 FinancialForce.com, inc. All rights reserved. Various trademarks held by their respective owners.