generated from microsoft/AL-Go-AppSource
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
First steps to get background sending on the way
- Loading branch information
1 parent
e31e06e
commit e526f85
Showing
3 changed files
with
44 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
namespace StefanMaron.Ntfy; | ||
|
||
using System.RestClient; | ||
|
||
codeunit 71179879 BatchSendNtfysNTSTM | ||
{ | ||
TableNo = NtfyEntryNTSTM; | ||
|
||
trigger OnRun() | ||
var | ||
NtfyEntry: Record NtfyEntryNTSTM; | ||
RestClient: Codeunit "Rest Client"; | ||
Body: Codeunit "Http Content"; | ||
Description: Text; | ||
begin | ||
IsolatedStorage.Get('NtfyDescription', DataScope::User, Description); | ||
Body.Create(Description); | ||
IsolatedStorage.Delete('NtfyDescription', DataScope::User); | ||
|
||
NtfyEntry.SetRange(EventType, NtfyEntry.EventType::SalesDocumentReopened); | ||
NtfyEntry.SetFilter(NtfyTopic, '<>%1', ''); | ||
if NtfyEntry.FindSet() then | ||
repeat | ||
Clear(RestClient); | ||
RestClient.Post(StrSubstNo('https://ntfy.sh/%1', NtfyEntry.NtfyTopic), Body); | ||
until NtfyEntry.Next() = 0; | ||
end; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters