SCM

scmc.InventoryAPI

global with sharing class InventoryAPI

This class is used to support all the various actions that are performed on inventory.

Author

Financial Force, Inc.

Methods

miscellaneousReceipt

global scmc__Inventory_Position__c miscellaneousReceipt(ID warehouseId, ID itemId, Double quantity, String lotNumber, String serialNumber, DateTime expirationDate, ID reasonId, ID conditionCodeId, Boolean inspectionRequired, Double value)

Receive an item into inventory.

Input Parameters

Name Type Description
warehouseId ID The Id of an SCM warehouse to put the received inventory.
itemId ID The Id of an SCM item master.
quantity Double The number of items to receive.
lotNumber String The lot number of the item to receive. Only applicable if the item is lot controlled. All items must have the same lot number.
serialNumber String The serial number of the item to receive. Only applicable if the item is serial number controlled. Quantity should be 1 if this is used.
expirationDate DateTime The shelf life expiration of the item. Only applicable if the item is shelf life controlled. Expressed as a DateTime.
reasonId ID The Id of an SCM reason code.
conditionCodeId ID The Id of an SCM condition code.
inspectionRequired Boolean Indicates if the item needs to be inspected after receipt.
value Double The current value of a single unit of the received item.

Exceptions Thrown

Value Description
InventoryPositionException If there is a validation issue or an error receiving the inventory.
SCMException If there is a serial number related issue.

Return Value

Inventory_Position__c The created inventory record.

miscellaneousReceipt

global scmc__Inventory_Position__c miscellaneousReceipt(ID warehouseId, ID itemId, Double quantity, String lotNumber, String serialNumber, DateTime expirationDate, ID reasonId, ID conditionCodeId, Boolean inspectionRequired, Double value, ID ownerId)

Receive an item into inventory.

Input Parameters

Name Type Description
warehouseId ID The Id of an SCM warehouse to put the received inventory.
itemId ID The Id of an SCM item master.
quantity Double The number of items to receive.
lotNumber String The lot number of the item to receive. Only applicable if the item is lot controlled. All items must have the same lot number.
serialNumber String The serial number of the item to receive. Only applicable if the item is serial number controlled. Quantity should be 1 if this is used.
expirationDate DateTime The shelf life expiration of the item. Only applicable if the item is shelf life controlled. Expressed as a DateTime.
reasonId ID The Id of an SCM reason code.
conditionCodeId ID The Id of an SCM condition code.
inspectionRequired Boolean Indicates if the item needs to be inspected after receipt.
value Double The current value of a single unit of the received item.
ownerId ID The Id of a Salesforce user who will own the new inventory record.

Exceptions Thrown

Value Description
InventoryPositionException If there is a validation issue or an error receiving the inventory.
SCMException If there is a serial number related issue.

Return Value

Inventory_Position__c The created inventory record.

miscellaneousReceipt

global scmc__Inventory_Position__c miscellaneousReceipt(ID warehouseId, ID itemId, Double quantity, String lotNumber, String serialNumber, DateTime expirationDate, ID reasonId, ID conditionCodeId, Boolean inspectionRequired, Double value, ID ownerId, ID ownership)

Receive an item into inventory.

Input Parameters

Name Type Description
warehouseId ID The Id of an SCM warehouse to put the received inventory.
itemId ID The Id of an SCM item master.
quantity Double The number of items to receive.
lotNumber String The lot number of the item to receive. Only applicable if the item is lot controlled. All items must have the same lot number.
serialNumber String The serial number of the item to receive. Only applicable if the item is serial number controlled. Quantity should be 1 if this is used.
expirationDate DateTime The shelf life expiration of the item. Only applicable if the item is shelf life controlled. Expressed as a DateTime.
reasonId ID The Id of an SCM reason code.
conditionCodeId ID The Id of an SCM condition code.
inspectionRequired Boolean Indicates if the item needs to be inspected after receipt.
value Double The current value of a single unit of the received item.
ownerId ID The Id of a Salesforce user who will own the new inventory record.
ownership ID The Id of an SCM ownership code who will own the new inventory.

Exceptions Thrown

Value Description
InventoryPositionException If there is a validation issue or an error receiving the inventory.
SCMException If there is a serial number related issue.

Return Value

Inventory_Position__c The created inventory record.

miscellaneousReceipt

global scmc__Inventory_Position__c miscellaneousReceipt(ID warehouseId, ID itemId, Double quantity, String lotNumber, String serialNumber, DateTime expirationDate, ID reasonId, ID conditionCodeId, Boolean inspectionRequired, Double value, ID ownerId, ID ownership, String comments)

Receive an item into inventory.

Input Parameters

