Loading
Set Up Trade Promotion Management
Table of Contents
Select Filters

          No results
          No results
          Here are some search tips

          Check the spelling of your keywords.
          Use more general search terms.
          Select fewer filters to broaden your search.

          Search all of Salesforce Help
          Properties of a Filter

          Properties of a Filter

          Define the properties of a filter to determine the capability of the filter.

          Required Editions

          Available in: Lightning Experience

          Available in: Enterprise and Unlimited Editions where Consumer Goods Cloud is enabled

          Name Description Example
          accountsfids Standard account filter
          {
          "type":
          "multiselect",
          "name":
          "accountsfids",
          "label":
          "Accounts",
          "source":
          "PlanAccounts"
          }
          productsfids Standard product filter
          {
          "type":
          "multiselect",
          "label":
          "Categories",
          "level": "category",
          "name":
          "productsfids",
          "source": "Products"
          }
          productlevel Standard product level filter. This filter derives the attributes shown or exported to an Excel sheet. If you use a product level productlevel"singleselect",filter on a report, then configure the report "name":for the most detailed level by maintaining "productlevel",all aggregation levels and using all productlevels in the report layout.
          {"
          type":
          "singleselect",
          "name":
          "productlevel",
          "label":
          "Product Level",
          "source":
          "ProductDimension"
          }
          kpigroup Standard KPI group filter
          {
          "type": "singleselect",
          "name": "kpigroup",
          "label": "Measure
          group",
          "source": "KPIGroup"
          }
          subaccountsfids Standard subaccount filter
          {"
          type":
          "subaccount",
          "name":
          "subaccountsfids",
          "label":
          "Sub Accounts",
          "accountfilter":
          "accountsfids",
          "source":
          "SubAccounts"
          }
          promo_templatesfid Standard promotion template filter. You can use this filter only for AccountMonthlyMeasures and promo_templatesfid"multiselect",AccountWeeklyMeasures datasources. This "label": "Promotionfilter also calls an apex remote action and therefore can be customized.
          {
          "type":
          "multiselect",
          "label": "Promotion
          Template",
          "name":
          "promo_templatesfid",
          "source":
          "PromotionTemplate"
          }
          promo_phase Standard promotion phase filter. You can use this filter only for AccountMonthlyMeasures andpromo_phase"label": "Promotion Phase",AccountWeeklyMeasures data sources. This "name": "promo_phase",filter also calls an apex remote action and therefore can be customized.
          {
          "type": "multiselect",
          "label": "Promotion Phase",
          "name": "promo_phase",
          "source":
          "PromotionPhase"
          }
          periodyear Standard period year filter. You can’t use this filter with weekly data sources.
          {"
          label":
          "Period",
          "source":
          "PeriodYear",
          "name":
          "periodyear",
          "type":
          "singleselect"
          }
          periodmonth Standard period month filter
          {
          "label": "Period",
          "type":
          "periodmonth",
          "name": "periodmonth"
          }
          periodweek Standard period week filter
          {
          "label": "Period",
          "type": "periodweek",
          "name": "periodweek"
          }
          promo_timeframe

          By default, promotions are considered in real-time reports if their start date falls within the selected reporting time range. promo_timeframe"name": "promo_timeframe",However, promotions starting before the "label": "Promotion Time selected time frame or extending beyond Frame",it aren’t considered. Use this filter to allow "values": [the user to select Overlapping or Including as the product time frame.

          With Overlapping selected, promotions that start before the selected time frame are {“label”: “Default”“value”: “default”},{considered. For example, a promotion that “label”:begins on December 27, 2022, and “Overlapping”continues into mid-January 2023 is also “value”:included.

          With the Including option, promotions that start before the selected time frame and{“label”: “Including”extend beyond it are also included. For instance, a promotion that commences on “value”: “including”December 27, 2022 , and continues until mid-January 2024 is also included.

          {
          "type": "singleselect",
          "name": "promo_timeframe",
          "label": "Promotion Time Frame",
          "values": [
              {
                  "label": "Default"
                  "value": "default"
              },
              {
                  "label": "Overlapping"
                  "value": "overlapping"
              },
              {
                  "label": "Including"
                  "value": "including"
              }
                     ]
          }

          To filter data based on attributes of promotion, use any attribute from the promotion dimension as a filter. To use an attribute from promotion dimension, maintain the attribute in promotion dimension with its attribute name and label. Here’s an example of promotion dimension.

          [
          {
          "sortenum": [
          "initial",
          "Planning",
          "Commited",
          "Canceled"
          ],
          "fielddb$label": "phase",
          "fieldsf$label": "ACCL__Phase__c",
          "fielddb": "phase",
          "fieldsf": "ACCL__Phase__c",
          "name": "phase"
          },
          {
          "fielddb$label": "Slogan",
          "fieldsf$label": "ACCL__Slogan__c",
          "fielddb": "phase",
          "fieldsf": "ACCL__Slogan__c",
          "name": "slogan"
          },
          {
          "fieldsf$label": "ACCL__Promotion_Template__r.ACCL__Description__c",
          "fieldsf": "ACCL__Promotion_Template__r.Id",
          "name": "type"
          },
          {
          "fieldsf$label": "ACCL__Promotion_Template__r.ACCL__Product_Definition_Level__c",
          "fieldsf": "ACCL__Promotion_Template__r.ACCL__Product_Definition_Level__c",
          "name": "productdeflevel"
          },
          {
          "fieldsf$label": "ACCL__Date_From__c",
          "fieldsf": "ACCL__Date_From__c",
          "name": "datefrom"
          },
          {"fieldsf$label": "ACCL__Date_Thru__c",
          "fieldsf": "ACCL__Date_Thru__c",
          "name": "datethru"
          },
          {
          "fieldsf$label": "ACCL__Delivery_Date_From__c",
          "fieldsf": "ACCL__Delivery_Date_From__c",
          "name": "instoredatefrom"
          },
          {
          "fieldsf$label": "ACCL__Delivery_Date_Thru__c",
          "fieldsf": "ACCL__Delivery_Date_Thru__c",
          "name": "instoredatethru"
          },
          {
          "fieldsf": "ACCL__Count_Tactics__c",
          "fieldsf$label": "ACCL__Count_Tactics__c",
          "name": "tacticcount"
          },
          {
          "fieldsf": "ACCL__Is_Frozen__c",
          "fieldsf$label": "ACCL__Is_Frozen__c",
          "name": "isFrozen"
          },
          {
          "fieldsf": "Id",
          "fieldsf$label": "Name",
          "name": "id"
          }
          ]

          Here’s an example of a filter configuration to add a product definition level filter where products are maintained at promotion or tactic level.

          {
          "type": "singleselect",
          "name": "promo_s_productdeflevel",
          "label": "ProductDefinitionLevel",
          "values": [
          {
          "label": "Promotion",
          "value": "Promotion"
          },
          {
          "label": "Tactic",
          "value": "Tactic"
          }
          ]
          }

          To add custom filters to a report that uses promotion dimension, create a filter by using the syntax:<prefix>_<valuetype>_<promodimensionmetaattributename>. Always use promo as the prefix. For promotion dimension attribute name, use the name of the promotion dimension. For value type, enter the type of the value, such as string.

          Type Value Type promotiondimensionmeta attribute name Filter Name
          singleselect String productdeflevel promo_s_productdeflevel
          singleselect Number threshold promo_n_threshold
          singleselect Boolean frozen promo_b_frozen
          multiselect Any type productdeflevel promo_a_productdeflevel

          FilterType

          Here are the types of filters.

          • singleselect: Use to restrict selection to only one value. Always provide a source with a set of values.
          • multiselect: Use to allow selecting multiple values from a list. Always provide a source with a set of values.
          • periodmonth: Use to specify the time frame in months as a filter.
          • periodweek: Use to specify the time frame in weeks as a filter.
          • hidden: To hide a filter in the UI. The value of this filter is always the defined default value.
          • fixed: Use to add a filter that is visible on the UI but can’t be edited. The value of the filter is always the defined default value.
          • subaccount: Use to show subaccounts based on the selected accounts.

          FilterDefaultValue

          The default value of a filter depends on the type of filter.

          Default values
          Type Default Value Format
          subaccount, multiselect, hidden, and fixed <<ALL_ VALUES>>: All available values are selected
          {"
          defaultValue":
          "<<ALL_VALUES>>"
          }
          <<FIRST_ VALUE>>: Only the first value is selected
          {
          {"
          defaultValue": "<<FIRST_VALUE>>"
          }
          <<MIDDLE_ VALUE>>: Only the middle value is selected
          {"
          defaultValue": "<<MIDDLE_VALUE>>"
          }
          <<LAST_ VALUE>>: Only the last value is selected
          "defaultValue": "<<LAST_VALUE>>"
          }
          Array of values: The value of the array is selected
          singleselect <<FIRST_ VALUE>>: Only the first value is selected
          {"
          defaultValue": "<<FIRST_VALUE>>"
          }
          periodmonth or periodweek

          Define the default value of period filters by using a JSON with these attributes:

          • year: Define as an integer or as a string in the format: <<CURRENT_ YEAR>>. By default, the year attribute is set to the current year.
          • start: Define as an integer (for example, January = 0, December = 11) or as a string in the format: <<CURRENT_ MONTH>>. By default, the month attribute is set to the current month.
          • total: An integer that determines the total number of weeks or months used for data retrieval. The system generates a dynamic value depending on the input.
          {"
          defaultValue": {
          "year":
          "<<CURRENT_YEAR>>",
          "start":
          "<<CURRENT_MONTH>>",
          "total" : 18
          }}

          or

          {"
          defaultValue": {
          "year": 2019,
          "start": 0,
          "total" : 18
          }}

          FilterValues

          Values for the selected filter types. The values include these attributes:

          • label: The name of the filter value that’s shown.
          • value: The possible values for the filter.
          • accountsfld: Details of the main account of the subaccount that’s added as the filter. This field is mandatory only when the filter type is subaccount.

          ValuesProvider

          Represents the metadata required to request the filter values from an Apex class for select and multiselect filters. The metadata includes these attributes.

          • class: The APEX class that calls filter values.
          • method: The method that is passed to the Apex callable class on the action parameter. The default value is an empty string.
          • params: The JSON object that is passed as parameters to the Apex callable class. The default value is an empty object.
          • cacheable: Indicates whether the data of an APEX call must be cached. Use this setting to achieve better performance when you’re using data that doesn’t change often. The default value is false.
          • labelField: Determines the returned objects to be used as a label for filter values. The default value is label.
          • valueField: Determines the returned objects to be used as the value for the filter values. The default value is value.
          Note
          Note For the class, labelField, and valueField attributes, use the <<NS__>> token in the string to dynamically resolve the cgcloud namespace. For example, a class attribute can be <<NS__>>TestClass CGCL__TestClass, and labelField and valueField attributes can be <<NS__>>Field1__c CGCloud__Field1__c.

          ValuesSource

          Describes the built-in possible sources for filter values. For example, if the source is categories, then the available product categories are shown in the filter. To use a custom APEX class, set the source attribute to the name of the APEX class that you want to use:

          {"
          name": "accountids",
          "type": "multiselect",
          "required": true,
          "label": "Customers",
          "source": "myCustomAPEXClass",
          }

          Use sources of filters together with the filter names that they’re linked to. For example, if the source is defined as subaccounts, use only the filters that are linked to the subaccounts. The possible value sources are:

          • PlanAccounts: Generates values with all the accounts that you have access to.
          • SubAccounts: Generates the subaccounts filter values for a subaccount filter based on
          • Categories: Generates values with all the product categories that you have access to.
          • Products: Generates values with all the products of the specified level that you have access to.
          • KPIs: Generates values with all the KPIs that are included in a report.
          • KPIGroup: Generates values with all the KPI groups that are included in a report.
          • ProductDimension: Generates values with all the product dimensions that are included in
          • TimeDimension: Generates values with all the time dimensions that are included in a report.
          • PeriodYear: Generates five values until the current year.

          accountfilter

          Here’s an example for an account filter:

          
          {"
          type": "singleselect",
          "name": "accountsfids",
          "label": "Accounts",
          "source": "PlanAccounts"
          }
           
          Loading
          Salesforce Help | Article