Table of Contents

Crm.Pricing.BonusPrograms Entity

Namespace: Crm.Pricing

Bonus programs allow automatic adding of new line with bonus product or automatic application of discount in a sales document. Entity: Crm_Bonus_Programs

Renames

Old name: Crm.Marketing.BonusPrograms
New name: Crm.Pricing.BonusPrograms
Version: 25.1.1.36
Case: 37717

Default Visualization

Default Display Text Format:
{Name:T}
Default Search Members:
Name
Name Data Member:
Name
Category: Definitions
Show in UI: ShownByDefault

Track Changes

Min level: 0 - Do not track changes
Max level: 4 - Track object attribute and blob changes

Aggregate

An aggregate is a cluster of domain objects that can be treated as a single unit.

Aggregate Tree

Attributes

Name Type Description
Active boolean nullable General condition if the bonus is active. The other conditions are verified only for active bonus programs. Default(true) Filter(eq)
BonusAction BonusAction If the bonus is a product, then Bonus Product, Bonus Product Quantity and Bonus Product Quantity Unit fields should be filled in. If the bonus is a discount, the Bonus Line Discount Percent should be filled in. Product - add product to the order, Discount – replace the standard discount, Cascade discount - apply after the standard discount. Required Default("D") Filter(multi eq)
BonusDocumentAmountPercent decimal (7, 6) nullable The percent of the document amount that is rewarded. Should be null if and only if the bonus document amount is null.
BonusLineDiscountPercent decimal (7, 6) The percent discount to be applied to bonus lines. Used only for bonus programs with Action = D (Discount) and Action = C (Cascade discount). Required Default(0)
BonusProductQuantity Quantity (12, 3) nullable The quantity rewarded of the bonus product. Should be not null if and only when the bonus product is not null. Unit: BonusProductQuantityUnit
BonusProductQuantity
MultiplierForEach
LotSize
Quantity (12, 3) nullable When not null, specifies that the bonus quantity should be multiplied for each of the specified lot size. Can be non-null only when condition product is specified. Unit: ConditionProduct.BaseMeasurementCategory.BaseUnit
ConditionCustomerFilterXML dataaccessfilter nullable When not null, specifies that the bonus should be applied only to customers who meet the specified criteria. The criteria could include custom properties. Unit: CustomersRepository.TableName
ConditionDistribution
ChannelFilterX
ML
dataaccessfilter nullable When not null, specifies that the bonus should be applied only when the distribution channel of the sales order has the specified characteristics. Unit: Marketing.DistributionChannels<br />Repository.TableName
ConditionFromDate datetime nullable Starting date of the bonus. null means that there is no starting date restriction. Filter(eq;ge;le)
ConditionMaxAmount Amount (12, 2) nullable If not null specifies the maximal amount for which the bonus is valid. null means that there is no maximal amount condition for the bonus. Currency: ConditionDocumentCurrency Filter(eq;ge;le)
ConditionMaxQuantity Quantity (12, 3) nullable When not null, specifies condition for the bonus - maximal quantity of the condition product. If the condition product is null, this cannot be specified. Unit: ConditionProduct.BaseMeasurementCategory.BaseUnit Filter(eq;ge;le)
ConditionMinAmount Amount (12, 2) nullable If not null specifies the minimal amount for which the bonus is valid. null means that there is no minimal amount condition for the bonus. Currency: ConditionDocumentCurrency Filter(eq;ge;le)
ConditionMinQuantity Quantity (12, 3) nullable When not null, specifies condition for the bonus - minimal quantity of the condition product. If the condition product is null, this cannot be specified. Unit: ConditionProduct.BaseMeasurementCategory.BaseUnit Filter(eq;ge;le)
ConditionShipTo
CustomerFilter
XML
dataaccessfilter nullable When not null, specifies that the bonus should be applied only when shipping to customer with the specified characteristics. Unit: CustomersRepository.TableName
ConditionToDate datetime nullable Ending date (inclusive) of the bonus. null means that there is no ending date restriction. Filter(eq;ge;le)
DisplayText string Uses the repository DisplayTextFormat to build the display text from the attributes and references of current object.
Id guid
Name MultilanguageString (254) The name of the bonus program. Required Filter(eq;like)
ObjectVersion int32 The latest version of the extensible data object for the aggregate root for the time the object is loaded from the database. Can be used for optimistic locking.
Priority Priority Priority (1-5) of the bonus program comparative to the other bonus programs. 1 is the lowest priority. Required Default(2) Filter(multi eq)