Name Type Description
warehouseId ID The Id of an SCM warehouse to put the received inventory.
itemId ID The Id of an SCM item master.
quantity Double The number of items to receive.
lotNumber String The lot number of the item to receive. Only applicable if the item is lot controlled. All items must have the same lot number.
serialNumber String The serial number of the item to receive. Only applicable if the item is serial number controlled. Quantity should be 1 if this is used.
expirationDate DateTime The shelf life expiration of the item. Only applicable if the item is shelf life controlled. Expressed as a DateTime.
reasonId ID The Id of an SCM reason code.
conditionCodeId ID The Id of an SCM condition code.
inspectionRequired Boolean Indicates if the item needs to be inspected after receipt.
value Double The current value of a single unit of the received item.
ownerId ID The Id of a Salesforce user who will own the new inventory record.
ownership ID The Id of an SCM ownership code who will own the new inventory.
comments String Comments added to the resulting perpetual inventory tranaction record.

Exceptions Thrown

Value Description
InventoryPositionException If there is a validation issue or an error receiving the inventory.
SCMException If there is a serial number related issue.

Return Value

Inventory_Position__c The created inventory record.

miscellaneousReceipt

global scmc__Inventory_Position__c miscellaneousReceipt(ID warehouseId, ID itemId, Double quantity, String lotNumber, set<String> serialNumbers, DateTime expirationDate, ID reasonId, ID conditionCodeId, Boolean inspectionRequired, Double value, ID ownerId, ID ownership, String comments)

Receive an item into inventory.

Input Parameters

Name Type Description
warehouseId ID The Id of an SCM warehouse to put the received inventory.
itemId ID The Id of an SCM item master.
quantity Double The number of items to receive.
lotNumber String The lot number of the item to receive. Only applicable if the item is lot controlled. All items must have the same lot number.
serialNumbers set<String> A set of Strings representing the serial numbers of the items to receive. Only applicable if the item is serial number controlled. This allows for more than one quantity to be received.
expirationDate DateTime The shelf life expiration of the item. Only applicable if the item is shelf life controlled. Expressed as a DateTime.
reasonId ID The Id of an SCM reason code.
conditionCodeId ID The Id of an SCM condition code.
inspectionRequired Boolean Indicates if the item needs to be inspected after receipt.
value Double The current value of a single unit of the received item.
ownerId ID The Id of a Salesforce user who will own the new inventory record.
ownership ID The Id of an SCM ownership code who will own the new inventory.
comments String Comments added to the resulting perpetual inventory tranaction record.

Exceptions Thrown

Value Description
InventoryPositionException If there is a validation issue or an error receiving the inventory.
SCMException If there is a serial number related issue.

Return Value

Inventory_Position__c The created inventory record.

miscellaneousIssue

global void miscellaneousIssue(Id inventoryPositionId, Id reasonId, Double quantity, String comments)

Issue an item out of inventory.

Input Parameters

Name Type Description
inventoryPositionId Id The ID of an SCM inventory position record to issue.
reasonId Id The ID of an SCM reason code.
quantity Double The number of items to issue.
comments String Comments added to the resulting perpetual inventory transaction record.

Exceptions Thrown

Value Description
InventoryPositionException An exception is thrown if there is a validation error while issuing the inventory.

Return Value

Does not return a value.

miscellaneousIssue

global void miscellaneousIssue(Id inventoryPositionId, Id reasonId, Double quantity)

Issue an item out of inventory.

Input Parameters

Name Type Description
inventoryPositionId Id The ID of an SCM inventory position record to issue.
reasonId Id The ID of an SCM reason code.
quantity Double The number of items to issue.

Exceptions Thrown

Value Description
InventoryPositionException An exception is thrown if there is a validation error while issuing the inventory.

Return Value

Does not return a value.

miscellaneousIssue

global void miscellaneousIssue(Id inventoryPositionId, Id reasonId, Double quantity, set<String> serialNumbers, String comments)

Issue an item out of inventory.

Input Parameters

Name Type Description
inventoryPositionId Id The ID of an SCM inventory position record to issue.
reasonId Id The ID of an SCM reason code.
quantity Double The number of items to issue.
serialNumbers set<String> A set of strings representing the serial numbers of the items to issue. Only applicable if the item is serial number controlled.
comments String Comments added to the resulting perpetual inventory transaction record.

Exceptions Thrown

Value Description
InventoryPositionException An exception is thrown if there is a validation error while issuing the inventory.

Return Value

Does not return a value.

inspect

global void inspect(scmc__Receiving_Inspection__c[] inspections, String stampNumber)

Complete a receiving inspection.

Input Parameters

Name Type Description
inspections scmc__Receiving_Inspection__c[] A list of Ids of SCM receiving inspection records.
stampNumber String A user's stamp number.

Exceptions Thrown

Value Description
ReceivingInspectionException If there is a validation issue or an error completing the inspection.

Return Value

Does not return a value.

locate

global void locate(scmc__Inventory_Position__c[] origPosns, String locn)

Put inventory positions in a specific inventory location. This will also complete associated put away action queue entries.

Input Parameters

Name Type Description
origPosns scmc__Inventory_Position__c[] A list of SCM inventory position records.
locn String The name of an SCM inventory location. All specified inventory positions will be put in the same location. Location must be in the inventory's current warehouse.

