Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions Apps/W1/Email - SMTP Connector/app/src/SMTPAccount.table.al
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,9 @@ table 4511 "SMTP Account"

trigger OnDelete()
begin
if not IsNullGuid(Rec."Password Key") then
if IsolatedStorage.Delete(Rec."Password Key") then;
DeleteIsolatedStorageIfExists(Rec."Password Key");
DeleteIsolatedStorageIfExists(Rec."Client Id Storage Id");
DeleteIsolatedStorageIfExists(Rec."Client Secret Storage Id");
end;

[NonDebuggable]
Expand Down Expand Up @@ -213,4 +214,12 @@ table 4511 "SMTP Account"
if not IsolatedStorage.Get(Format(ClientSecretKey), DataScope::Company, ClientSecret) then
Error(UnableToGetClientSecretMsg);
end;

local procedure DeleteIsolatedStorageIfExists(KeyToCheck: Guid)
begin
if IsNullGuid(KeyToCheck) then
exit;
if IsolatedStorage.Contains(Format(KeyToCheck), DataScope::Company) then
IsolatedStorage.Delete(Format(KeyToCheck), DataScope::Company);
end;
}
Loading