References

Name Type Description
BonusDocumentAmountType DocumentAmountTypes (nullable) When not null specifies that a document amount should be added to the order when the bonus conditions are met. null means that the bonus reward is not a document amount. Filter(multi eq)
BonusProduct Products (nullable) The product that is rewarded if the bonus conditions are met. null means that the bonus reward is not product. Filter(multi eq)
BonusProductQuantityUnit MeasurementUnits (nullable) The measurement unit of the quantity rewarded of the bonus product. Should be not null if and only when the bonus product is not null. Filter(multi eq)
Campaign Campaigns (nullable) Тhe marketing campaign to which the current definition belongs. Filter(multi eq) Introduced in version 22.1.4.67
CompanyLocation CompanyLocations (nullable) When set, specifies that the sales document must be of the specified enterprise company location. Filter(multi eq)
ConditionCustomer Customers (nullable) When not null, specifies that the bonus should be applied only to the specified customer. Filter(multi eq)
ConditionDistribution
Channel
DistributionChannels (nullable) When not null, specifies that the bonus should be applied only when the specified channel is used. Filter(multi eq)
ConditionDocumentCurrency Currencies (nullable) Condition for the document amount. Should be not null if any of the amount conditions are not null. Filter(multi eq)
ConditionPriceList PriceLists (nullable) When not null, specifies that the bonus should be applied only when the sales order is based on the speicfied price list. Filter(multi eq)
ConditionProduct Products (nullable) When not null, specifies a conditional product, which is required to exist in the sales document in order for the bonus program to be applied. If a condition with multiple products is required, additional products can be added to Bonus Program Products. If null the other conditions should be evaluated against the whole order. Filter(multi eq)
ConditionProductGroup ProductGroups (nullable) When not null, specifies that the bonus should be applied only to products from the specified product group or its subgroups. Filter(multi eq)
ConditionShipToCustomer Customers (nullable) When not null, specifies that the bonus should be applied only when shipping to the specified customer. Filter(multi eq)
ConditionTargetGroup TargetGroups (nullable) When not null, specifies that the bonus should be applied only to the specified target customer group. Filter(multi eq)
EnterpriseCompany EnterpriseCompanies (nullable) When set, specifies that the sales document must be of the specified enterprise company. Filter(multi eq)

Child Collections

