SCM Apex API Developer Reference

scmc.Pricing

global with sharing class Pricing

Class to manage pricing

Author

Financial Force, Inc.

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 SCM 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 an SCM Condition 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)

Price 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 an SCM Condition Code record.
priceType Id The Id of an SCM 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

An SCM 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)

Price 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 an SCM Condition Code record.

Exceptions Thrown

Value Description
noException This method does not throw an exception.

Return Value

An SCM 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)

Price an item based on specified criteria. The item and condition used is what is specified in the 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 an SCM Price Type record.

Exceptions Thrown

Value Description
noException This method does not throw an exception.

Return Value

An SCM 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)

Price an item based on specified criteria. The item and condition used is what is specified in the 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

An SCM 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 Id of an Account record.
priceType Id Id of an SCM 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 Id of an SCM Price Type record.

Exceptions Thrown

Value Description
noException This method does not throw an exception.

Return Value

Does not return a value.

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