Skip to content
Open
Show file tree
Hide file tree
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
5 changes: 0 additions & 5 deletions src/Apps/W1/EDocument/App/src/Document/EDocument.Page.al
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,6 @@ page 6121 "E-Document"
Caption = 'View file';
ToolTip = 'View the source file.';
Image = ViewDetails;
Visible = NewEDocumentExperienceActive;

trigger OnAction()
begin
Expand Down Expand Up @@ -501,14 +500,11 @@ page 6121 "E-Document"
}

trigger OnOpenPage()
var
EDocumentsSetup: Record "E-Documents Setup";
begin
ShowMapToOrder := false;
HasErrorsOrWarnings := false;
HasErrors := false;
IsProcessed := false;
NewEDocumentExperienceActive := EDocumentsSetup.IsNewEDocumentExperienceActive();

if Rec."Entry No" <> 0 then
Rec.SetRecFilter(); // Filter the record to only this instance to avoid navigation
Expand Down Expand Up @@ -632,7 +628,6 @@ page 6121 "E-Document"
EDocumentErrorHelper: Codeunit "E-Document Error Helper";
EDocumentHelper: Codeunit "E-Document Processing";
ErrorsAndWarningsNotification: Notification;
NewEDocumentExperienceActive: Boolean;
ShowClearanceInfo: Boolean;
RecordLinkTxt, StyleStatusTxt : Text;
ShowRelink, ShowMapToOrder, HasErrorsOrWarnings, HasErrors, IsIncomingDoc, IsProcessed, SubmitClearanceVisible : Boolean;
Expand Down
13 changes: 0 additions & 13 deletions src/Apps/W1/EDocument/App/src/Document/EDocuments.Page.al
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ page 6122 "E-Documents"
Caption = 'View file';
ToolTip = 'View the source file.';
Image = ViewDetails;
Visible = NewEDocumentExperienceActive;

trigger OnAction()
begin
Expand All @@ -111,7 +110,6 @@ page 6122 "E-Documents"
{
Caption = 'Inbound';
ToolTip = 'View inbound electronic documents.';
Visible = NewEDocumentExperienceActive;
RunObject = Page "Inbound E-Documents";
RunPageMode = View;
Image = InwardEntry;
Expand All @@ -120,7 +118,6 @@ page 6122 "E-Documents"
{
Caption = 'Outbound';
ToolTip = 'View outbound electronic documents.';
Visible = NewEDocumentExperienceActive;
RunObject = Page "Outbound E-Documents";
Image = OutboundEntry;
}
Expand All @@ -135,16 +132,6 @@ page 6122 "E-Documents"
}
}

var
NewEDocumentExperienceActive: Boolean;

trigger OnOpenPage()
var
EDocumentsSetup: Record "E-Documents Setup";
begin
NewEDocumentExperienceActive := EDocumentsSetup.IsNewEDocumentExperienceActive();
end;

local procedure NewFromFile()
var
EDocument: Record "E-Document";
Expand Down
64 changes: 0 additions & 64 deletions src/Apps/W1/EDocument/App/src/Document/EDocumentsSetup.Table.al
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we not remove the field 2 ?

Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
// ------------------------------------------------------------------------------------------------
namespace Microsoft.eServices.EDocument;

using System.Azure.Identity;
using System.Environment;

table 6107 "E-Documents Setup"
{
Access = Internal;
Expand Down Expand Up @@ -34,67 +31,6 @@ table 6107 "E-Documents Setup"
}
}

procedure IsNewEDocumentExperienceActive(): Boolean
var
EnvironmentInformation: Codeunit "Environment Information";
TenantId: Text;
ListOfAvailableCountries: List of [Text];
begin
Clear(Rec);
if Rec.FindFirst() then
if Rec."New E-Document Experience" then
exit(true);

if TryGetAadTenantId(TenantId) then
if TenantId in [
'7bfacc13-5977-43eb-ae75-63e4cbf78029',
'5d02776e-8cf2-4fae-8cac-a52cfdfbe90f',
'f0ac72d1-c1b3-4c2a-a196-8fb82cac5934',
'4cde9473-edc6-464d-98c9-921bb36bab03',
'1fe0f01e-1d4a-4e55-86d7-c45a5b9bf1a6',
'62c3bd14-7298-4281-a12a-ec3a78c22957',
'e5afa896-1f57-4c74-b9cd-65638c0f77da'
] then
exit(true);

if EnvironmentInformation.GetEnvironmentSetting('EnableNewEDocumentExperience') <> '' then
exit(true);

