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

FieloPLT.PlatformEventsService class

The Platform Event Service Class - manages the async processing of some internal routines of Fielo. The main goal of this class is to be able to process non-global apex APIs in customer's orgs. But only APIs enabled by Fielo can be called.

publishAsyncEvent(type, payloadOrRecordIds)

static void publishAsyncEvent(String type,Object payloadOrRecordIds)

Enables or disables the on-demand assembling of the cache. Assembling the cache on the runtime may consume additional SOQL queries. If your development or your test class is hitting the SOQL limit required by Salesforce this method will reduce the access to the database (number of SOQL queries).

Parameters

ParameterTypeDescription
typeStringName of the routine/method to be executed.
payloadOrRecordIdsObjectIt can be either String/JSON formatted String or a Set of Ids

Async Event types

The following event types (aka methods) are the currently existing methods that any customer on Fielo R2'22+ is allowed to use.

CacheRefresh version stability

Use this event type if you need to refresh the entire Fielo cache. It will reset (set to null) and reload all the cache structures Fielo has.

Example:

FieloPLT.PlatformEventsService.publishAsyncEvent('CacheRefresh',null);

UpdateActionCriteriaField version stability

Use this event type if you need to recalculate the Action__c.CriteriaField__c from any action record.

Example:

FieloPLT.PlatformEventsService.publishAsyncEvent(
    'UpdateActionCriteriaField',
    new Set<Id>{
        'your_action_id',
        'another_action_id'
    }
);

UpdateSummer22MetadataFields version stability

Use this event type if in your org the post-install script of the R2'22 failed. To detect if the script fails search for any record in Rules or Criterion Groups with the field RelatedListObject__c null.

Example:

FieloPLT.PlatformEventsService.publishAsyncEvent('UpdateSummer22MetadataFields',null);

AddProgramToMetaSegments version stability

Use this event type if in your org the post-install script of the R1'22 failed. To detect if the script fails search for any Meta Segment without Program__c set.

Example:

FieloPLT.PlatformEventsService.publishAsyncEvent('AddProgramToMetaSegments',null);

UpdateProgramJsonFields version stability

Use this event type if you need to recalculate the Program__c.CriteriaField__c from any program record.

Example:

FieloPLT.PlatformEventsService.publishAsyncEvent(
    'UpdateProgramJsonFields',
    new Set<Id>{
        'your_program_id',
        'another_program_id'
    }
);

ExpirePoints version stability

Use this event type if you need to expire any not expired and not used point records.

Example:

FieloPLT.PlatformEventsService.publishAsyncEvent(
    'ExpirePoints',
    new Set<Id>{
        'your_point_record_id',
        'another_point_record_id'
    }
);

UpdateSummer22 version stability

Use this event type if in your org the post-install script of the R2'22 failed. It will execute all the post-install scripts required for R2'22 again.

Example:

FieloPLT.PlatformEventsService.publishAsyncEvent('UpdateSummer22',null);