Exceptions Thrown

Value Description
InventoryPositionException If there is an error completing the locate transaction.

Return Value

Does not return a value.

locate

global void locate(scmc__Inventory_Position__c origPosn, String locn)

Put an inventory position in a specific inventory location. Inventory must be in the 'Receiving' location. This will also complete associated put away action queue entries.

Input Parameters

Name Type Description
origPosn scmc__Inventory_Position__c An SCM inventory position record.
locn String The name of an SCM inventory location. Location must be in the inventory's current warehouse.

Exceptions Thrown

Value Description
InventoryPositionException If there is an error completing the locate transaction.

Return Value

Does not return a value.

issueKit

global void issueKit(scmc__Item__c item, Double quantity)

Complete a miscellaneous issue transaction for all items in the bill of material for a specified item.

Input Parameters

Name Type Description
item scmc__Item__c An SCM item record.
quantity Double How many of the kit item to issue. This will be multiplied by the quantity per assembly of each of the BOM items.

Exceptions Thrown

Value Description
KitIssueException If the BOM is not found for the specified item.
InventoryPositionException If there is an error completing the issue transaction.

Return Value

Does not return a value.

AdjustValue

global void AdjustValue(scmc__Inventory_Position__c origPosn, Double value, Id reasonId, String comments)

Adjust the current value of the inventory position passed in.

Input Parameters

Name Type Description
origPosn scmc__Inventory_Position__c The existing inventory position.
value Double The new current value for the inventory position.
reasonId Id The ID of the reason code for this transaction.
comments String The comments to associate with the change.

Exceptions Thrown

Value Description
InventoryPositionException An exception that describes the error adjusting the current value.

Return Value

Does not return a value.

AdjustCondition

global void AdjustCondition(scmc__Inventory_Position__c origPosn, Id conditionCodeId, Id reasonId, String comments)

This method is not supported in this version.

AdjustOwnership

global void AdjustOwnership(scmc__Inventory_Position__c origPosn, Id ownership, Id reasonId, String comments)

This method is not supported in this version.

massTransfer

global void massTransfer(Id picklistId, Id toLocation, Id reasonCodeId, String comments)

Transfer inventory from an existing picklist to another location.

Input Parameters

Name Type Description
picklistId Id The Id of an SCM picklist.
toLocation Id The Id of an SCM inventory location.
reasonCodeId Id The Id of an SCM reason code.
comments String Comments added to the resulting perpetual inventory tranaction record.

Exceptions Thrown

Value Description
PicklistException If there is an error transferring the inventory.

Return Value

Does not return a value.

move

global void move(Map<ID, Double> ipIdToMoveQuantity, Id toLocation, Id reasonCodeId, String comments)

Move inventory positions to a specific location. The current location of the inventory cannot be Receiving or Receiving Inspection.

Input Parameters

Name Type Description
ipIdToMoveQuantity Map<ID, Double> A map with an SCM inventory position as the key and a quantity indicating how much to move for the value.
toLocation Id The Id of an SCM inventory location. This must be in the same warehouse as the existing inventory.
reasonCodeId Id The Id of an SCM reason code.
comments String Comments added to the resulting perpetual inventory tranaction record.

Exceptions Thrown

Value Description
InventoryPositionException If there is an error moving the inventory.

Return Value

Does not return a value.

confirmPullParts

global void confirmPullParts(Id picklistId)

Confirm the pulling of the items on the picklist.

Input Parameters

Name Type Description
picklistId Id The Id of the picklist to be confirmed.

Exceptions Thrown

Value Description
InventoryPositionException with message indicating the the reason for the failure to confirm the picklist

Return Value

Does not return a value.

scmc.InventoryAPI.POReceiptLine

global class POReceiptLine

Class to hold purchase order receipt line information.

Properties

Name Type Description
poLineId Id Id of an SCM purchase order line.
qtyReceiving decimal The quantity to receive.
lotNumber String The lot number of the item to receive. Only applicable if the item is lot controlled.
serialNumbers String[] A list of Strings representing the serial numbers to receive. Only applicable if the item is serial number controlled.

Methods

POReceiptLine

global POReceiptLine()

Simple constructor.

receivePO

global void receivePO(Id poId, scmc.InventoryAPI.POReceiptLine[] poRecLines)

Receives one or more lines on a purchase order.

Input Parameters

Name Type Description
poId Id The salesforce Id of the Purchase Order to receive.
poRecLines scmc.InventoryAPI.POReceiptLine[] An array of InventoryAPI.POReceipLine's describing the items to receive.

Exceptions Thrown

Value Description
ReceiptException An exception that describes an error receiving the purchase order.

Return Value

Does not return a value.

scmc.InventoryAPI.KitIssueException

global class KitIssueException extends Exception }

© Copyright 2009–2020 FinancialForce.com, inc. Confidential – all rights reserved. Various trademarks held by their respective owners.