KVSKBACampaignLib#
Procedures#
ActivateCampaign(Record Campaign) :#
Summary: Activates a campaign by processing segment lines and interaction log entries to create campaign target groups. This procedure handles the campaign activation process including price and discount validation.
procedure ActivateCampaign(var Campaign: Record "Campaign"):
Parameters:
Campaign
: The Campaign record to be activated.
Remarks: The procedure performs the following steps: 1. Checks if there are sales prices or discounts linked to the campaign 2. Processes segment lines marked as campaign targets 3. Processes interaction log entries marked as campaign targets 4. Creates campaign target group entries for each processed record Shows progress dialogs during processing and displays confirmation messages upon completion.
Events#
OnBeforeActivateCampaign(Record Campaign, Boolean) :#
Summary: Integration Event that is raised before activating a campaign. Use this event to perform custom validation or modification logic before the campaign activation.
[IntegrationEvent(false, false)]
local procedure OnBeforeActivateCampaign(var Campaign: Record "Campaign"; var IsHandled: Boolean):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBACampaignLib", 'OnBeforeActivateCampaign', '', false, false)]
local procedure DoSomethingOnBeforeActivateCampaign(var Campaign: Record "Campaign"; var IsHandled: Boolean)
begin
end;
Parameters:
Campaign
: The Campaign record that will be activated.IsHandled
: Set to true to skip the default campaign activation logic.
Remarks: This event allows external extensions to hook into the campaign activation process and either customize the activation logic or completely bypass the default behavior by setting IsHandled to true.