Seller Picker Filter Logic

You will use a Seller Picker Filter logic when you need to:

  • Limit the list of sellers presented to the business user, when they click on:

    • The seller input field.

    • The seller group input field.

When the Logic is Executed

  • From Seller input field - automatically by the system, at the moment, when the user opens the seller picker.

  • From Seller Group input field - automatically by the system, at the moment, when the user opens the seller picker.

  • From a logic, by calling the method api.evalSellerFilterLogic(). This could be useful, if you need to call one filter logic from inside another one - e.g., when combining more filter logic results together.

Note that it is possible to build the seller group input field on the line item also by calling the method api.sellerGroupEntry() in the Input Generation mode. There’s a version of the api.sellerGroupEntry() method, which supports adding of the filter too - sample: api.sellerGroupEntry("sellerGroup", "SellerGroupInputFilterLogic", salesOrganization).

Logic API

  • Logic Nature: sellerInputFilter

    • Logic Type: Calculation/Pricing

  • Execution Types:

    • Standard - to calculate the filters to be used in the seller picker.

  • Information provided to the logic:

    • In the Standard mode:

      • Binding variable filterFormulaParam will contain the text provided, when the logic was called. Commonly, if more than one value was needed to pass via the param, the values are passed as a Map, which is encoded as JSON text. In such case, you will need to decode the string before using.

        • In case it’s called from the input field, the value of filterFormulaParam is provided in the definition of the input field.

        • When called from api.evalSellerFilterLogic(), the value of the parameter is provided in the function call.

  • Expected logic execution outcome:

    • From Standard mode execution:

      • The system will collect the results of the logic elements, which return an object of type Filter (result values of other types are ignored). All those filters will be placed to a List and such List<Filter> will be used as a result of the logic.

        • Note that the Display Mode is ignored in this logic.

Sample

Sample of logic of nature SellerInputFilter
def param = api.jsonDecode(filterFormulaParam) def sellerUnit = param?.SellerUnit def sellerCorpGrpNo = param?.SellerCorpGrpNo List filters = [] if (sellerUnit) { filters.add(Filter.equal("attribute1", sellerUnit)) } if (sellerCorpGrpNo) { filters.add(Filter.equal("attribute9", sellerCorpGrpNo)) } if (filters.isEmpty()) { return null } return Filter.and(*filters)
Sample of the definition of an input field, which uses the filter logic
Map filterParam = [ SellerUnit: sellerUnit.getValue(), SellerCorpGrpNo: sellerGrp.getValue() ] def sellerInputFieldBuilder = api.inputBuilderFactory() .createSellerEntry("Seller") .setLabel("Seller") .setFilterFormulaName("SellerPickerFilterLogic") //❶ .setFilterFormulaParam(api.jsonEncode(filterParam))

❶ Name of the logic with SellerInputFilter nature.

Found an issue in documentation? Write to us.