Order and Inventory Management Apex API Developer Reference

scmc.Pricing

global with sharing class Pricing

Class to manage pricing

Methods

Pricing

global Pricing(Map<String, List<scmc__Price__c>> priceItemList)

Constructor to initialize pricing when pricing records have already been queried. This version of the constructor is used in the quoting tool. After an upload, in the trigger there are multiple lines that need to be priced all at once. This constructor reduces the number of SOQL queries.

Input Parameters

Name Type Description
priceItemList Map<String, List<scmc__Price__c>> A map with item names as the key and a list of Price objects as the value.

Exceptions Thrown

Value Description
noException This method does not throw an exception.

Return Value

Does not return a value.

Pricing

global Pricing(String item, Id condition)

Constructor to initialize pricing when there is only a single item. For bulk processing, Pricing(String[] items) should be used instead.

Input Parameters

Name Type Description
item String An item name.
condition Id The ID of a condition code record.

Exceptions Thrown

Value Description
noException This method does not throw an exception.

Return Value

Does not return a value.

Pricing

global Pricing(String[] items)

Constructor to initialize pricing for multiple items at once. This should be used instead of Pricing(Map<String, List<Price__c>> priceItemList).

Input Parameters

Name Type Description
items String[] A list of item names.

Exceptions Thrown

Value Description
noException This method does not throw an exception.

Return Value

Does not return a value.

price

global scmc__Price__c price(String item, Decimal requestedQuantity, scmc.Pricing.CustomerType customer, Id condCode, Id priceType, String currencyIsoCode)

Prices an item based on specified criteria. Customer specific pricing is checked first, followed by promotional pricing, followed by standard pricing.

Input Parameters

Name Type Description
item String An item name.
requestedQuantity Decimal The quantity that should be priced.
customer scmc.Pricing.CustomerType A CustomerType object.
condCode Id The ID of a condition code record.
priceType Id The ID of a price type record. If specified, this overrides any price type in the customer parameter.
currencyIsoCode String A currency code. Used in multi-currency environments to specify the currency the returned price should be in.

Exceptions Thrown

Value Description
SCMException If error converting price currency.

Return Value

A price record that matches the specified criteria. If no price record is found, this returns null.

price

global scmc__Price__c price(String item, Decimal requestedQuantity, scmc.Pricing.CustomerType customer, Id condCode)

Prices an item based on specified criteria. Customer specific pricing is checked first, followed by promotional pricing, followed by standard pricing.

Input Parameters

Name Type Description
item String An item name.
requestedQuantity Decimal The quantity that should be priced.
customer scmc.Pricing.CustomerType A CustomerType object.
condCode Id The ID of a condition code record.

Exceptions Thrown

Value Description
noException This method does not throw an exception.

Return Value

A price record that matches the specified criteria. If no price record is found, this returns null.

price

global scmc__Price__c price(Decimal requestedQuantity, Id customer, Id priceType)

Prices an item based on specified criteria. The item and condition used is what is specified in the scmc.Pricing (String item, ID condition) constructor. This should not be used for bulk processing. Customer specific pricing is checked first, followed by promotional pricing, followed by standard pricing.

Input Parameters

Name Type Description
requestedQuantity Decimal The quantity that should be priced.
customer Id A CustomerType object.
priceType Id The ID of a price type record.

Exceptions Thrown

Value Description
noException This method does not throw an exception.

Return Value

A price record that matches the specified criteria. If no price record is found, this returns null.

price

global scmc__Price__c price(Decimal requestedQuantity, Id customer)

Prices an item based on specified criteria. The item and condition used is what is specified in the scmc.Pricing (String item, Id condition) constructor. This should not be used for bulk processing. Customer specific pricing is checked first, followed by promotional pricing, followed by standard pricing.

Input Parameters

Name Type Description
requestedQuantity Decimal The quantity that should be priced.
customer Id A CustomerType object.

Exceptions Thrown

Value Description
noException This method does not throw an exception.

Return Value

A price record that matches the specified criteria. If no price record is found, this returns null.

scmc.Pricing.CustomerType

global with sharing class CustomerType

Class to hold customer information for pricing.

Properties

Name Type Description
customer Id The ID of an account record.
priceType Id The ID of a price type record.

Methods

CustomerType

global CustomerType(Id customer, Id priceType)

Constructor to initialize customer and price type.

Input Parameters

Name Type Description
customer Id Id of an Account record.
priceType Id The ID of a price type record.

Exceptions Thrown

Value Description
noException This method does not throw an exception.

Return Value

Does not return a value.

© Copyright 2009–2023 Certinia Inc. All rights reserved. Various trademarks held by their respective owners.