Skip to content

Commit

Permalink
Add state enum
Browse files Browse the repository at this point in the history
  • Loading branch information
stkillen committed Apr 15, 2024
1 parent 269ed1f commit 852a71a
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/System Application/App/Document Sharing/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"idRanges": [
{
"from": 9560,
"to": 9562
"to": 9563
}
],
"contextSensitiveHelpUrl": "https://learn.microsoft.com/dynamics365/business-central/"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,12 @@ table 9560 "Document Sharing"
}

/// <summary>
/// Specifies whether the action was cancelled.
/// Specifies the state of the document sharing operation.
/// </summary>
field(13; Cancelled; Boolean)
field(13; State; Enum "Document Sharing State")
{
DataClassification = SystemMetadata;
InitValue = Success;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ codeunit 9561 "Document Sharing Impl."
Sleep(2000); // This sleep is to ensure the OneDrive clears the lock on the file after the user saves and closes.
DocumentSharingCodeunit.OnGetFileContents(DocumentSharing, Handled);
end else
DocumentSharing.Cancelled := true;
DocumentSharing.State := DocumentSharing.State::Cancelled;

Handled := false;
DocumentSharingCodeunit.OnDeleteDocument(DocumentSharing, Handled);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// ------------------------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// ------------------------------------------------------------------------------------------------

namespace System.Integration;

/// <summary>
/// The result of the sharing operation.
/// </summary>
enum 9563 "Document Sharing State"
{
Extensible = false;

/// <summary>
/// Operation completed successfully.
/// </summary>
value(0; Success)
{
Caption = 'Success';
}

/// <summary>
/// Operation cancelled.
/// </summary>
value(1; Cancelled)
{
Caption = 'Cancelled';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,7 @@ codeunit 9988 "Word Template Impl."

DocumentSharing.Share(TempDocumentSharing);

if TempDocumentSharing.Cancelled then
if TempDocumentSharing.State = TempDocumentSharing.State::Cancelled then
Error('');

ResultTempBlob.CreateOutStream(OutStream, TextEncoding::UTF8);
Expand Down

0 comments on commit 852a71a

Please sign in to comment.