Condition: ConditionDetails__c Field Specification
List of conditions a product must meet in order to apply a discount to it. This field should be filled out differently depending on the Calculation Type record type.
Record Type: Condition
Applies to Condition and Freebie Condition records.
The Condition will be applied if the Discount Rate Location field has the Condition Record value. Otherwise, for the Level Record value, the system checks the product quantity for the Basic calculation method or the conditionLevel key in the Advanced Criteria JSON for the Advanced calculation type.
For Calculation Type with the Condition record type, specify a JSON with the conditions a product must meet.
| When the Calculation Type with the Condition record type is a child record of the Calculation Type with the Group + Condition record, refer to Record Type: Group + Condition. |
{ "conditions": {
"operator": "AND",
"items": [
{
"field": "orders__PromotionId__c", // For a Promotion with External Id, specify orders__PromotionId__r.orders__ExternalId__c
"operator": "equal",
"value": "a0C6g000000RfLPEA0" // Salesforce ID or External ID
},
{
"field": "orders__PromotionLineItemId__r.orders__isExcludeFromDiscount__c",
"operator": "equal",
"value": "false"
},
{
"field": "orders__PromotionLineItemId__r.RecordType.DeveloperName",
"operator": "equal",
"value": "PromotionProduct"
}
]
}
}
JSON Key Description
Condition Details
| Key | Type | Required | Comment |
|---|---|---|---|
conditions |
Object |
No |
Conditions a product must meet in order to apply a discount to it. |
Condition
Key |
Type |
Required |
Comment |
operator |
Enum |
Yes |
Available values:
|
items |
Array |
Yes |
The required conditions. |
Items
| Key | Type | Required | Comment |
|---|---|---|---|
field |
String |
Yes |
The API name of the required field of the desired CT Orders package object. |
operator |
Enum |
Yes |
Applied operator. Available values: |
value |
Currency |
No |
A target value for a field in the field key. An empty value is not allowed. The available operators: contain, notContain, equal, notEqual. |
Number |
|||
Text |
|||
values |
Array of Values |
No |
List of the target values a field in the field key, for example: ["abc","123"] At least two values must be provided. The available operators: in, notIn. |
Record Type: Group + Condition
If the Order Line Item has the not empty required fields specified for the Condition Group object and meets the child Condition criterion, a discount will be applied.
-
Specify the list of fields that should be not empty on the Order Line Item records in the Condition Fields List field on the Calculation Type record with the Condition Group record type.
-
In the Condition Fields field on the [.object]#Condition Group #object, specify the list of field API names that should not be empty on the Order Line Item records.
-
In the Condition Details field on the child Condition records, specify the expected values.
For example, the list of fields that should not be empty specified in the orders__ConditionFieldsList__c field on the Calculation Type record with the Condition Group record type: orders__OrderId__r.orders__AccountId__r.Industry,orders__OrderId__r.orders__AccountId__r.Type,orders__OrderId__r.orders__PriceBookId__c
Values in the orders__ConditionDetails__c field of the child Calculation Type with the Condition record type: "Agriculture","Customer","a0p3X00000WIvicQAD" or Agriculture,Customer,a0p3X00000WIvicQAD