ListOfAvailableCountries := GetListOfNewExperienceCountries();
ListOfAvailableCountries.Add('W1');

exit(ListOfAvailableCountries.Contains(EnvironmentInformation.GetApplicationFamily()));
end;

internal procedure GetListOfNewExperienceCountries(): List of [Text]
var
CountryList: List of [Text];
begin
CountryList.Add('AU');
CountryList.Add('BE');
CountryList.Add('CA');
CountryList.Add('DE');
CountryList.Add('DK');
CountryList.Add('ES');
CountryList.Add('FR');
CountryList.Add('GB');
CountryList.Add('IT');
CountryList.Add('NL');
CountryList.Add('NO');
CountryList.Add('NZ');
CountryList.Add('SE');
CountryList.Add('US');
exit(CountryList);
end;

[TryFunction]
local procedure TryGetAadTenantId(var TenantId: Text)
var
AzureADTenant: Codeunit "Azure AD Tenant";
begin
TenantId := AzureADTenant.GetAadTenantId();
end;

[InherentPermissions(PermissionObjectType::TableData, Database::"E-Documents Setup", 'I')]
internal procedure InsertNewExperienceSetup()
begin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,9 @@ page 6108 "Inbound E-Doc. Factbox"
trigger OnOpenPage()
var
EDocument: Record "E-Document";
EDocumentsSetup: Record "E-Documents Setup";
begin
if EDocument.Get(Rec."E-Document Entry No") then;
ImportProcessingStatusVisible := EDocumentsSetup.IsNewEDocumentExperienceActive() and (EDocument.GetEDocumentService().GetImportProcessVersion() = Enum::"E-Document Import Process"::"Version 2.0");
ImportProcessingStatusVisible := EDocument.GetEDocumentService().GetImportProcessVersion() = Enum::"E-Document Import Process"::"Version 2.0";
end;

trigger OnAfterGetCurrRecord()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -460,14 +460,6 @@ page 6105 "Inbound E-Documents"
AgentTaskStatus := Format(AgentTask.Status);
end;

trigger OnOpenPage()
var
EDocumentsSetup: Record "E-Documents Setup";
begin
if not EDocumentsSetup.IsNewEDocumentExperienceActive() then
Error('');
end;

#region File Upload Actions

local procedure NewFromFile(Files: List of [FileUpload])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,4 @@ page 6106 "Outbound E-Documents"
actionref(Promoted_EDocumentServices; EDocumentServices) { }
}
}

trigger OnOpenPage()
var
EDocumentsSetup: Record "E-Documents Setup";
begin
if not EDocumentsSetup.IsNewEDocumentExperienceActive() then
Error('');
end;

}
Original file line number Diff line number Diff line change
Expand Up @@ -477,14 +477,11 @@ page 6181 "E-Document Purchase Draft"

trigger OnOpenPage()
var
EDocumentsSetup: Record "E-Documents Setup";
EDocumentDataStorage: Record "E-Doc. Data Storage";
EDocumentNotification: Codeunit "E-Document Notification";
EDocPOMatching: Codeunit "E-Doc. PO Matching";
MatchesRemovedMsg: Label 'This e-document was matched to purchase order lines, but the matches are no longer consistent with the current data. The matches have been removed';
begin
if not EDocumentsSetup.IsNewEDocumentExperienceActive() then
Error('');
if EDocumentPurchaseHeader.Get(Rec."Entry No") then;
if not EDocPOMatching.IsPOMatchConsistent(EDocumentPurchaseHeader) then begin
EDocPOMatching.RemoveAllMatchesForEDocument(EDocumentPurchaseHeader);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -356,11 +356,7 @@ table 6103 "E-Document Service"
end;

internal procedure GetImportProcessVersion(): Enum "E-Document Import Process"
var
EDocumentsSetup: Record "E-Documents Setup";
begin
if not EDocumentsSetup.IsNewEDocumentExperienceActive() then
exit("E-Document Import Process"::"Version 1.0");
exit(Rec."Import Process");
end;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,6 @@ codeunit 5374 "Create E-Document Setup"
EDocumentsSetup: Record "E-Documents Setup";
EnvironmentInformation: Codeunit "Environment Information";
begin
if EDocumentsSetup.IsNewEDocumentExperienceActive() then
exit;
if EnvironmentInformation.IsOnPrem() then
EDocumentsSetup.InsertNewExperienceSetup();
end;
Expand Down