HomeGuidesDeveloper HubRelease Notes
Get supportBook a chat
Developer Hub
These docs are for v2.56. Click to read the latest docs for v2.208.

FieloPLT.PromotionService Class

The FieloPLT.PromotionService class includes one method.

Obtain Promotions (getPromotions)

FieloPLT.PromotionService.getPromotions (Set<String> fieldsPromotion, Set<String> fieldsRule, Set<Id> promotionIds, Id memberId, Boolean filterBySegments, String orderBy, Integer quantity, Integer offset, String dynamicFilter)

It enables to retrieve information about a specific number of Promotions from a particular Member. It can also provide details about the Rules that belong to each of the Promotions.

Parameters

ParameterTypeDescription
fieldsPromotionSet<String>Set of API names from Promotion fields to return in the response. When null or empty, default value is Set<String>name.
fieldsRuleSet<String>Set of API names from Rules fields to return in the response. When null or empty, no Rules are returned.
promotionIdsSet<Id>Set of Promotion IDs.
memberId (Required)IdID of a specific Member.
filterBySegments (Required)BooleanWhen true, it only returns the Promotions that belong to Member's Segment, otherwise it returns all Promotions. When null, default value is false.
quantityIntegerNumber of items to be retrieved. When null, query return all items.
offsetIntegerNumber of records from a collection to skip. When null, no records are skipped.
orderByStringRecords returned in an ascending or descending order.
dynamicFilterStringJSON parameter to filter by an additional WHERE Clause. When null, no filter is applied.

Return Value

TypeDescription
List<FieloPLT__Promotion__c>List of Promotions, which may include Rules related list (FieloPLT__Rules__r).
Id memberId = [SELECT Id FROM FieloPLT__Member__c LIMIT 1].Id;

String dynamicFilter = '[{"field":"FieloPLT__Status__c","value":"Active","operator":"eq","andOrOperator":""}]';

List<FieloPLT__Promotion__c> listPromotions = FieloPLT.PromotionService.getPromotions(
  new Set<String>{'Id','Name'},
  new Set<String>{'Id','Name'},
  null, 
  memberId,
  true,
  'CreatedDate ASC',
  100,
  0,
  dynamicFilter);