Skip to content

Commit

Permalink
Add Filter function
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanMaron committed Jan 12, 2024
1 parent 59b203c commit d3e06b5
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 1 deletion.
6 changes: 6 additions & 0 deletions MSDyn365BC.Ntfy/src/EventTypes/EmptyEvent.Codeunit.al
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,10 @@ codeunit 71179876 EmptyEventNTSTM implements INtfyEventNTSTM
begin

end;

procedure FilterNtfyEntriesBeforeBatchSend(var NtfyEntry: Record NtfyEntryNTSTM; Params: Dictionary of [Text, Text]);
begin

end;

}
1 change: 1 addition & 0 deletions MSDyn365BC.Ntfy/src/EventTypes/INtfyEvent.al
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ interface INtfyEventNTSTM
{
procedure SetSettings(NtfyEntry: Record NtfyEntryNTSTM)
procedure ResetSettings(NtfyEntry: Record NtfyEntryNTSTM)
procedure FilterNtfyEntriesBeforeBatchSend(var NtfyEntry: Record NtfyEntryNTSTM; Params: Dictionary of [Text, Text])
procedure DoCallNtfyEntry(NtfyEntry: Record NtfyEntryNTSTM; Params: Dictionary of [Text, Text]) ReturnValue: Boolean
procedure GetMessage(Params: Dictionary of [Text, Text]) ReturnValue: Text[2048]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ codeunit 71179877 SalesDocumentReleasedNTSTM implements INtfyEventNTSTM
NtfyEntry.Modify(true);
end;

procedure FilterNtfyEntriesBeforeBatchSend(var NtfyEntry: Record NtfyEntryNTSTM; Params: Dictionary of [Text, Text]);
begin

end;

procedure DoCallNtfyEntry(NtfyEntry: Record NtfyEntryNTSTM; Params: Dictionary of [Text, Text]) ReturnValue: Boolean
var
FilterSalesHeader: Record "Sales Header";
Expand Down Expand Up @@ -56,5 +61,4 @@ codeunit 71179877 SalesDocumentReleasedNTSTM implements INtfyEventNTSTM
Params.Add('No', SalesHeader."No.");
NtfyEntry.SendNotifications(NtfyEntry.EventType::SalesDocumentReleased, Params);
end;

}
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ codeunit 71179878 SalesDocumentReopenedNTSTM implements INtfyEventNTSTM
NtfyEntry.Modify(true);
end;

procedure FilterNtfyEntriesBeforeBatchSend(var NtfyEntry: Record NtfyEntryNTSTM; Params: Dictionary of [Text, Text]);
begin

end;

procedure DoCallNtfyEntry(NtfyEntry: Record NtfyEntryNTSTM; Params: Dictionary of [Text, Text]) ReturnValue: Boolean
var
FilterSalesHeader: Record "Sales Header";
Expand Down
1 change: 1 addition & 0 deletions MSDyn365BC.Ntfy/src/foundation/NtfyEntry.Table.al
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ table 71179875 NtfyEntryNTSTM

NtfyEntry.SetRange(EventType, Type);
NtfyEntry.SetFilter(NtfyTopic, '<>%1', '');
INtfyEvent.FilterNtfyEntriesBeforeBatchSend(NtfyEntry, Params);
if NtfyEntry.FindSet() then
repeat
if INtfyEvent.DoCallNtfyEntry(NtfyEntry, Params) then
Expand Down

0 comments on commit d3e06b5

Please sign in to comment.