Name Type Description
Products BonusProgramProducts List of BonusProgramProduct(Crm.Pricing.BonusProgramProducts.md) child objects, based on the Crm.Pricing.BonusProgramProduct.BonusProgram(Crm.Pricing.BonusProgramProducts.md#bonusprogram) back reference

Attribute Details

Active

General condition if the bonus is active. The other conditions are verified only for active bonus programs. Default(true) Filter(eq)

Type: boolean nullable
Category: System
Supported Filters: Equals
Supports Order By: False
Default Value: True
Show in UI: ShownByDefault

BonusAction

If the bonus is a product, then Bonus Product, Bonus Product Quantity and Bonus Product Quantity Unit fields should be filled in. If the bonus is a discount, the Bonus Line Discount Percent should be filled in. Product - add product to the order, Discount – replace the standard discount, Cascade discount - apply after the standard discount. Required Default("D") Filter(multi eq)

Type: BonusAction
Category: System
Allowed values for the BonusAction(Crm.Pricing.BonusPrograms.md#bonusaction) data attribute
Allowed Values (Crm.Pricing.BonusProgramsRepository.BonusAction Enum Members)

Value Description
Product Product value. Stored as 'P'.
Database Value: 'P'
Model Value: 0
Domain API Value: 'Product'
Discount Discount value. Stored as 'D'.
Database Value: 'D'
Model Value: 1
Domain API Value: 'Discount'
CascadeDiscount CascadeDiscount value. Stored as 'C'.
Database Value: 'C'
Model Value: 2
Domain API Value: 'CascadeDiscount'

Supported Filters: Equals, EqualsIn
Supports Order By: False
Default Value: Discount
Show in UI: ShownByDefault

BonusDocumentAmountPercent

The percent of the document amount that is rewarded. Should be null if and only if the bonus document amount is null.

Type: decimal (7, 6) nullable
Category: System
Supported Filters: NotFilterable
Supports Order By: False
Show in UI: CannotBeShown

BonusLineDiscountPercent

The percent discount to be applied to bonus lines. Used only for bonus programs with Action = D (Discount) and Action = C (Cascade discount). Required Default(0)

Type: decimal (7, 6)
Category: System
Supported Filters: NotFilterable
Supports Order By: False
Default Value: 0
Show in UI: ShownByDefault

BonusProductQuantity

The quantity rewarded of the bonus product. Should be not null if and only when the bonus product is not null. Unit: BonusProductQuantityUnit

Type: Quantity (12, 3) nullable
Category: System
Supported Filters: NotFilterable
Supports Order By: False
Show in UI: ShownByDefault

BonusProductQuantityMultiplierForEachLotSize

When not null, specifies that the bonus quantity should be multiplied for each of the specified lot size. Can be non-null only when condition product is specified. Unit: ConditionProduct.BaseMeasurementCategory.BaseUnit

Type: Quantity (12, 3) nullable
Category: System
Supported Filters: NotFilterable
Supports Order By: False
Show in UI: ShownByDefault

ConditionCustomerFilterXML

When not null, specifies that the bonus should be applied only to customers who meet the specified criteria. The criteria could include custom properties. Unit: CustomersRepository.TableName

Type: dataaccessfilter nullable
Category: System
Supported Filters: NotFilterable
Supports Order By: False
Show in UI: ShownByDefault

ConditionDistributionChannelFilterXML

When not null, specifies that the bonus should be applied only when the distribution channel of the sales order has the specified characteristics. Unit: Marketing.DistributionChannelsRepository.TableName

Type: dataaccessfilter nullable
Category: System
Supported Filters: NotFilterable
Supports Order By: False
Show in UI: ShownByDefault

ConditionFromDate

Starting date of the bonus. null means that there is no starting date restriction. Filter(eq;ge;le)

Type: datetime nullable
Category: System
Supported Filters: Equals, GreaterThanOrLessThan
Supports Order By: False
Show in UI: ShownByDefault

ConditionMaxAmount

If not null specifies the maximal amount for which the bonus is valid. null means that there is no maximal amount condition for the bonus. Currency: ConditionDocumentCurrency Filter(eq;ge;le)

Type: Amount (12, 2) nullable
Category: System
Supported Filters: Equals, GreaterThanOrLessThan
Supports Order By: False
Show in UI: ShownByDefault

ConditionMaxQuantity

When not null, specifies condition for the bonus - maximal quantity of the condition product. If the condition product is null, this cannot be specified. Unit: ConditionProduct.BaseMeasurementCategory.BaseUnit Filter(eq;ge;le)

Type: Quantity (12, 3) nullable
Category: System
Supported Filters: Equals, GreaterThanOrLessThan
Supports Order By: False
Show in UI: ShownByDefault

ConditionMinAmount

If not null specifies the minimal amount for which the bonus is valid. null means that there is no minimal amount condition for the bonus. Currency: ConditionDocumentCurrency Filter(eq;ge;le)

Type: Amount (12, 2) nullable
Category: System
Supported Filters: Equals, GreaterThanOrLessThan
Supports Order By: False
Show in UI: ShownByDefault

ConditionMinQuantity

When not null, specifies condition for the bonus - minimal quantity of the condition product. If the condition product is null, this cannot be specified. Unit: ConditionProduct.BaseMeasurementCategory.BaseUnit Filter(eq;ge;le)

Type: Quantity (12, 3) nullable
Category: System
Supported Filters: Equals, GreaterThanOrLessThan
Supports Order By: False
Show in UI: ShownByDefault

ConditionShipToCustomerFilterXML

When not null, specifies that the bonus should be applied only when shipping to customer with the specified characteristics. Unit: CustomersRepository.TableName

Type: dataaccessfilter nullable
Category: System
Supported Filters: NotFilterable
Supports Order By: False
Show in UI: ShownByDefault

ConditionToDate

Ending date (inclusive) of the bonus. null means that there is no ending date restriction. Filter(eq;ge;le)

Type: datetime nullable
Category: System
Supported Filters: Equals, GreaterThanOrLessThan
Supports Order By: False
Show in UI: ShownByDefault

DisplayText

Uses the repository DisplayTextFormat to build the display text from the attributes and references of current object.

Type: string
Category: Calculated Attributes
Supported Filters: NotFilterable
Supports Order By: ****
Show in UI: HiddenByDefault

Id

Type: guid
Indexed: True
Category: System
Supported Filters: Equals, EqualsIn
Default Value: NewGuid
Show in UI: CannotBeShown

Name

The name of the bonus program. Required Filter(eq;like)

Type: MultilanguageString (254)
Category: System
Supported Filters: Equals, Like
Supports Order By: False
Show in UI: ShownByDefault

ObjectVersion

The latest version of the extensible data object for the aggregate root for the time the object is loaded from the database. Can be used for optimistic locking.

Type: int32
Category: Extensible Data Object
Supported Filters: NotFilterable
Supports Order By: ****
Show in UI: HiddenByDefault

Priority

Priority (1-5) of the bonus program comparative to the other bonus programs. 1 is the lowest priority. Required Default(2) Filter(multi eq)

Type: Priority
Category: System
Allowed values for the Priority(Crm.Pricing.BonusPrograms.md#priority) data attribute
Allowed Values (Crm.Pricing.BonusProgramsRepository.Priority Enum Members)

Value Description
v_1Lowest v_1Lowest value. Stored as 0.
Database Value: 0
Model Value: 0
Domain API Value: 'v_1Lowest'
Two Two value. Stored as 1.
Database Value: 1
Model Value: 1
Domain API Value: 'Two'
Three Three value. Stored as 2.
Database Value: 2
Model Value: 2
Domain API Value: 'Three'
Four Four value. Stored as 3.
Database Value: 3
Model Value: 3
Domain API Value: 'Four'
v_5Highest v_5Highest value. Stored as 4.
Database Value: 4
Model Value: 4
Domain API Value: 'v_5Highest'

Supported Filters: Equals, EqualsIn
Supports Order By: False
Default Value: 2
Show in UI: ShownByDefault

Reference Details

BonusDocumentAmountType

When not null specifies that a document amount should be added to the order when the bonus conditions are met. null means that the bonus reward is not a document amount. Filter(multi eq)

Type: DocumentAmountTypes (nullable)
Category: System
Supported Filters: Equals, EqualsIn
Show in UI: CannotBeShown

BonusProduct

The product that is rewarded if the bonus conditions are met. null means that the bonus reward is not product. Filter(multi eq)

Type: Products (nullable)
Category: System
Supported Filters: Equals, EqualsIn
Show in UI: ShownByDefault

BonusProductQuantityUnit

The measurement unit of the quantity rewarded of the bonus product. Should be not null if and only when the bonus product is not null. Filter(multi eq)

Type: MeasurementUnits (nullable)
Category: System
Supported Filters: Equals, EqualsIn
Show in UI: ShownByDefault

Campaign

Тhe marketing campaign to which the current definition belongs. Filter(multi eq) Introduced in version 22.1.4.67

Type: Campaigns (nullable)
Category: System
Supported Filters: Equals, EqualsIn
Show in UI: ShownByDefault

CompanyLocation

When set, specifies that the sales document must be of the specified enterprise company location. Filter(multi eq)

Type: CompanyLocations (nullable)
Category: System
Supported Filters: Equals, EqualsIn
Show in UI: ShownByDefault

ConditionCustomer

When not null, specifies that the bonus should be applied only to the specified customer. Filter(multi eq)

Type: Customers (nullable)
Category: System
Supported Filters: Equals, EqualsIn
Show in UI: ShownByDefault

ConditionDistributionChannel

When not null, specifies that the bonus should be applied only when the specified channel is used. Filter(multi eq)

Type: DistributionChannels (nullable)
Category: System
Supported Filters: Equals, EqualsIn
Show in UI: ShownByDefault

ConditionDocumentCurrency

Condition for the document amount. Should be not null if any of the amount conditions are not null. Filter(multi eq)

Type: Currencies (nullable)
Category: System
Supported Filters: Equals, EqualsIn
Show in UI: ShownByDefault

ConditionPriceList

When not null, specifies that the bonus should be applied only when the sales order is based on the speicfied price list. Filter(multi eq)

Type: PriceLists (nullable)
Category: System
Supported Filters: Equals, EqualsIn
Show in UI: ShownByDefault

ConditionProduct

When not null, specifies a conditional product, which is required to exist in the sales document in order for the bonus program to be applied. If a condition with multiple products is required, additional products can be added to Bonus Program Products. If null the other conditions should be evaluated against the whole order. Filter(multi eq)

Type: Products (nullable)
Indexed: True
Category: System
Supported Filters: Equals, EqualsIn
Show in UI: ShownByDefault

ConditionProductGroup

When not null, specifies that the bonus should be applied only to products from the specified product group or its subgroups. Filter(multi eq)

Type: ProductGroups (nullable)
Category: System
Supported Filters: Equals, EqualsIn
Show in UI: ShownByDefault

ConditionShipToCustomer

When not null, specifies that the bonus should be applied only when shipping to the specified customer. Filter(multi eq)

Type: Customers (nullable)
Category: System
Supported Filters: Equals, EqualsIn
Show in UI: ShownByDefault

ConditionTargetGroup

When not null, specifies that the bonus should be applied only to the specified target customer group. Filter(multi eq)

Type: TargetGroups (nullable)
Category: System
Supported Filters: Equals, EqualsIn
Show in UI: ShownByDefault

EnterpriseCompany

When set, specifies that the sales document must be of the specified enterprise company. Filter(multi eq)

Type: EnterpriseCompanies (nullable)
Category: System
Supported Filters: Equals, EqualsIn
Show in UI: ShownByDefault

API Methods

Methods that can be invoked in public APIs.

GetAllowedCustomPropertyValues

Gets the allowed values for the specified custom property for this entity object. If supported the result is ordered by property value. Some property value sources do not support ordering - in that case the result is not ordered.
Return Type: Collection Of CustomPropertyValue
Declaring Type: EntityObject
Domain API Request: GET

Parameters

  • customPropertyCode
    The code of the custom property
    Type: string

  • search
    The search text - searches by value or description. Can contain wildcard character %.
    Type: string
    Optional: True
    Default Value: null

  • exactMatch
    If true the search text should be equal to the property value
    Type: boolean
    Optional: True
    Default Value: False

  • orderByDescription
    If true the result is ordered by Description instead of Value. Note that ordering is not always possible.
    Type: boolean
    Optional: True
    Default Value: False

  • top
    The top clause - default is 10
    Type: int32
    Optional: True
    Default Value: 10

  • skip
    The skip clause - default is 0
    Type: int32
    Optional: True
    Default Value: 0

CreateNotification

Create a notification immediately in a separate transaction, and send a real-time event to the user.
Return Type: void
Declaring Type: EntityObject
Domain API Request: POST

Parameters

  • user
    The user.
    Type: Users

  • notificationClass
    The notification class.
    Type: string

  • subject
    The notification subject.
    Type: string

CreateCopy

Duplicates the object and its child objects belonging to the same aggregate. The duplicated objects are not saved to the data source but remain in the same transaction as the original object.
Return Type: EntityObject
Declaring Type: EntityObject
Domain API Request: POST

Business Rules

None

Front-End Business Rules

None

API

Domain API Query: https://demodb.my.erp.net/api/domain/odata/Crm_Pricing_BonusPrograms?$top=10

Domain API Query Builder: https://demodb.my.erp.net/api/domain/querybuilder#Crm_Pricing_BonusPrograms?$top=10