Crm.Pricing.LineDiscounts Entity
Namespace: Crm.Pricing
Discount policies for sales documents. Entity: Crm_Line_Discounts
Renames
Old name: **Crm.LineDiscounts **
New name: Crm.Pricing.LineDiscounts
Version: 25.1.1.36
Case: 37717
Default Visualization
Default Display Text Format:
{DiscountPercent:P} {Description}
Default Search Members:
__
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 |
---|---|---|
Description | string (50) nullable | The description of the discount that is shown to the operator when he/she should choose between different discounts. Filter(like) |
DiscountLevel | DiscountLevel | Specifies the cascade level (1..3), on which the discount is applied. The discounts from level 1,2 and 3 are applied to three different discount fields in the sales order. The discount for each level is determined separately, by applying the same algorithm. Required Default("1") Filter(multi eq) ORD Introduced in version 23.1.2.8 |
DiscountPercent | decimal (7, 6) | The discount percent that should be applied if all the matching criteria are met. Required Default(0) Filter(ge;le) |
DisplayText | string | Uses the repository DisplayTextFormat to build the display text from the attributes and references of current object. |
FromDate | datetime nullable | Starting date of validity of the discount. null means no from date restriction. Filter(eq;ge;le) |
Id | guid | |
IsActive | boolean | Indicates whether the current Line Discount is active. Required Default(true) Filter(eq) Introduced in version 24.1.2.5 |
MaxQuantity | Quantity (18, 3) nullable | Apply the discount only if the quantity sold is equal to or less than the specified here. Unit: Product.BaseMeasurementCategory.BaseUnit Filter(eq;ge;le) |
MinQuantity | Quantity (18, 3) nullable | Apply the discount only if the quantity sold is equal to or more than the specified here. Unit: Product.BaseMeasurementCategory.BaseUnit Filter(eq;ge;le) |
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 | The priority of this discount policy. When selecting a discount for a sales document line, only the highest priority policy, matching the criteria is applied. Required Default(3) |
ThruDate | datetime nullable | Ending date (inclusive) of validity of the discount. If null, the discount is valid forever. Filter(eq;ge;le) |
References
Name | Type | Description |
---|---|---|
Campaign | Campaigns (nullable) | Тhe marketing campaign to which the current definition belongs. Filter(multi eq) Introduced in version 22.1.4.67 |
Customer | Customers (nullable) | Apply the discount only if this is the customer. Filter(multi eq) |
CustomerType | CustomerTypes (nullable) | Apply the discount only if the customer is of this customer type. Filter(multi eq) |
DistributionChannel | DistributionChannels (nullable) | Apply the discount only when the sales document is on the specified channel. Filter(multi eq) |
DocumentAmountType | DocumentAmountTypes (nullable) | The document amount type that is used as category for this discount. When specified, triggers the recording of the applied discount amount in the Document Distributed Amounts panel in sales orders. Filter(multi eq) Introduced in version 25.1.1.26 |
EnterpriseCompany | EnterpriseCompanies (nullable) | When not null, the policy is applied only for documents of the specified enterprise company . Filter(multi eq) |
EnterpriseCompanyLocation | CompanyLocations (nullable) | When set, the policy is applied only for documents of the specified enterprise company location. Filter(multi eq) |
PriceList | PriceLists (nullable) | Apply the discount only if this price list is used. Filter(multi eq) |
Product | Products (nullable) | Apply the discount only when this specific product is sold. Filter(multi eq) |
ProductGroup | ProductGroups (nullable) | Apply the discount only if the product sold is contained in this product group or any of its sub-groups. Filter(multi eq) |
TargetGroup | TargetGroups (nullable) | Apply the discount only if the customer is included in this target group. Filter(multi eq) |
Attribute Details
Description
The description of the discount that is shown to the operator when he/she should choose between different discounts. Filter(like)
Type: string (50) nullable
Category: System
Supported Filters: Like
Supports Order By: False
Maximum Length: 50
Show in UI: ShownByDefault
DiscountLevel
Specifies the cascade level (1..3), on which the discount is applied. The discounts from level 1,2 and 3 are applied to three different discount fields in the sales order. The discount for each level is determined separately, by applying the same algorithm. Required
Default("1")
Filter(multi eq)
ORD
Introduced in version 23.1.2.8
Type: DiscountLevel
Indexed: True
Category: System
Allowed values for the DiscountLevel
(Crm.Pricing.LineDiscounts.md#discountlevel) data attribute
Allowed Values (Crm.Pricing.LineDiscountsRepository.DiscountLevel Enum Members)
Value | Description |
---|---|
One | One value. Stored as '1'. Database Value: '1' Model Value: 0 Domain API Value: 'One' |
Two | Two value. Stored as '2'. Database Value: '2' Model Value: 1 Domain API Value: 'Two' |
Three | Three value. Stored as '3'. Database Value: '3' Model Value: 2 Domain API Value: 'Three' |
Supported Filters: Equals, EqualsIn
Supports Order By: True
Default Value: One
Show in UI: ShownByDefault
DiscountPercent
The discount percent that should be applied if all the matching criteria are met. Required
Default(0)
Filter(ge;le)
Type: decimal (7, 6)
Category: System
Supported Filters: GreaterThanOrLessThan
Supports Order By: False
Default Value: 0
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
FromDate
Starting date of validity of the discount. null means no from date restriction. Filter(eq;ge;le)
Type: datetime nullable
Category: System
Supported Filters: Equals, GreaterThanOrLessThan
Supports Order By: False
Show in UI: ShownByDefault
Id
Type: guid
Indexed: True
Category: System
Supported Filters: Equals, EqualsIn
Default Value: NewGuid
Show in UI: CannotBeShown
IsActive
Indicates whether the current Line Discount is active. Required
Default(true)
Filter(eq)
Introduced in version 24.1.2.5
Type: boolean
Category: System
Supported Filters: Equals
Supports Order By: False
Default Value: True
Show in UI: ShownByDefault
MaxQuantity
Apply the discount only if the quantity sold is equal to or less than the specified here. Unit: Product.BaseMeasurementCategory.BaseUnit
Filter(eq;ge;le)
Type: Quantity (18, 3) nullable
Category: System
Supported Filters: Equals, GreaterThanOrLessThan
Supports Order By: False
Show in UI: ShownByDefault
MinQuantity
Apply the discount only if the quantity sold is equal to or more than the specified here. Unit: Product.BaseMeasurementCategory.BaseUnit
Filter(eq;ge;le)
Type: Quantity (18, 3) nullable
Category: System
Supported Filters: Equals, GreaterThanOrLessThan
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
The priority of this discount policy. When selecting a discount for a sales document line, only the highest priority policy, matching the criteria is applied. Required
Default(3)
Type: Priority
Category: System
Generic enum type for Priority properties
Allowed Values (General.Priority Enum Members)
Value | Description |
---|---|
Lowest | Lowest value. Stored as 1. Database Value: 1 Model Value: 1 Domain API Value: 'Lowest' |
Low | Low value. Stored as 2. Database Value: 2 Model Value: 2 Domain API Value: 'Low' |
Medium | Medium value. Stored as 3. Database Value: 3 Model Value: 3 Domain API Value: 'Medium' |
High | High value. Stored as 4. Database Value: 4 Model Value: 4 Domain API Value: 'High' |
Highest | Highest value. Stored as 5. Database Value: 5 Model Value: 5 Domain API Value: 'Highest' |
Supported Filters: NotFilterable
Supports Order By: False
Default Value: 3
Show in UI: ShownByDefault
ThruDate
Ending date (inclusive) of validity of the discount. If null, the discount is valid forever. Filter(eq;ge;le)
Type: datetime nullable
Category: System
Supported Filters: Equals, GreaterThanOrLessThan
Supports Order By: False
Show in UI: ShownByDefault
Reference Details
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
Customer
Apply the discount only if this is the customer. Filter(multi eq)
Type: Customers (nullable)
Indexed: True
Category: System
Supported Filters: Equals, EqualsIn
Show in UI: ShownByDefault
CustomerType
Apply the discount only if the customer is of this customer type. Filter(multi eq)
Type: CustomerTypes (nullable)
Category: System
Supported Filters: Equals, EqualsIn
Show in UI: ShownByDefault
DistributionChannel
Apply the discount only when the sales document is on the specified channel. Filter(multi eq)
Type: DistributionChannels (nullable)
Indexed: True
Category: System
Supported Filters: Equals, EqualsIn
Show in UI: ShownByDefault
DocumentAmountType
The document amount type that is used as category for this discount. When specified, triggers the recording of the applied discount amount in the Document Distributed Amounts panel in sales orders. Filter(multi eq)
Introduced in version 25.1.1.26
Type: DocumentAmountTypes (nullable)
Category: System
Supported Filters: Equals, EqualsIn
Show in UI: ShownByDefault
EnterpriseCompany
When not null, the policy is applied only for documents of the specified enterprise company . Filter(multi eq)
Type: EnterpriseCompanies (nullable)
Category: System
Supported Filters: Equals, EqualsIn
Show in UI: HiddenByDefault
EnterpriseCompanyLocation
When set, the policy is applied only for documents of the specified enterprise company location. Filter(multi eq)
Type: CompanyLocations (nullable)
Category: System
Supported Filters: Equals, EqualsIn
Show in UI: ShownByDefault
Front-End Recalc Expressions:
IIF( ( ( obj.EnterpriseCompanyLocation != null) AndAlso ( obj.EnterpriseCompanyLocation.Company != obj.EnterpriseCompany)), null, obj.EnterpriseCompanyLocation.Company)
PriceList
Apply the discount only if this price list is used. Filter(multi eq)
Type: PriceLists (nullable)
Category: System
Supported Filters: Equals, EqualsIn
Show in UI: ShownByDefault
Product
Apply the discount only when this specific product is sold. Filter(multi eq)
Type: Products (nullable)
Indexed: True
Category: System
Supported Filters: Equals, EqualsIn
Show in UI: ShownByDefault
ProductGroup
Apply the discount only if the product sold is contained in this product group or any of its sub-groups. Filter(multi eq)
Type: ProductGroups (nullable)
Category: System
Supported Filters: Equals, EqualsIn
Show in UI: ShownByDefault
TargetGroup
Apply the discount only if the customer is included in this target group. Filter(multi eq)
Type: TargetGroups (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: stringsearch
The search text - searches by value or description. Can contain wildcard character %.
Type: string
Optional: True
Default Value: nullexactMatch
If true the search text should be equal to the property value
Type: boolean
Optional: True
Default Value: FalseorderByDescription
If true the result is ordered by Description instead of Value. Note that ordering is not always possible.
Type: boolean
Optional: True
Default Value: Falsetop
The top clause - default is 10
Type: int32
Optional: True
Default Value: 10skip
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: UsersnotificationClass
The notification class.
Type: stringsubject
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
API
Domain API Query: https://demodb.my.erp.net/api/domain/odata/Crm_Pricing_LineDiscounts?$top=10
Domain API Query Builder: https://demodb.my.erp.net/api/domain/querybuilder#Crm_Pricing_LineDiscounts?$top=10