diff --git a/src/Apps/CZ/CashDeskLocalization/app/Src/Pages/ReportSelCashDeskCZP.Page.al b/src/Apps/CZ/CashDeskLocalization/app/Src/Pages/ReportSelCashDeskCZP.Page.al index 74ea340c05b..7cb7815671f 100644 --- a/src/Apps/CZ/CashDeskLocalization/app/Src/Pages/ReportSelCashDeskCZP.Page.al +++ b/src/Apps/CZ/CashDeskLocalization/app/Src/Pages/ReportSelCashDeskCZP.Page.al @@ -10,6 +10,7 @@ using System.Reflection; /// /// Configures default report selections for cash desk. Allows users to specify which reports to use for printing, emailing, and other output operations. /// +#pragma warning disable AS0032 page 31222 "Report Sel. - Cash Desk CZP" { AboutTitle = 'About report selection for cash desk'; @@ -120,12 +121,16 @@ page 31222 "Report Sel. - Cash Desk CZP" ToolTip = 'Specifies the ID of the custom email body layout that is used.'; Visible = false; } +#if not CLEAN29 +#pragma warning disable AL0432 field("Email Body Layout Description"; Rec."Email Body Layout Description") { ApplicationArea = Basic, Suite; ToolTip = 'Specifies a description of the custom email body layout that is used.'; Visible = false; } +#pragma warning restore AL0432 +#endif } } area(factboxes) @@ -209,4 +214,5 @@ page 31222 "Report Sel. - Cash Desk CZP" begin end; } +#pragma warning restore AS0032 diff --git a/src/Apps/CZ/CompensationLocalization/app/Src/Pages/ReportSelectionCompCZC.Page.al b/src/Apps/CZ/CompensationLocalization/app/Src/Pages/ReportSelectionCompCZC.Page.al index 039d63598f9..f9dcf9e793b 100644 --- a/src/Apps/CZ/CompensationLocalization/app/Src/Pages/ReportSelectionCompCZC.Page.al +++ b/src/Apps/CZ/CompensationLocalization/app/Src/Pages/ReportSelectionCompCZC.Page.al @@ -10,6 +10,7 @@ using System.Reflection; /// /// Configures default report selections for compensations. Allows users to specify which reports to use for printing, emailing, and other output operations. /// +#pragma warning disable AS0032 page 31282 "Report Selection - Comp. CZC" { AboutTitle = 'About report selection for compensation'; @@ -120,12 +121,16 @@ page 31282 "Report Selection - Comp. CZC" ToolTip = 'Specifies the ID of the custom email body layout that is used.'; Visible = false; } +#if not CLEAN29 +#pragma warning disable AL0432 field("Email Body Layout Description"; Rec."Email Body Layout Description") { ApplicationArea = Basic, Suite; ToolTip = 'Specifies a description of the custom email body layout that is used.'; Visible = false; } +#pragma warning restore AL0432 +#endif } } area(factboxes) @@ -201,4 +206,5 @@ page 31282 "Report Selection - Comp. CZC" begin end; } +#pragma warning restore AS0032 diff --git a/src/Apps/W1/EnforcedDigitalVouchers/test/src/DigitalVouchersTests.Codeunit.al b/src/Apps/W1/EnforcedDigitalVouchers/test/src/DigitalVouchersTests.Codeunit.al index 581dcc4a2aa..0ceaf41601b 100644 --- a/src/Apps/W1/EnforcedDigitalVouchers/test/src/DigitalVouchersTests.Codeunit.al +++ b/src/Apps/W1/EnforcedDigitalVouchers/test/src/DigitalVouchersTests.Codeunit.al @@ -21,7 +21,9 @@ using Microsoft.Purchases.History; using Microsoft.Purchases.Payables; using Microsoft.Purchases.Setup; using Microsoft.Purchases.Vendor; +#if not CLEAN29 using Microsoft.Sales.Customer; +#endif using Microsoft.Sales.Document; using Microsoft.Sales.History; using Microsoft.Service.Document; @@ -34,6 +36,7 @@ using System.Environment.Configuration; using System.TestLibraries.Utilities; using System.Utilities; +#pragma warning disable AL0432, AS0105 codeunit 139515 "Digital Vouchers Tests" { Subtype = Test; @@ -53,8 +56,12 @@ codeunit 139515 "Digital Vouchers Tests" LibraryRandom: Codeunit "Library - Random"; LibraryLowerPermissions: Codeunit "Library - Lower Permissions"; Assert: Codeunit Assert; +#if not CLEAN29 LibraryEmail: Codeunit "Library - Email"; +#endif +#if not CLEAN29 ActiveDirectoryMockEvents: Codeunit "Active Directory Mock Events"; +#endif LibrarySmallBusiness: Codeunit "Library - Small Business"; LibraryService: Codeunit "Library - Service"; IsInitialized: Boolean; @@ -494,6 +501,7 @@ codeunit 139515 "Digital Vouchers Tests" UnbindSubscription(DigVouchersDisableEnforce); end; +#if not CLEAN29 [Test] [HandlerFunctions('StrMenuHandler,VerifyNoAttachmentsInEmailEditorModalPageHandler')] procedure PostSalesDocAndSendEmailWithDigitalVoucherAutomaticallyGenerated() @@ -534,6 +542,7 @@ codeunit 139515 "Digital Vouchers Tests" UnbindSubscription(DigVouchersDisableEnforce); end; +#endif [Test] procedure PostMultipleGeneralJournalLinesWithGenerateAutomaticallyOption() @@ -1949,6 +1958,7 @@ codeunit 139515 "Digital Vouchers Tests" LibraryERM.FindVendorLedgerEntry(VendorLedgerEntry, VendorLedgerEntry."Document Type"::Invoice, DocNo); end; +#if not CLEAN29 local procedure PrepareSalesShipmentReportSelectionsForEmailBodyWithoutAttachment() var ReportSelections: Record "Report Selections"; @@ -1957,7 +1967,9 @@ codeunit 139515 "Digital Vouchers Tests" ReportSelections.ModifyAll("Use for Email Body", false); ReportSelections.ModifyAll("Use for Email Attachment", false); end; +#endif +#if not CLEAN29 local procedure CreateCustomReportSelectionForCustomer(CustomerNo: Code[20]; ReportSelectionUsage: Enum "Report Selection Usage"; ReportID: Integer) var CustomReportSelection: Record "Custom Report Selection"; @@ -1975,7 +1987,9 @@ codeunit 139515 "Digital Vouchers Tests" "Email Body Layout Code", CustomReportLayout.InitBuiltInLayout(CustomReportSelection."Report ID", CustomReportLayout.Type::Word.AsInteger())); CustomReportSelection.Insert(true); end; +#endif +#if not CLEAN29 local procedure BindActiveDirectoryMockEvents() begin if ActiveDirectoryMockEvents.Enabled() then @@ -1983,6 +1997,7 @@ codeunit 139515 "Digital Vouchers Tests" BindSubscription(ActiveDirectoryMockEvents); ActiveDirectoryMockEvents.Enable(); end; +#endif local procedure CreateBankAccReconciliationLine(BankAccReconciliation: Record "Bank Acc. Reconciliation"; var BankAccReconciliationLine: Record "Bank Acc. Reconciliation Line"; AccountType: Enum "Gen. Journal Account Type"; AccountNo: Code[20]; Amount: Decimal; Date: Date) begin @@ -2056,3 +2071,4 @@ codeunit 139515 "Digital Vouchers Tests" TestEmailEditor.Attachments.FileName.AssertEquals(''); end; } +#pragma warning restore AL0432, AS0105 diff --git a/src/Apps/W1/Sustainability/test/src/SustainabilityReportTests.Codeunit.al b/src/Apps/W1/Sustainability/test/src/SustainabilityReportTests.Codeunit.al index d07035c5953..04fd3ac5c22 100644 --- a/src/Apps/W1/Sustainability/test/src/SustainabilityReportTests.Codeunit.al +++ b/src/Apps/W1/Sustainability/test/src/SustainabilityReportTests.Codeunit.al @@ -12,9 +12,12 @@ using Microsoft.Sales.History; using Microsoft.Sustainability.Account; using Microsoft.Sustainability.Setup; using Microsoft.Test.Sustainability; +#if not CLEAN29 using System.Reflection; using System.Utilities; +#endif +#pragma warning disable AL0432, AS0105 codeunit 148217 "Sustainability Report Tests" { Subtype = Test; @@ -33,9 +36,11 @@ codeunit 148217 "Sustainability Report Tests" AccountCodeLbl: Label 'AccountCode%1', Comment = '%1 = Number'; CategoryCodeLbl: Label 'CategoryCode%1', Comment = '%1 = Number'; SubcategoryCodeLbl: Label 'SubcategoryCode%1', Comment = '%1 = Number'; +#if not CLEAN29 MSXLbl: Label 'MSX%1', Comment = '%1 = random number for unique layout code'; MSXILbl: Label 'MSXI%1', Comment = '%1 = random number for unique layout code'; DocxLbl: Label 'docx'; +#endif TotalCO2eLbl: Label 'TotalCO2e'; CO2ePerUnitLineLbl: Label 'CO2ePerUnit_Line'; DisclaimerLbl: Label 'Disclaimer_Lbl'; @@ -53,7 +58,9 @@ codeunit 148217 "Sustainability Report Tests" UnitOfMeasure: Record "Unit of Measure"; SalesHeader: Record "Sales Header"; SalesLine: Record "Sales Line"; +#if not CLEAN29 CustomReportLayout: Record "Custom Report Layout"; +#endif ExpectedCO2ePerUnit: Decimal; ExpectedTotalCO2e: Decimal; ExpectedFormatCO2ePerUnit: Text; @@ -72,8 +79,10 @@ codeunit 148217 "Sustainability Report Tests" // [GIVEN] Update "Emission Unit of Measure Code" in Sustainability Setup. UpdateEmissionUnitOfMeasureInSustainabilitySetup(UnitOfMeasure.Code); +#if not CLEAN29 // [GIVEN] Select layout as Custom Body Layout in "Standard Sales-Quote" report. GetCustomBodyLayout(CustomReportLayout, GetStandardSalesQuoteReportID()); +#endif // [GIVEN] Generate Random CO2e per Unit. ExpectedCO2ePerUnit := LibraryRandom.RandDec(20, 2); @@ -117,7 +126,9 @@ codeunit 148217 "Sustainability Report Tests" UnitOfMeasure: Record "Unit of Measure"; SalesHeader: Record "Sales Header"; SalesLine: Record "Sales Line"; +#if not CLEAN29 CustomReportLayout: Record "Custom Report Layout"; +#endif ExpectedCO2ePerUnitCaption: Text; ExpectedTotalCO2eCaption: Text; begin @@ -133,8 +144,10 @@ codeunit 148217 "Sustainability Report Tests" // [GIVEN] Update "Emission Unit of Measure Code" in Sustainability Setup. UpdateEmissionUnitOfMeasureInSustainabilitySetup(UnitOfMeasure.Code); +#if not CLEAN29 // [GIVEN] Select layout as Custom Body Layout in "Standard Sales-Quote" report. GetCustomBodyLayout(CustomReportLayout, GetStandardSalesQuoteReportID()); +#endif // [GIVEN] Create a Sales Quote. CreateSalesQuote(SalesHeader, SalesLine); @@ -161,7 +174,9 @@ codeunit 148217 "Sustainability Report Tests" var SustainabilitySetup: Record "Sustainability Setup"; UnitOfMeasure: Record "Unit of Measure"; +#if not CLEAN29 CustomReportLayout: Record "Custom Report Layout"; +#endif SalesInvoiceHeader: Record "Sales Invoice Header"; Quantity: Decimal; ExpectedCO2ePerUnit: Decimal; @@ -182,8 +197,10 @@ codeunit 148217 "Sustainability Report Tests" // [GIVEN] Update "Emission Unit of Measure Code" in Sustainability Setup. UpdateEmissionUnitOfMeasureInSustainabilitySetup(UnitOfMeasure.Code); +#if not CLEAN29 // [GIVEN] Select layout as Custom Body Layout in "Standard Sales-Invoice" report. GetCustomBodyLayout(CustomReportLayout, GetStandardSalesInvoiceReportID()); +#endif // [GIVEN] Generate Random CO2e per Unit and Quantity. ExpectedCO2ePerUnit := LibraryRandom.RandDec(20, 2); @@ -224,7 +241,9 @@ codeunit 148217 "Sustainability Report Tests" procedure VerifyCO2ePerUnitAndTotalCO2eCaptionInStandardSalesInvoice() var UnitOfMeasure: Record "Unit of Measure"; +#if not CLEAN29 CustomReportLayout: Record "Custom Report Layout"; +#endif SalesInvoiceHeader: Record "Sales Invoice Header"; Quantity: Decimal; ExpectedCO2ePerUnit: Decimal; @@ -243,8 +262,10 @@ codeunit 148217 "Sustainability Report Tests" // [GIVEN] Update "Emission Unit of Measure Code" in Sustainability Setup. UpdateEmissionUnitOfMeasureInSustainabilitySetup(UnitOfMeasure.Code); +#if not CLEAN29 // [GIVEN] Select layout as Custom Body Layout in "Standard Sales-Invoice" report. GetCustomBodyLayout(CustomReportLayout, GetStandardSalesInvoiceReportID()); +#endif // [GIVEN] Generate Random CO2e per Unit and Quantity. ExpectedCO2ePerUnit := LibraryRandom.RandDec(20, 2); @@ -301,6 +322,7 @@ codeunit 148217 "Sustainability Report Tests" LibraryTestInitialize.OnAfterTestSuiteInitialize(Codeunit::"Sustainability Report Tests"); end; +#if not CLEAN29 local procedure GetCustomBodyLayout(var CustomReportLayout: Record "Custom Report Layout"; ReportID: Integer) var ReportLayoutList: Record "Report Layout List"; @@ -333,6 +355,7 @@ codeunit 148217 "Sustainability Report Tests" CopyStream(OutStr, InStr); CustomReportLayout.Insert(); end; +#endif local procedure CreateSustainabilityCategory(var CategoryCode: Code[20]; i: Integer) begin @@ -425,6 +448,7 @@ codeunit 148217 "Sustainability Report Tests" SustainabilityDisclaimer.Insert(); end; +#if not CLEAN29 local procedure GetStandardSalesQuoteReportID(): Integer begin exit(Report::"Standard Sales - Quote"); @@ -434,6 +458,7 @@ codeunit 148217 "Sustainability Report Tests" begin exit(Report::"Standard Sales - Invoice"); end; +#endif local procedure RunStandardSalesQuoteReport(QuoteNo: Code[20]) var @@ -476,4 +501,5 @@ codeunit 148217 "Sustainability Report Tests" begin StandardSalesInvoice.SaveAsXml(LibraryReportDataset.GetParametersFileName(), LibraryReportDataset.GetFileName()); end; -} \ No newline at end of file +} +#pragma warning restore AL0432, AS0105 diff --git a/src/Layers/APAC/Tests/Misc/ReportSelectionsTests.Codeunit.al b/src/Layers/APAC/Tests/Misc/ReportSelectionsTests.Codeunit.al index c9e9a721337..e52f5362dea 100644 --- a/src/Layers/APAC/Tests/Misc/ReportSelectionsTests.Codeunit.al +++ b/src/Layers/APAC/Tests/Misc/ReportSelectionsTests.Codeunit.al @@ -28,22 +28,31 @@ codeunit 134421 "Report Selections Tests" FromEmailBodyTemplateTxt: Text; Initialized: Boolean; TemplateIdentificationTxt: Label 'a'; +#if not CLEAN29 CustomerEmailTxt: Label 'Customer@contoso.com'; CustomLayoutEmailTxt: Label 'CustomLayout@contoso.com'; +#endif WrongEmailAddressErr: Label 'Email Address is wrong on Send Email Dialog'; +#if not CLEAN29 DocumentNoTok: Label 'DocumentNo'; +#endif ReportIDMustHaveValueErr: Label 'Report ID must have a value'; +#if not CLEAN29 EmailAddressErr: Label 'Destination email address does not match expected address.'; +#endif StatementTitlePdfTxt: Label 'Statement'; ReportTitleTemplatePdfTxt: Label '%1 for %2 as of %3.pdf'; #if not CLEAN28 LayoutCodeShouldNotChangedErr: Label 'Layout code should not change.'; #endif SendToEmailTxt: Label 'test@test.com'; +#if not CLEAN29 MSXLbl: Label 'MS-X%1', Comment = '%1 = Random Value'; DocxLbl: Label 'docx'; MustSelectAndEmailBodyOrAttahmentErr: Label 'You must select an email body or attachment in report selection for %1.', Comment = '%1 = Usage, for example Sales Invoice'; +#endif +#if not CLEAN29 [Test] [HandlerFunctions('StandardSalesInvoiceRequestPageHandler')] [Scope('OnPrem')] @@ -92,6 +101,7 @@ codeunit 134421 "Report Selections Tests" // Verify VerifySendEmailPage(FromEmailBodyTemplateTxt, TemplateIdentificationTxt, PostedSalesInvoice."No.".Value); end; +#endif [Test] [HandlerFunctions('SelectSendingOptionHandler,EmailEditorHandler,CloseEmailEditorHandler')] @@ -118,6 +128,7 @@ codeunit 134421 "Report Selections Tests" VerifySendEmailPage(FromEmailBodyTemplateTxt, TemplateIdentificationTxt, PurchaseOrder."No.".Value); end; +#if not CLEAN29 [Test] [Scope('OnPrem')] procedure TesteEmailNoBodyNoAttachmentRaisesError() @@ -136,6 +147,7 @@ codeunit 134421 "Report Selections Tests" // Verify Assert.ExpectedError('email body or attachment'); end; +#endif [Test] [HandlerFunctions('SelectSendingOptionHandler')] @@ -157,6 +169,7 @@ codeunit 134421 "Report Selections Tests" Assert.ExpectedError('email body or attachment'); end; +#if not CLEAN29 [Test] [HandlerFunctions('EmailEditorHandlerCustomMessage,CloseEmailEditorHandler')] [Scope('OnPrem')] @@ -359,8 +372,10 @@ codeunit 134421 "Report Selections Tests" // Verify is within handler end; +#endif #if not CLEAN27 +#if not CLEAN29 [Test] [Scope('OnPrem')] procedure TestHTMLEmailBodyLoad() @@ -482,7 +497,9 @@ codeunit 134421 "Report Selections Tests" StrSubstNo('Destination email address does not match expected address %1', CustomLayoutEmailTxt)); end; #endif +#endif +#if not CLEAN29 [Test] [Scope('OnPrem')] procedure TestHTMLEmailBodyLoadFromBlob() @@ -622,6 +639,7 @@ codeunit 134421 "Report Selections Tests" LibraryVariableStorage.AssertEmpty(); end; +#endif [Test] [HandlerFunctions('SelectSendingOptionHandlerPrint,PurchaseOrderRequestPageHandler')] @@ -663,6 +681,7 @@ codeunit 134421 "Report Selections Tests" Assert.RecordCount(PurchaseHeaderArchive, 2); end; +#if not CLEAN29 [Test] [HandlerFunctions('StandardSalesInvoiceRequestPageHandler')] [Scope('OnPrem')] @@ -687,6 +706,7 @@ codeunit 134421 "Report Selections Tests" LibraryVariableStorage.AssertEmpty(); end; +#endif [Test] [HandlerFunctions('EmailEditorHandler,CloseEmailEditorHandler')] @@ -969,6 +989,7 @@ codeunit 134421 "Report Selections Tests" LibraryVariableStorage.AssertEmpty(); end; +#if not CLEAN29 [Test] [HandlerFunctions('StatementOKRequestPageHandler,DownloadAttachmentNoConfirmHandler')] [Scope('OnPrem')] @@ -1021,6 +1042,7 @@ codeunit 134421 "Report Selections Tests" FindInteractionLogEntriesByCustomerNo(InteractionLogEntry, CustomerNo, InteractionLogEntry."Document Type"::"Sales Stmnt."); Assert.RecordCount(InteractionLogEntry, 1); end; +#endif [Test] @@ -1375,6 +1397,7 @@ codeunit 134421 "Report Selections Tests" Assert.IsTrue(StrPos(CustomerReportSelections.SendToEmail.Value, 'testcase@testcase.com') <> 0, 'Wrong email after contact update.'); end; +#if not CLEAN29 [Test] [Scope('OnPrem')] procedure PostedSalesInvoiceEmailHasMorePriorityThanCustomerEmail() @@ -1410,6 +1433,7 @@ codeunit 134421 "Report Selections Tests" // [THEN] The "a@a.com; b@b.com; c@c.com" address is used as target email address. Assert.AreEqual(SalesHeader."Sell-to E-Mail", EmailAddress, EmailAddressErr); end; +#endif [Test] [Scope('OnPrem')] @@ -1575,6 +1599,7 @@ codeunit 134421 "Report Selections Tests" LibraryTempNVBufferHandler.AssertQueueEmpty(); end; +#if not CLEAN29 [Test] [HandlerFunctions('TestAddressEmailEditorHandler,CloseEmailEditorHandler')] [Scope('OnPrem')] @@ -1623,6 +1648,7 @@ codeunit 134421 "Report Selections Tests" LibraryVariableStorage.AssertEmpty(); end; +#endif [Test] [Scope('OnPrem')] @@ -2090,6 +2116,7 @@ codeunit 134421 "Report Selections Tests" // No assertion needed - if we reach this point, the fix is working end; +#if not CLEAN29 [Test] [HandlerFunctions('SelectSendingOptionHandler,EmailEditorHandler,CloseEmailEditorHandler')] procedure TestSendPostedSalesShipmentToEMailAndPDF() @@ -2664,6 +2691,7 @@ codeunit 134421 "Report Selections Tests" // [THEN] Verify message type with Email Handler. end; +#endif local procedure Initialize() var @@ -2868,6 +2896,7 @@ codeunit 134421 "Report Selections Tests" SalesInvoiceHeader.Get(LibrarySales.PostSalesDocument(SalesHeader, true, true)); end; +#if not CLEAN29 local procedure OpenNewPostedSalesInvoice(var PostedSalesInvoice: TestPage "Posted Sales Invoice") var SalesInvoiceHeader: Record "Sales Invoice Header"; @@ -2876,6 +2905,7 @@ codeunit 134421 "Report Selections Tests" PostedSalesInvoice.OpenEdit(); PostedSalesInvoice.GotoRecord(SalesInvoiceHeader); end; +#endif [Scope('OnPrem')] procedure OpenNewPurchaseOrder(var PurchaseOrderPage: TestPage "Purchase Order") @@ -2887,6 +2917,7 @@ codeunit 134421 "Report Selections Tests" PurchaseOrderPage.GotoRecord(PurchaseHeader); end; +#if not CLEAN29 local procedure SetupReportSelections(UseForEmailAttachment: Boolean; UseForEmailBody: Boolean) var OldReportSelections: Record "Report Selections"; @@ -2902,19 +2933,18 @@ codeunit 134421 "Report Selections Tests" OldReportSelections.Usage::"S.Invoice", CustomReportLayout."Report ID", UseForEmailAttachment, UseForEmailBody, CustomReportLayout.Code); end; +#endif local procedure SetupReportSelectionsVendor(UseForEmailAttachment: Boolean; UseForEmailBody: Boolean) var OldReportSelections: Record "Report Selections"; - DummyCustomReportLayout: Record "Custom Report Layout"; begin OldReportSelections.Reset(); OldReportSelections.SetRange(Usage, OldReportSelections.Usage::"P.Order"); OldReportSelections.FindFirst(); UpdateReportSelections( - OldReportSelections.Usage::"P.Order", GetReportIDForPurchaseOrder(), UseForEmailAttachment, UseForEmailBody, - DummyCustomReportLayout.Code); + OldReportSelections.Usage::"P.Order", GetReportIDForPurchaseOrder(), UseForEmailAttachment, UseForEmailBody, ''); end; local procedure SetupInvoiceReportLayoutSelection() @@ -2976,6 +3006,7 @@ codeunit 134421 "Report Selections Tests" ReportSelections.Modify(true); end; +#if not CLEAN29 local procedure UpdateCustomReportSelections(NewCustNo: Code[20]; UseForEmailAttachment: Boolean; UseForEmailBody: Boolean; SendToAddress: Text[200]) var CustomReportSelection: Record "Custom Report Selection"; @@ -2994,16 +3025,19 @@ codeunit 134421 "Report Selections Tests" CustomReportSelection.Modify(true); end; +#endif local procedure GenerateGUIDWithSpecialSymbol(): Code[20] begin exit(LibraryUtility.GenerateGUID() + '&'); end; +#if not CLEAN29 local procedure GetStandardSalesInvoiceReportID(): Integer begin exit(REPORT::"Standard Sales - Invoice"); end; +#endif local procedure GetReportIDForPurchaseOrder(): Integer begin @@ -3020,6 +3054,7 @@ codeunit 134421 "Report Selections Tests" exit(REPORT::Statement); end; +#if not CLEAN29 local procedure GetCustomBodyLayout(var CustomReportLayout: Record "Custom Report Layout") var ReportLayoutList: Record "Report Layout List"; @@ -3051,6 +3086,7 @@ codeunit 134421 "Report Selections Tests" CustomReportLayout.Insert(); end; end; +#endif #if not CLEAN27 local procedure GetEmailItem(var EmailItem: Record "Email Item"; MessageType: Integer; BodyFilePath: Text[250]; Plaintext: Boolean) @@ -3061,12 +3097,15 @@ codeunit 134421 "Report Selections Tests" end; #endif +#if not CLEAN29 local procedure GetEmailItem(var EmailItem: Record "Email Item"; MessageType: Option "Custom Message","From Email Body Template"; var EmailBody: Codeunit "Temp Blob") begin EmailItem.Validate("Message Type", MessageType); EmailItem.SetBody(EmailBody); end; +#endif +#if not CLEAN29 local procedure SetUpCustomEmail(var SalesInvoiceHeader: Record "Sales Invoice Header"; EmailAddress: Text[80]; UseCustomForEmailBody: Boolean) var Customer: Record Customer; @@ -3079,6 +3118,7 @@ codeunit 134421 "Report Selections Tests" UpdateCustomReportSelections(SalesInvoiceHeader."Bill-to Customer No.", true, UseCustomForEmailBody, EmailAddress); end; +#endif local procedure GenerateRandomPackageTrackingNo(): Text[50] var @@ -3248,6 +3288,7 @@ codeunit 134421 "Report Selections Tests" CustomReportSelection.GetSendToEmailFromContacts(Contact); end; +#if not CLEAN29 local procedure UpdateContactEmail(var Contact: Record Contact; Email: Text[45]) begin Contact.Validate("E-Mail", Email); @@ -3263,6 +3304,7 @@ codeunit 134421 "Report Selections Tests" Customer.Validate("Primary Contact No.", Contact."No."); Customer.Modify(); end; +#endif #if not CLEAN28 local procedure StandardSalesInvoiceReportID(): Integer @@ -3271,6 +3313,7 @@ codeunit 134421 "Report Selections Tests" end; #endif +#if not CLEAN29 local procedure SetupSalesShipmentReportSelections(UseForEmailAttachment: Boolean; UseForEmailBody: Boolean) var OldReportSelections: Record "Report Selections"; @@ -3341,7 +3384,9 @@ codeunit 134421 "Report Selections Tests" CustomReportSelection.Modify(true); end; +#endif +#if not CLEAN29 local procedure GetStandardSalesShipmentReportID(): Integer begin exit(Report::"Standard Sales - Shipment"); @@ -3363,7 +3408,9 @@ codeunit 134421 "Report Selections Tests" LibrarySales.PostSalesDocument(SalesHeader, true, false); SalesPost.GetPostedDocumentRecord(SalesHeader, PostedDocumentVariant); end; +#endif +#if not CLEAN29 local procedure SetupSalesReturnReceiptReportSelections(UseForEmailAttachment: Boolean; UseForEmailBody: Boolean) var OldReportSelections: Record "Report Selections"; @@ -3434,7 +3481,9 @@ codeunit 134421 "Report Selections Tests" CustomReportSelection.Modify(true); end; +#endif +#if not CLEAN29 local procedure GetStandardSalesReturnReceiptReportID(): Integer begin exit(Report::"Standard Sales - Return Rcpt."); @@ -3456,12 +3505,15 @@ codeunit 134421 "Report Selections Tests" LibrarySales.PostSalesDocument(SalesHeader, true, false); SalesPost.GetPostedDocumentRecord(SalesHeader, PostedDocumentVariant); end; +#endif +#if not CLEAN29 local procedure UpdateYourReferenceSalesHeader(var SalesHeader: Record "Sales Header"; YourReference: Text[35]) begin SalesHeader."Your Reference" := YourReference; SalesHeader.Modify(); end; +#endif [RequestPageHandler] [Scope('OnPrem')] @@ -3640,6 +3692,7 @@ codeunit 134421 "Report Selections Tests" VendorReportSelections.CopyFromReportSelectionsAction.Invoke(); end; +#if not CLEAN29 [ModalPageHandler] procedure VendorReportSelectionsHandler(var VendorReportSelections: TestPage "Vendor Report Selections") begin @@ -3647,6 +3700,7 @@ codeunit 134421 "Report Selections Tests" VendorReportSelections."Custom Report Description".Drilldown(); VendorReportSelections."Custom Report Description".AssertEquals(LibraryVariableStorage.DequeueText()); end; +#endif [ModalPageHandler] procedure ProFormInvoiceCustomerReportSelectionsHandler(var CustomerReportSelections: TestPage "Customer Report Selections") diff --git a/src/Layers/APAC/Tests/Report/ReportLayoutTest.Codeunit.al b/src/Layers/APAC/Tests/Report/ReportLayoutTest.Codeunit.al index 58ce63e6899..2c838439e28 100644 --- a/src/Layers/APAC/Tests/Report/ReportLayoutTest.Codeunit.al +++ b/src/Layers/APAC/Tests/Report/ReportLayoutTest.Codeunit.al @@ -20,11 +20,15 @@ codeunit 134600 "Report Layout Test" LibraryUtility: Codeunit "Library - Utility"; LibraryRandom: Codeunit "Library - Random"; LibrarySales: Codeunit "Library - Sales"; +#pragma warning disable AA0137 LibraryTablesUT: Codeunit "Library - Tables UT"; +#pragma warning restore AA0137 LibraryVariableStorage: Codeunit "Library - Variable Storage"; LibraryTestInitialize: Codeunit "Library - Test Initialize"; LibrarySetupStorage: Codeunit "Library - Setup Storage"; +#if not CLEAN29 Usage: Option "Order Confirmation","Work Order","Pick Instruction"; +#endif IsInitialized: Boolean; local procedure Initialize() @@ -90,6 +94,7 @@ codeunit 134600 "Report Layout Test" asserterror ReportLayoutSelection.Validate(Type, ReportLayoutSelection.Type::"External Layout"); end; +#if not CLEAN29 [Test] [Scope('OnPrem')] procedure TestReportLayoutSelectionReportLayoutID() @@ -118,6 +123,7 @@ codeunit 134600 "Report Layout Test" // Verify Assert.IsTrue(ReportLayoutSelection.Type = ReportLayoutSelection.Type::"RDLC (built-in)", ''); end; +#endif [Test] [Scope('OnPrem')] @@ -131,6 +137,7 @@ codeunit 134600 "Report Layout Test" end; +#if not CLEAN29 [Test] [Scope('OnPrem')] procedure TestTableCustomReportLayoutTriggers() @@ -173,6 +180,7 @@ codeunit 134600 "Report Layout Test" CustomReportLayout.ClearLayout(); Assert.IsFalse(CustomReportLayout.ValidateLayout(false, false), ''); end; +#endif #if not CLEAN28 [Test] @@ -201,6 +209,7 @@ codeunit 134600 "Report Layout Test" end; #endif +#if not CLEAN29 [Test] [Scope('OnPrem')] procedure TestCopyRecord() @@ -281,6 +290,7 @@ codeunit 134600 "Report Layout Test" // Validate Assert.IsTrue(StrPos(GetLastErrorText, 'The RDLC layout does not comply with the current report design (for example') = 1, ''); end; +#endif [Test] [Scope('OnPrem')] @@ -553,6 +563,7 @@ codeunit 134600 "Report Layout Test" VerifyRun(REPORT::"Test Report - Processing Only"); end; +#if not CLEAN29 [Test] [HandlerFunctions('ScheduleAReportHandlerCancel')] [Scope('OnPrem')] @@ -733,6 +744,7 @@ codeunit 134600 "Report Layout Test" // [THEN] REP 1305 "Order Confirmation" is shown // OrderConfirmation_RPH end; +#endif [Test] [HandlerFunctions('StandardSalesInvoiceRequestPageHandler')] @@ -775,21 +787,28 @@ codeunit 134600 "Report Layout Test" VerifyJobTaskNo(20000, SalesLine[2]."Job Task No."); end; +#if not CLEAN29 [Test] [Scope('OnPrem')] procedure TestLenghtOfDescriptionCustomReportLayout() var +#pragma warning disable AL0432 CustomReportLayout: Record "Custom Report Layout"; +#pragma warning restore AL0432 CustomReportSelection: Record "Custom Report Selection"; begin // [FEATURE] [UT] // [SCENARIO 252058] Length of "Custom Report Layout"."Description" shoud be equal to length of "Custom Report Selection"."Custom Report Description" +#pragma warning disable AL0432 LibraryTablesUT.CompareFieldTypeAndLength( CustomReportLayout, CustomReportLayout.FieldNo(Description), CustomReportSelection, CustomReportSelection.FieldNo("Custom Report Description")); +#pragma warning restore AL0432 end; +#endif +#if not CLEAN29 [Test] [HandlerFunctions('MessageHandler')] [Scope('OnPrem')] @@ -835,7 +854,9 @@ codeunit 134600 "Report Layout Test" // and getting Sales Header RecordId to be sure it point to correct record "SO" Assert.ExpectedMessage(Format(SalesHeader.RecordId()), LibraryVariableStorage.DequeueText()); // message from MessageHandler end; +#endif +#if not CLEAN29 local procedure InitCustomReportLayout(var CustomReportLayout: Record "Custom Report Layout"; LayoutType: Enum "Custom Report Layout Type"; WithCompanyName: Boolean) var LayoutCode: Code[20]; @@ -848,14 +869,17 @@ codeunit 134600 "Report Layout Test" CustomReportLayout.Modify(true); end; end; +#endif local procedure InitReportSelection(ReportID: Integer; Selection: Option "None","RDLC (Built-in)","Word (Built-in)","Custom RDLC","Custom Word","Excel Layout","External Layout") var ReportLayoutSelection: Record "Report Layout Selection"; TenantReportLayoutSelection: Record "Tenant Report Layout Selection"; ReportLayoutList: Record "Report Layout List"; +#if not CLEAN29 CustomReportLayout: Record "Custom Report Layout"; LayoutCode: Code[20]; +#endif begin if ReportLayoutSelection.Get(ReportID, CompanyName) then ReportLayoutSelection.Delete(); @@ -875,6 +899,7 @@ codeunit 134600 "Report Layout Test" ReportLayoutSelection.Type := ReportLayoutSelection.Type::"RDLC (built-in)"; Selection::"Word (Built-in)": ReportLayoutSelection.Type := ReportLayoutSelection.Type::"Word (built-in)"; +#if not CLEAN29 Selection::"Custom RDLC": begin ReportLayoutSelection.Type := ReportLayoutSelection.Type::"Custom Layout"; @@ -889,6 +914,7 @@ codeunit 134600 "Report Layout Test" CustomReportLayout.Get(LayoutCode); ReportLayoutSelection."Custom Report Layout Code" := CustomReportLayout.Code; end; +#endif Selection::"Excel Layout": begin SetupSelection(ReportLayoutList, TenantReportLayoutSelection, ReportLayoutList."Layout Format"::Excel); @@ -922,6 +948,7 @@ codeunit 134600 "Report Layout Test" TenantReportLayoutSelection.DeleteAll(true); end; +#if not CLEAN29 local procedure AddOrderConfirmationToCustomReportLayout(): Code[20] var CustomReportLayout: Record "Custom Report Layout"; @@ -940,7 +967,9 @@ codeunit 134600 "Report Layout Test" CustomerNo, CustomReportSelection.Usage::"S.Order", REPORT::"Standard Sales - Order Conf.", AddOrderConfirmationToCustomReportLayout()); end; +#endif +#if not CLEAN29 local procedure AddCustomerDocumentLayoutReport(CustomerNo: Code[20]; NewUsage: Enum "Report Selection Usage"; ReportID: Integer; CustomReportLayoutCode: Code[20]) var CustomReportSelection: Record "Custom Report Selection"; @@ -954,6 +983,7 @@ codeunit 134600 "Report Layout Test" CustomReportSelection."Custom Report Layout Code" := CustomReportLayoutCode; CustomReportSelection.Insert(true); end; +#endif local procedure CreateSalesLineWithJobTaskNo(SalesHeader: Record "Sales Header"; var SalesLine: Record "Sales Line") var diff --git a/src/Layers/AT/BaseApp/Foundation/Company/CompanyInitialize.Codeunit.al b/src/Layers/AT/BaseApp/Foundation/Company/CompanyInitialize.Codeunit.al index b903318e8d2..bf6929b6caa 100644 --- a/src/Layers/AT/BaseApp/Foundation/Company/CompanyInitialize.Codeunit.al +++ b/src/Layers/AT/BaseApp/Foundation/Company/CompanyInitialize.Codeunit.al @@ -775,7 +775,11 @@ codeunit 2 "Company-Initialize" var AssistedCompanySetupStatus: Record "Assisted Company Setup Status"; ApplicationAreaSetup: Record "Application Area Setup"; +#if not CLEAN29 +#pragma warning disable AL0432, AS0105 CustomReportLayout: Record "Custom Report Layout"; +#pragma warning restore AL0432, AS0105 +#endif ReportLayoutSelection: Record "Report Layout Selection"; ExperienceTierSetup: Record "Experience Tier Setup"; begin @@ -786,8 +790,10 @@ codeunit 2 "Company-Initialize" AssistedCompanySetupStatus.DeleteAll(); ApplicationAreaSetup.SetRange("Company Name", Rec.Name); ApplicationAreaSetup.DeleteAll(); +#if not CLEAN29 CustomReportLayout.SetRange("Company Name", Rec.Name); CustomReportLayout.DeleteAll(); +#endif ReportLayoutSelection.SetRange("Company Name", Rec.Name); ReportLayoutSelection.DeleteAll(); diff --git a/src/Layers/BE/BaseApp/Foundation/Company/CompanyInitialize.Codeunit.al b/src/Layers/BE/BaseApp/Foundation/Company/CompanyInitialize.Codeunit.al index 41780f8845f..b4861ac8146 100644 --- a/src/Layers/BE/BaseApp/Foundation/Company/CompanyInitialize.Codeunit.al +++ b/src/Layers/BE/BaseApp/Foundation/Company/CompanyInitialize.Codeunit.al @@ -766,7 +766,11 @@ codeunit 2 "Company-Initialize" var AssistedCompanySetupStatus: Record "Assisted Company Setup Status"; ApplicationAreaSetup: Record "Application Area Setup"; +#if not CLEAN29 +#pragma warning disable AL0432, AS0105 CustomReportLayout: Record "Custom Report Layout"; +#pragma warning restore AL0432, AS0105 +#endif ReportLayoutSelection: Record "Report Layout Selection"; ExperienceTierSetup: Record "Experience Tier Setup"; begin @@ -777,8 +781,10 @@ codeunit 2 "Company-Initialize" AssistedCompanySetupStatus.DeleteAll(); ApplicationAreaSetup.SetRange("Company Name", Rec.Name); ApplicationAreaSetup.DeleteAll(); +#if not CLEAN29 CustomReportLayout.SetRange("Company Name", Rec.Name); CustomReportLayout.DeleteAll(); +#endif ReportLayoutSelection.SetRange("Company Name", Rec.Name); ReportLayoutSelection.DeleteAll(); diff --git a/src/Layers/BE/DemoTool/CreateRapidStartPackage.Codeunit.al b/src/Layers/BE/DemoTool/CreateRapidStartPackage.Codeunit.al index f521b2207e7..326eb24ec6c 100644 --- a/src/Layers/BE/DemoTool/CreateRapidStartPackage.Codeunit.al +++ b/src/Layers/BE/DemoTool/CreateRapidStartPackage.Codeunit.al @@ -250,7 +250,11 @@ codeunit 101995 "Create RapidStart Package" CreateTable(Database::"Word Template"); // Reporting +#if not CLEAN29 +#pragma warning disable AL0432, AS0105 CreateTable(DATABASE::"Custom Report Layout"); +#pragma warning restore AL0432, AS0105 +#endif CreateConfigPackageHelper.SetSkipTableTriggers(); // Office Add-Ins diff --git a/src/Layers/BE/Tests/Report/ReportLayoutTest.Codeunit.al b/src/Layers/BE/Tests/Report/ReportLayoutTest.Codeunit.al index 482f877830f..756d7889ed2 100644 --- a/src/Layers/BE/Tests/Report/ReportLayoutTest.Codeunit.al +++ b/src/Layers/BE/Tests/Report/ReportLayoutTest.Codeunit.al @@ -23,11 +23,15 @@ codeunit 134600 "Report Layout Test" LibraryRandom: Codeunit "Library - Random"; LibrarySales: Codeunit "Library - Sales"; LibraryBEHelper: Codeunit "Library - BE Helper"; +#pragma warning disable AA0137 LibraryTablesUT: Codeunit "Library - Tables UT"; +#pragma warning restore AA0137 LibraryVariableStorage: Codeunit "Library - Variable Storage"; LibraryTestInitialize: Codeunit "Library - Test Initialize"; LibrarySetupStorage: Codeunit "Library - Setup Storage"; +#if not CLEAN29 Usage: Option "Order Confirmation","Work Order","Pick Instruction"; +#endif IsInitialized: Boolean; local procedure Initialize() @@ -93,6 +97,7 @@ codeunit 134600 "Report Layout Test" asserterror ReportLayoutSelection.Validate(Type, ReportLayoutSelection.Type::"External Layout"); end; +#if not CLEAN29 [Test] [Scope('OnPrem')] procedure TestReportLayoutSelectionReportLayoutID() @@ -121,6 +126,7 @@ codeunit 134600 "Report Layout Test" // Verify Assert.IsTrue(ReportLayoutSelection.Type = ReportLayoutSelection.Type::"RDLC (built-in)", ''); end; +#endif [Test] [Scope('OnPrem')] @@ -134,6 +140,7 @@ codeunit 134600 "Report Layout Test" end; +#if not CLEAN29 [Test] [Scope('OnPrem')] procedure TestTableCustomReportLayoutTriggers() @@ -176,6 +183,7 @@ codeunit 134600 "Report Layout Test" CustomReportLayout.ClearLayout(); Assert.IsFalse(CustomReportLayout.ValidateLayout(false, false), ''); end; +#endif #if not CLEAN28 [Test] @@ -204,6 +212,7 @@ codeunit 134600 "Report Layout Test" end; #endif +#if not CLEAN29 [Test] [Scope('OnPrem')] procedure TestCopyRecord() @@ -284,6 +293,7 @@ codeunit 134600 "Report Layout Test" // Validate Assert.IsTrue(StrPos(GetLastErrorText, 'The RDLC layout does not comply with the current report design (for example') = 1, ''); end; +#endif [Test] [Scope('OnPrem')] @@ -556,6 +566,7 @@ codeunit 134600 "Report Layout Test" VerifyRun(REPORT::"Test Report - Processing Only"); end; +#if not CLEAN29 [Test] [HandlerFunctions('ScheduleAReportHandlerCancel')] [Scope('OnPrem')] @@ -649,6 +660,7 @@ codeunit 134600 "Report Layout Test" VerifySchedule(REPORT::"Test Report - Processing Only"); VerifyRun(REPORT::"Test Report - Processing Only"); end; +#endif [Test] [Scope('OnPrem')] @@ -671,6 +683,7 @@ codeunit 134600 "Report Layout Test" CompanyInformation.Modify(); end; +#if not CLEAN29 [Test] [HandlerFunctions('WorkOrder_RPH')] [Scope('OnPrem')] @@ -757,6 +770,7 @@ codeunit 134600 "Report Layout Test" // [THEN] REP 1305 "Order Confirmation" is shown // OrderConfirmation_RPH end; +#endif [Test] [HandlerFunctions('StandardSalesInvoiceRequestPageHandler')] @@ -799,21 +813,28 @@ codeunit 134600 "Report Layout Test" VerifyJobTaskNo(20000, SalesLine[2]."Job Task No."); end; +#if not CLEAN29 [Test] [Scope('OnPrem')] procedure TestLenghtOfDescriptionCustomReportLayout() var +#pragma warning disable AL0432 CustomReportLayout: Record "Custom Report Layout"; +#pragma warning restore AL0432 CustomReportSelection: Record "Custom Report Selection"; begin // [FEATURE] [UT] // [SCENARIO 252058] Length of "Custom Report Layout"."Description" shoud be equal to length of "Custom Report Selection"."Custom Report Description" +#pragma warning disable AL0432 LibraryTablesUT.CompareFieldTypeAndLength( CustomReportLayout, CustomReportLayout.FieldNo(Description), CustomReportSelection, CustomReportSelection.FieldNo("Custom Report Description")); +#pragma warning restore AL0432 end; +#endif +#if not CLEAN29 [Test] [HandlerFunctions('MessageHandler')] [Scope('OnPrem')] @@ -859,7 +880,9 @@ codeunit 134600 "Report Layout Test" // and getting Sales Header RecordId to be sure it point to correct record "SO" Assert.ExpectedMessage(Format(SalesHeader.RecordId()), LibraryVariableStorage.DequeueText()); // message from MessageHandler end; +#endif +#if not CLEAN29 local procedure InitCustomReportLayout(var CustomReportLayout: Record "Custom Report Layout"; LayoutType: Enum "Custom Report Layout Type"; WithCompanyName: Boolean) var LayoutCode: Code[20]; @@ -872,14 +895,17 @@ codeunit 134600 "Report Layout Test" CustomReportLayout.Modify(true); end; end; +#endif local procedure InitReportSelection(ReportID: Integer; Selection: Option "None","RDLC (Built-in)","Word (Built-in)","Custom RDLC","Custom Word","Excel Layout","External Layout") var ReportLayoutSelection: Record "Report Layout Selection"; TenantReportLayoutSelection: Record "Tenant Report Layout Selection"; ReportLayoutList: Record "Report Layout List"; +#if not CLEAN29 CustomReportLayout: Record "Custom Report Layout"; LayoutCode: Code[20]; +#endif begin if ReportLayoutSelection.Get(ReportID, CompanyName) then ReportLayoutSelection.Delete(); @@ -899,6 +925,7 @@ codeunit 134600 "Report Layout Test" ReportLayoutSelection.Type := ReportLayoutSelection.Type::"RDLC (built-in)"; Selection::"Word (Built-in)": ReportLayoutSelection.Type := ReportLayoutSelection.Type::"Word (built-in)"; +#if not CLEAN29 Selection::"Custom RDLC": begin ReportLayoutSelection.Type := ReportLayoutSelection.Type::"Custom Layout"; @@ -913,6 +940,7 @@ codeunit 134600 "Report Layout Test" CustomReportLayout.Get(LayoutCode); ReportLayoutSelection."Custom Report Layout Code" := CustomReportLayout.Code; end; +#endif Selection::"Excel Layout": begin SetupSelection(ReportLayoutList, TenantReportLayoutSelection, ReportLayoutList."Layout Format"::Excel); @@ -946,6 +974,7 @@ codeunit 134600 "Report Layout Test" TenantReportLayoutSelection.DeleteAll(true); end; +#if not CLEAN29 local procedure AddOrderConfirmationToCustomReportLayout(): Code[20] var CustomReportLayout: Record "Custom Report Layout"; @@ -964,7 +993,9 @@ codeunit 134600 "Report Layout Test" CustomerNo, CustomReportSelection.Usage::"S.Order", REPORT::"Standard Sales - Order Conf.", AddOrderConfirmationToCustomReportLayout()); end; +#endif +#if not CLEAN29 local procedure AddCustomerDocumentLayoutReport(CustomerNo: Code[20]; NewUsage: Enum "Report Selection Usage"; ReportID: Integer; CustomReportLayoutCode: Code[20]) var CustomReportSelection: Record "Custom Report Selection"; @@ -978,6 +1009,7 @@ codeunit 134600 "Report Layout Test" CustomReportSelection."Custom Report Layout Code" := CustomReportLayoutCode; CustomReportSelection.Insert(true); end; +#endif local procedure CreateSalesLineWithJobTaskNo(SalesHeader: Record "Sales Header"; var SalesLine: Record "Sales Line") var diff --git a/src/Layers/CH/BaseApp/Foundation/Company/CompanyInitialize.Codeunit.al b/src/Layers/CH/BaseApp/Foundation/Company/CompanyInitialize.Codeunit.al index 80b49b89f78..ce6be7ccc7a 100644 --- a/src/Layers/CH/BaseApp/Foundation/Company/CompanyInitialize.Codeunit.al +++ b/src/Layers/CH/BaseApp/Foundation/Company/CompanyInitialize.Codeunit.al @@ -793,7 +793,11 @@ codeunit 2 "Company-Initialize" var AssistedCompanySetupStatus: Record "Assisted Company Setup Status"; ApplicationAreaSetup: Record "Application Area Setup"; +#if not CLEAN29 +#pragma warning disable AL0432, AS0105 CustomReportLayout: Record "Custom Report Layout"; +#pragma warning restore AL0432, AS0105 +#endif ReportLayoutSelection: Record "Report Layout Selection"; ExperienceTierSetup: Record "Experience Tier Setup"; begin @@ -804,8 +808,10 @@ codeunit 2 "Company-Initialize" AssistedCompanySetupStatus.DeleteAll(); ApplicationAreaSetup.SetRange("Company Name", Rec.Name); ApplicationAreaSetup.DeleteAll(); +#if not CLEAN29 CustomReportLayout.SetRange("Company Name", Rec.Name); CustomReportLayout.DeleteAll(); +#endif ReportLayoutSelection.SetRange("Company Name", Rec.Name); ReportLayoutSelection.DeleteAll(); diff --git a/src/Layers/CH/Tests/Misc/PaymentServicesTest.Codeunit.al b/src/Layers/CH/Tests/Misc/PaymentServicesTest.Codeunit.al index 8ecc0f176e4..f3319342f5f 100644 --- a/src/Layers/CH/Tests/Misc/PaymentServicesTest.Codeunit.al +++ b/src/Layers/CH/Tests/Misc/PaymentServicesTest.Codeunit.al @@ -1,3 +1,4 @@ +#pragma warning disable AL0432, AS0105 codeunit 134425 "Payment Services Test" { EventSubscriberInstance = Manual; @@ -1485,20 +1486,26 @@ codeunit 134425 "Payment Services Test" local procedure SetupReportSelections() var +#if not CLEAN29 CustomReportLayout: Record "Custom Report Layout"; +#endif ReportSelections: Record "Report Selections"; begin ReportSelections.DeleteAll(); CreateDefaultReportSelection(); +#if not CLEAN29 GetCustomBodyLayout(CustomReportLayout); +#endif ReportSelections.Reset(); ReportSelections.SetRange(Usage, ReportSelections.Usage::"S.Invoice"); ReportSelections.FindFirst(); ReportSelections.Validate("Use for Email Attachment", true); ReportSelections.Validate("Use for Email Body", true); +#if not CLEAN29 ReportSelections.Validate("Email Body Layout Code", CustomReportLayout.Code); +#endif ReportSelections.Modify(true); end; @@ -1513,6 +1520,7 @@ codeunit 134425 "Payment Services Test" ReportSelections.Insert(); end; +#if not CLEAN29 local procedure GetReportID(): Integer begin exit(REPORT::"Standard Sales - Invoice"); @@ -1551,6 +1559,7 @@ codeunit 134425 "Payment Services Test" CustomReportLayout.Insert(); end; end; +#endif local procedure AssignMockSetupRecordID(var TempPaymentServiceSetup: Record "Payment Service Setup" temporary) var @@ -1955,3 +1964,4 @@ codeunit 134425 "Payment Services Test" ActiveDirectoryMockEvents.Enable(); end; } +#pragma warning restore AL0432, AS0105 diff --git a/src/Layers/CZ/DemoTool/CreateRapidStartPackage.Codeunit.al b/src/Layers/CZ/DemoTool/CreateRapidStartPackage.Codeunit.al index 19b780b2101..72579f5dc2c 100644 --- a/src/Layers/CZ/DemoTool/CreateRapidStartPackage.Codeunit.al +++ b/src/Layers/CZ/DemoTool/CreateRapidStartPackage.Codeunit.al @@ -252,7 +252,11 @@ codeunit 101995 "Create RapidStart Package" CreateTable(Database::"Word Template"); // Reporting +#if not CLEAN29 +#pragma warning disable AL0432, AS0105 CreateTable(DATABASE::"Custom Report Layout"); +#pragma warning restore AL0432, AS0105 +#endif CreateConfigPackageHelper.SetSkipTableTriggers(); // Office Add-Ins diff --git a/src/Layers/CZ/Tests/Misc/ReportSelectionsTests.Codeunit.al b/src/Layers/CZ/Tests/Misc/ReportSelectionsTests.Codeunit.al index b36ffb2e851..4b41da01cb7 100644 --- a/src/Layers/CZ/Tests/Misc/ReportSelectionsTests.Codeunit.al +++ b/src/Layers/CZ/Tests/Misc/ReportSelectionsTests.Codeunit.al @@ -28,22 +28,31 @@ codeunit 134421 "Report Selections Tests" FromEmailBodyTemplateTxt: Text; Initialized: Boolean; TemplateIdentificationTxt: Label 'a'; +#if not CLEAN29 CustomerEmailTxt: Label 'Customer@contoso.com'; CustomLayoutEmailTxt: Label 'CustomLayout@contoso.com'; +#endif WrongEmailAddressErr: Label 'Email Address is wrong on Send Email Dialog'; +#if not CLEAN29 DocumentNoTok: Label 'DocumentNo'; +#endif ReportIDMustHaveValueErr: Label 'Report ID must have a value'; +#if not CLEAN29 EmailAddressErr: Label 'Destination email address does not match expected address.'; +#endif StatementTitlePdfTxt: Label 'Statement'; ReportTitleTemplatePdfTxt: Label '%1 for %2 as of %3.pdf'; #if not CLEAN28 LayoutCodeShouldNotChangedErr: Label 'Layout code should not change.'; #endif SendToEmailTxt: Label 'test@test.com'; +#if not CLEAN29 MSXLbl: Label 'MS-X%1', Comment = '%1 = Random Value'; DocxLbl: Label 'docx'; MustSelectAndEmailBodyOrAttahmentErr: Label 'You must select an email body or attachment in report selection for %1.', Comment = '%1 = Usage, for example Sales Invoice'; +#endif +#if not CLEAN29 [Test] [HandlerFunctions('StandardSalesInvoiceRequestPageHandler')] [Scope('OnPrem')] @@ -93,6 +102,7 @@ codeunit 134421 "Report Selections Tests" // Verify VerifySendEmailPage(FromEmailBodyTemplateTxt, TemplateIdentificationTxt, PostedSalesInvoice."No.".Value); end; +#endif [Test] [HandlerFunctions('SelectSendingOptionHandler,EmailEditorHandler,CloseEmailEditorHandler')] @@ -119,6 +129,7 @@ codeunit 134421 "Report Selections Tests" VerifySendEmailPage(FromEmailBodyTemplateTxt, TemplateIdentificationTxt, PurchaseOrder."No.".Value); end; +#if not CLEAN29 [Test] [Scope('OnPrem')] procedure TesteEmailNoBodyNoAttachmentRaisesError() @@ -137,6 +148,7 @@ codeunit 134421 "Report Selections Tests" // Verify Assert.ExpectedError('email body or attachment'); end; +#endif [Test] [HandlerFunctions('SelectSendingOptionHandler')] @@ -158,6 +170,7 @@ codeunit 134421 "Report Selections Tests" Assert.ExpectedError('email body or attachment'); end; +#if not CLEAN29 [Test] [HandlerFunctions('EmailEditorHandlerCustomMessage,CloseEmailEditorHandler')] [Scope('OnPrem')] @@ -360,8 +373,10 @@ codeunit 134421 "Report Selections Tests" // Verify is within handler end; +#endif #if not CLEAN27 +#if not CLEAN29 [Test] [Scope('OnPrem')] procedure TestHTMLEmailBodyLoad() @@ -483,7 +498,9 @@ codeunit 134421 "Report Selections Tests" StrSubstNo('Destination email address does not match expected address %1', CustomLayoutEmailTxt)); end; #endif +#endif +#if not CLEAN29 [Test] [Scope('OnPrem')] procedure TestHTMLEmailBodyLoadFromBlob() @@ -623,6 +640,7 @@ codeunit 134421 "Report Selections Tests" LibraryVariableStorage.AssertEmpty(); end; +#endif [Test] [HandlerFunctions('SelectSendingOptionHandlerPrint,PurchaseOrderRequestPageHandler')] @@ -664,6 +682,7 @@ codeunit 134421 "Report Selections Tests" Assert.RecordCount(PurchaseHeaderArchive, 2); end; +#if not CLEAN29 [Test] [HandlerFunctions('StandardSalesInvoiceRequestPageHandler')] [Scope('OnPrem')] @@ -688,6 +707,7 @@ codeunit 134421 "Report Selections Tests" LibraryVariableStorage.AssertEmpty(); end; +#endif [Test] [HandlerFunctions('EmailEditorHandler,CloseEmailEditorHandler')] @@ -970,6 +990,7 @@ codeunit 134421 "Report Selections Tests" LibraryVariableStorage.AssertEmpty(); end; +#if not CLEAN29 [Test] [HandlerFunctions('StatementOKRequestPageHandler,DownloadAttachmentNoConfirmHandler')] [Scope('OnPrem')] @@ -1022,6 +1043,7 @@ codeunit 134421 "Report Selections Tests" FindInteractionLogEntriesByCustomerNo(InteractionLogEntry, CustomerNo, InteractionLogEntry."Document Type"::"Sales Stmnt."); Assert.RecordCount(InteractionLogEntry, 1); end; +#endif [Test] @@ -1363,6 +1385,7 @@ codeunit 134421 "Report Selections Tests" Assert.IsTrue(StrPos(CustomerReportSelections.SendToEmail.Value, 'testcase@testcase.com') <> 0, 'Wrong email after contact update.'); end; +#if not CLEAN29 [Test] [Scope('OnPrem')] procedure PostedSalesInvoiceEmailHasMorePriorityThanCustomerEmail() @@ -1398,6 +1421,7 @@ codeunit 134421 "Report Selections Tests" // [THEN] The "a@a.com; b@b.com; c@c.com" address is used as target email address. Assert.AreEqual(SalesHeader."Sell-to E-Mail", EmailAddress, EmailAddressErr); end; +#endif [Test] [Scope('OnPrem')] @@ -1563,6 +1587,7 @@ codeunit 134421 "Report Selections Tests" LibraryTempNVBufferHandler.AssertQueueEmpty(); end; +#if not CLEAN29 [Test] [HandlerFunctions('TestAddressEmailEditorHandler,CloseEmailEditorHandler')] [Scope('OnPrem')] @@ -1611,6 +1636,7 @@ codeunit 134421 "Report Selections Tests" LibraryVariableStorage.AssertEmpty(); end; +#endif [Test] [Scope('OnPrem')] @@ -2078,6 +2104,7 @@ codeunit 134421 "Report Selections Tests" // No assertion needed - if we reach this point, the fix is working end; +#if not CLEAN29 [Test] [HandlerFunctions('SelectSendingOptionHandler,EmailEditorHandler,CloseEmailEditorHandler')] procedure TestSendPostedSalesShipmentToEMailAndPDF() @@ -2652,6 +2679,7 @@ codeunit 134421 "Report Selections Tests" // [THEN] Verify message type with Email Handler. end; +#endif local procedure Initialize() var @@ -2856,6 +2884,7 @@ codeunit 134421 "Report Selections Tests" SalesInvoiceHeader.Get(LibrarySales.PostSalesDocument(SalesHeader, true, true)); end; +#if not CLEAN29 local procedure OpenNewPostedSalesInvoice(var PostedSalesInvoice: TestPage "Posted Sales Invoice") var SalesInvoiceHeader: Record "Sales Invoice Header"; @@ -2864,6 +2893,7 @@ codeunit 134421 "Report Selections Tests" PostedSalesInvoice.OpenEdit(); PostedSalesInvoice.GotoRecord(SalesInvoiceHeader); end; +#endif [Scope('OnPrem')] procedure OpenNewPurchaseOrder(var PurchaseOrderPage: TestPage "Purchase Order") @@ -2875,6 +2905,7 @@ codeunit 134421 "Report Selections Tests" PurchaseOrderPage.GotoRecord(PurchaseHeader); end; +#if not CLEAN29 local procedure SetupReportSelections(UseForEmailAttachment: Boolean; UseForEmailBody: Boolean) var OldReportSelections: Record "Report Selections"; @@ -2890,19 +2921,18 @@ codeunit 134421 "Report Selections Tests" OldReportSelections.Usage::"S.Invoice", CustomReportLayout."Report ID", UseForEmailAttachment, UseForEmailBody, CustomReportLayout.Code); end; +#endif local procedure SetupReportSelectionsVendor(UseForEmailAttachment: Boolean; UseForEmailBody: Boolean) var OldReportSelections: Record "Report Selections"; - DummyCustomReportLayout: Record "Custom Report Layout"; begin OldReportSelections.Reset(); OldReportSelections.SetRange(Usage, OldReportSelections.Usage::"P.Order"); OldReportSelections.FindFirst(); UpdateReportSelections( - OldReportSelections.Usage::"P.Order", GetReportIDForPurchaseOrder(), UseForEmailAttachment, UseForEmailBody, - DummyCustomReportLayout.Code); + OldReportSelections.Usage::"P.Order", GetReportIDForPurchaseOrder(), UseForEmailAttachment, UseForEmailBody, ''); end; local procedure SetupInvoiceReportLayoutSelection() @@ -2964,6 +2994,7 @@ codeunit 134421 "Report Selections Tests" ReportSelections.Modify(true); end; +#if not CLEAN29 local procedure UpdateCustomReportSelections(NewCustNo: Code[20]; UseForEmailAttachment: Boolean; UseForEmailBody: Boolean; SendToAddress: Text[200]) var CustomReportSelection: Record "Custom Report Selection"; @@ -2982,16 +3013,19 @@ codeunit 134421 "Report Selections Tests" CustomReportSelection.Modify(true); end; +#endif local procedure GenerateGUIDWithSpecialSymbol(): Code[20] begin exit(LibraryUtility.GenerateGUID() + '&'); end; +#if not CLEAN29 local procedure GetStandardSalesInvoiceReportID(): Integer begin exit(REPORT::"Standard Sales - Invoice"); end; +#endif local procedure GetReportIDForPurchaseOrder(): Integer begin @@ -3008,6 +3042,7 @@ codeunit 134421 "Report Selections Tests" exit(REPORT::Statement); end; +#if not CLEAN29 local procedure GetCustomBodyLayout(var CustomReportLayout: Record "Custom Report Layout") var ReportLayoutList: Record "Report Layout List"; @@ -3039,6 +3074,7 @@ codeunit 134421 "Report Selections Tests" CustomReportLayout.Insert(); end; end; +#endif #if not CLEAN27 local procedure GetEmailItem(var EmailItem: Record "Email Item"; MessageType: Integer; BodyFilePath: Text[250]; Plaintext: Boolean) @@ -3049,12 +3085,15 @@ codeunit 134421 "Report Selections Tests" end; #endif +#if not CLEAN29 local procedure GetEmailItem(var EmailItem: Record "Email Item"; MessageType: Option "Custom Message","From Email Body Template"; var EmailBody: Codeunit "Temp Blob") begin EmailItem.Validate("Message Type", MessageType); EmailItem.SetBody(EmailBody); end; +#endif +#if not CLEAN29 local procedure SetUpCustomEmail(var SalesInvoiceHeader: Record "Sales Invoice Header"; EmailAddress: Text[80]; UseCustomForEmailBody: Boolean) var Customer: Record Customer; @@ -3067,6 +3106,7 @@ codeunit 134421 "Report Selections Tests" UpdateCustomReportSelections(SalesInvoiceHeader."Bill-to Customer No.", true, UseCustomForEmailBody, EmailAddress); end; +#endif local procedure GenerateRandomPackageTrackingNo(): Text[50] var @@ -3236,6 +3276,7 @@ codeunit 134421 "Report Selections Tests" CustomReportSelection.GetSendToEmailFromContacts(Contact); end; +#if not CLEAN29 local procedure UpdateContactEmail(var Contact: Record Contact; Email: Text[45]) begin Contact.Validate("E-Mail", Email); @@ -3251,6 +3292,7 @@ codeunit 134421 "Report Selections Tests" Customer.Validate("Primary Contact No.", Contact."No."); Customer.Modify(); end; +#endif #if not CLEAN28 local procedure StandardSalesInvoiceReportID(): Integer @@ -3259,6 +3301,7 @@ codeunit 134421 "Report Selections Tests" end; #endif +#if not CLEAN29 local procedure SetupSalesShipmentReportSelections(UseForEmailAttachment: Boolean; UseForEmailBody: Boolean) var OldReportSelections: Record "Report Selections"; @@ -3329,7 +3372,9 @@ codeunit 134421 "Report Selections Tests" CustomReportSelection.Modify(true); end; +#endif +#if not CLEAN29 local procedure GetStandardSalesShipmentReportID(): Integer begin exit(Report::"Standard Sales - Shipment"); @@ -3351,7 +3396,9 @@ codeunit 134421 "Report Selections Tests" LibrarySales.PostSalesDocument(SalesHeader, true, false); SalesPost.GetPostedDocumentRecord(SalesHeader, PostedDocumentVariant); end; +#endif +#if not CLEAN29 local procedure SetupSalesReturnReceiptReportSelections(UseForEmailAttachment: Boolean; UseForEmailBody: Boolean) var OldReportSelections: Record "Report Selections"; @@ -3422,7 +3469,9 @@ codeunit 134421 "Report Selections Tests" CustomReportSelection.Modify(true); end; +#endif +#if not CLEAN29 local procedure GetStandardSalesReturnReceiptReportID(): Integer begin exit(Report::"Standard Sales - Return Rcpt."); @@ -3444,12 +3493,15 @@ codeunit 134421 "Report Selections Tests" LibrarySales.PostSalesDocument(SalesHeader, true, false); SalesPost.GetPostedDocumentRecord(SalesHeader, PostedDocumentVariant); end; +#endif +#if not CLEAN29 local procedure UpdateYourReferenceSalesHeader(var SalesHeader: Record "Sales Header"; YourReference: Text[35]) begin SalesHeader."Your Reference" := YourReference; SalesHeader.Modify(); end; +#endif [RequestPageHandler] [Scope('OnPrem')] @@ -3628,6 +3680,7 @@ codeunit 134421 "Report Selections Tests" VendorReportSelections.CopyFromReportSelectionsAction.Invoke(); end; +#if not CLEAN29 [ModalPageHandler] procedure VendorReportSelectionsHandler(var VendorReportSelections: TestPage "Vendor Report Selections") begin @@ -3635,6 +3688,7 @@ codeunit 134421 "Report Selections Tests" VendorReportSelections."Custom Report Description".Drilldown(); VendorReportSelections."Custom Report Description".AssertEquals(LibraryVariableStorage.DequeueText()); end; +#endif [ModalPageHandler] procedure ProFormInvoiceCustomerReportSelectionsHandler(var CustomerReportSelections: TestPage "Customer Report Selections") diff --git a/src/Layers/DACH/BaseApp/Foundation/Company/CompanyInitialize.Codeunit.al b/src/Layers/DACH/BaseApp/Foundation/Company/CompanyInitialize.Codeunit.al index 3c2518958da..44f208d93ba 100644 --- a/src/Layers/DACH/BaseApp/Foundation/Company/CompanyInitialize.Codeunit.al +++ b/src/Layers/DACH/BaseApp/Foundation/Company/CompanyInitialize.Codeunit.al @@ -757,7 +757,11 @@ codeunit 2 "Company-Initialize" var AssistedCompanySetupStatus: Record "Assisted Company Setup Status"; ApplicationAreaSetup: Record "Application Area Setup"; +#if not CLEAN29 +#pragma warning disable AL0432, AS0105 CustomReportLayout: Record "Custom Report Layout"; +#pragma warning restore AL0432, AS0105 +#endif ReportLayoutSelection: Record "Report Layout Selection"; ExperienceTierSetup: Record "Experience Tier Setup"; begin @@ -768,8 +772,10 @@ codeunit 2 "Company-Initialize" AssistedCompanySetupStatus.DeleteAll(); ApplicationAreaSetup.SetRange("Company Name", Rec.Name); ApplicationAreaSetup.DeleteAll(); +#if not CLEAN29 CustomReportLayout.SetRange("Company Name", Rec.Name); CustomReportLayout.DeleteAll(); +#endif ReportLayoutSelection.SetRange("Company Name", Rec.Name); ReportLayoutSelection.DeleteAll(); diff --git a/src/Layers/ES/BaseApp/Foundation/Company/CompanyInitialize.Codeunit.al b/src/Layers/ES/BaseApp/Foundation/Company/CompanyInitialize.Codeunit.al index 303c7b1681c..9e9b050834c 100644 --- a/src/Layers/ES/BaseApp/Foundation/Company/CompanyInitialize.Codeunit.al +++ b/src/Layers/ES/BaseApp/Foundation/Company/CompanyInitialize.Codeunit.al @@ -801,7 +801,11 @@ codeunit 2 "Company-Initialize" var AssistedCompanySetupStatus: Record "Assisted Company Setup Status"; ApplicationAreaSetup: Record "Application Area Setup"; +#if not CLEAN29 +#pragma warning disable AL0432, AS0105 CustomReportLayout: Record "Custom Report Layout"; +#pragma warning restore AL0432, AS0105 +#endif ReportLayoutSelection: Record "Report Layout Selection"; ExperienceTierSetup: Record "Experience Tier Setup"; begin @@ -812,8 +816,10 @@ codeunit 2 "Company-Initialize" AssistedCompanySetupStatus.DeleteAll(); ApplicationAreaSetup.SetRange("Company Name", Rec.Name); ApplicationAreaSetup.DeleteAll(); +#if not CLEAN29 CustomReportLayout.SetRange("Company Name", Rec.Name); CustomReportLayout.DeleteAll(); +#endif ReportLayoutSelection.SetRange("Company Name", Rec.Name); ReportLayoutSelection.DeleteAll(); diff --git a/src/Layers/ES/BaseApp/Purchases/Setup/ReportSelectionPurchase.Page.al b/src/Layers/ES/BaseApp/Purchases/Setup/ReportSelectionPurchase.Page.al index 6b708c75bad..a955b7d8287 100644 --- a/src/Layers/ES/BaseApp/Purchases/Setup/ReportSelectionPurchase.Page.al +++ b/src/Layers/ES/BaseApp/Purchases/Setup/ReportSelectionPurchase.Page.al @@ -7,6 +7,7 @@ namespace Microsoft.Purchases.Setup; using Microsoft.Foundation.Reporting; using System.Reflection; +#pragma warning disable AS0032 page 347 "Report Selection - Purchase" { AboutTitle = 'About report selection for purchases'; @@ -117,6 +118,8 @@ page 347 "Report Selection - Purchase" ToolTip = 'Specifies the ID of the custom email body layout that is used.'; Visible = false; } +#if not CLEAN29 +#pragma warning disable AL0432 field("Email Body Layout Description"; Rec."Email Body Layout Description") { ApplicationArea = Basic, Suite; @@ -128,13 +131,13 @@ page 347 "Report Selection - Purchase" var CustomReportLayout: Record "Custom Report Layout"; begin -#pragma warning disable AL0432 if CustomReportLayout.LookupLayoutOK(Rec."Report ID") then -#pragma warning restore AL0432 Rec.Validate("Email Body Layout Code", CustomReportLayout.Code); end; #endif } +#pragma warning restore AL0432 +#endif } } area(factboxes) @@ -277,4 +280,5 @@ page 347 "Report Selection - Purchase" begin end; } +#pragma warning restore AS0032 diff --git a/src/Layers/ES/Tests/Misc/ReportSelectionsTests.Codeunit.al b/src/Layers/ES/Tests/Misc/ReportSelectionsTests.Codeunit.al index 43c351e5493..4bc0858c19d 100644 --- a/src/Layers/ES/Tests/Misc/ReportSelectionsTests.Codeunit.al +++ b/src/Layers/ES/Tests/Misc/ReportSelectionsTests.Codeunit.al @@ -28,22 +28,31 @@ codeunit 134421 "Report Selections Tests" FromEmailBodyTemplateTxt: Text; Initialized: Boolean; TemplateIdentificationTxt: Label 'a'; +#if not CLEAN29 CustomerEmailTxt: Label 'Customer@contoso.com'; CustomLayoutEmailTxt: Label 'CustomLayout@contoso.com'; +#endif WrongEmailAddressErr: Label 'Email Address is wrong on Send Email Dialog'; +#if not CLEAN29 DocumentNoTok: Label 'DocumentNo'; +#endif ReportIDMustHaveValueErr: Label 'Report ID must have a value'; +#if not CLEAN29 EmailAddressErr: Label 'Destination email address does not match expected address.'; +#endif StatementTitlePdfTxt: Label 'Statement'; ReportTitleTemplatePdfTxt: Label '%1 for %2 as of %3.pdf'; #if not CLEAN28 LayoutCodeShouldNotChangedErr: Label 'Layout code should not change.'; #endif SendToEmailTxt: Label 'test@test.com'; +#if not CLEAN29 MSXLbl: Label 'MS-X%1', Comment = '%1 = Random Value'; DocxLbl: Label 'docx'; MustSelectAndEmailBodyOrAttahmentErr: Label 'You must select an email body or attachment in report selection for %1.', Comment = '%1 = Usage, for example Sales Invoice'; +#endif +#if not CLEAN29 [Test] [HandlerFunctions('StandardSalesInvoiceRequestPageHandler')] [Scope('OnPrem')] @@ -92,6 +101,7 @@ codeunit 134421 "Report Selections Tests" // Verify VerifySendEmailPage(FromEmailBodyTemplateTxt, TemplateIdentificationTxt, PostedSalesInvoice."No.".Value); end; +#endif [Test] [HandlerFunctions('SelectSendingOptionHandler,EmailEditorHandler,CloseEmailEditorHandler')] @@ -118,6 +128,7 @@ codeunit 134421 "Report Selections Tests" VerifySendEmailPage(FromEmailBodyTemplateTxt, TemplateIdentificationTxt, PurchaseOrder."No.".Value); end; +#if not CLEAN29 [Test] [Scope('OnPrem')] procedure TesteEmailNoBodyNoAttachmentRaisesError() @@ -136,6 +147,7 @@ codeunit 134421 "Report Selections Tests" // Verify Assert.ExpectedError('email body or attachment'); end; +#endif [Test] [HandlerFunctions('SelectSendingOptionHandler')] @@ -157,6 +169,7 @@ codeunit 134421 "Report Selections Tests" Assert.ExpectedError('email body or attachment'); end; +#if not CLEAN29 [Test] [HandlerFunctions('EmailEditorHandlerCustomMessage,CloseEmailEditorHandler')] [Scope('OnPrem')] @@ -359,8 +372,10 @@ codeunit 134421 "Report Selections Tests" // Verify is within handler end; +#endif #if not CLEAN27 +#if not CLEAN29 [Test] [Scope('OnPrem')] procedure TestHTMLEmailBodyLoad() @@ -482,7 +497,9 @@ codeunit 134421 "Report Selections Tests" StrSubstNo('Destination email address does not match expected address %1', CustomLayoutEmailTxt)); end; #endif +#endif +#if not CLEAN29 [Test] [Scope('OnPrem')] procedure TestHTMLEmailBodyLoadFromBlob() @@ -622,6 +639,7 @@ codeunit 134421 "Report Selections Tests" LibraryVariableStorage.AssertEmpty(); end; +#endif [Test] [HandlerFunctions('SelectSendingOptionHandlerPrint,PurchaseOrderRequestPageHandler')] @@ -663,6 +681,7 @@ codeunit 134421 "Report Selections Tests" Assert.RecordCount(PurchaseHeaderArchive, 2); end; +#if not CLEAN29 [Test] [HandlerFunctions('StandardSalesInvoiceRequestPageHandler')] [Scope('OnPrem')] @@ -687,6 +706,7 @@ codeunit 134421 "Report Selections Tests" LibraryVariableStorage.AssertEmpty(); end; +#endif [Test] [HandlerFunctions('EmailEditorHandler,CloseEmailEditorHandler')] @@ -969,6 +989,7 @@ codeunit 134421 "Report Selections Tests" LibraryVariableStorage.AssertEmpty(); end; +#if not CLEAN29 [Test] [HandlerFunctions('StatementOKRequestPageHandler,DownloadAttachmentNoConfirmHandler')] [Scope('OnPrem')] @@ -1021,6 +1042,7 @@ codeunit 134421 "Report Selections Tests" FindInteractionLogEntriesByCustomerNo(InteractionLogEntry, CustomerNo, InteractionLogEntry."Document Type"::"Sales Stmnt."); Assert.RecordCount(InteractionLogEntry, 1); end; +#endif [Test] @@ -1372,6 +1394,7 @@ codeunit 134421 "Report Selections Tests" Assert.IsTrue(StrPos(CustomerReportSelections.SendToEmail.Value, 'testcase@testcase.com') <> 0, 'Wrong email after contact update.'); end; +#if not CLEAN29 [Test] [Scope('OnPrem')] procedure PostedSalesInvoiceEmailHasMorePriorityThanCustomerEmail() @@ -1407,6 +1430,7 @@ codeunit 134421 "Report Selections Tests" // [THEN] The "a@a.com; b@b.com; c@c.com" address is used as target email address. Assert.AreEqual(SalesHeader."Sell-to E-Mail", EmailAddress, EmailAddressErr); end; +#endif [Test] [Scope('OnPrem')] @@ -1572,6 +1596,7 @@ codeunit 134421 "Report Selections Tests" LibraryTempNVBufferHandler.AssertQueueEmpty(); end; +#if not CLEAN29 [Test] [HandlerFunctions('TestAddressEmailEditorHandler,CloseEmailEditorHandler')] [Scope('OnPrem')] @@ -1620,6 +1645,7 @@ codeunit 134421 "Report Selections Tests" LibraryVariableStorage.AssertEmpty(); end; +#endif [Test] [Scope('OnPrem')] @@ -2087,6 +2113,7 @@ codeunit 134421 "Report Selections Tests" // No assertion needed - if we reach this point, the fix is working end; +#if not CLEAN29 [Test] [HandlerFunctions('SelectSendingOptionHandler,EmailEditorHandler,CloseEmailEditorHandler')] procedure TestSendPostedSalesShipmentToEMailAndPDF() @@ -2661,6 +2688,7 @@ codeunit 134421 "Report Selections Tests" // [THEN] Verify message type with Email Handler. end; +#endif local procedure Initialize() var @@ -2865,6 +2893,7 @@ codeunit 134421 "Report Selections Tests" SalesInvoiceHeader.Get(LibrarySales.PostSalesDocument(SalesHeader, true, true)); end; +#if not CLEAN29 local procedure OpenNewPostedSalesInvoice(var PostedSalesInvoice: TestPage "Posted Sales Invoice") var SalesInvoiceHeader: Record "Sales Invoice Header"; @@ -2873,6 +2902,7 @@ codeunit 134421 "Report Selections Tests" PostedSalesInvoice.OpenEdit(); PostedSalesInvoice.GotoRecord(SalesInvoiceHeader); end; +#endif [Scope('OnPrem')] procedure OpenNewPurchaseOrder(var PurchaseOrderPage: TestPage "Purchase Order") @@ -2884,6 +2914,7 @@ codeunit 134421 "Report Selections Tests" PurchaseOrderPage.GotoRecord(PurchaseHeader); end; +#if not CLEAN29 local procedure SetupReportSelections(UseForEmailAttachment: Boolean; UseForEmailBody: Boolean) var OldReportSelections: Record "Report Selections"; @@ -2899,19 +2930,18 @@ codeunit 134421 "Report Selections Tests" OldReportSelections.Usage::"S.Invoice", CustomReportLayout."Report ID", UseForEmailAttachment, UseForEmailBody, CustomReportLayout.Code); end; +#endif local procedure SetupReportSelectionsVendor(UseForEmailAttachment: Boolean; UseForEmailBody: Boolean) var OldReportSelections: Record "Report Selections"; - DummyCustomReportLayout: Record "Custom Report Layout"; begin OldReportSelections.Reset(); OldReportSelections.SetRange(Usage, OldReportSelections.Usage::"P.Order"); OldReportSelections.FindFirst(); UpdateReportSelections( - OldReportSelections.Usage::"P.Order", GetReportIDForPurchaseOrder(), UseForEmailAttachment, UseForEmailBody, - DummyCustomReportLayout.Code); + OldReportSelections.Usage::"P.Order", GetReportIDForPurchaseOrder(), UseForEmailAttachment, UseForEmailBody, ''); end; local procedure SetupInvoiceReportLayoutSelection() @@ -2973,6 +3003,7 @@ codeunit 134421 "Report Selections Tests" ReportSelections.Modify(true); end; +#if not CLEAN29 local procedure UpdateCustomReportSelections(NewCustNo: Code[20]; UseForEmailAttachment: Boolean; UseForEmailBody: Boolean; SendToAddress: Text[200]) var CustomReportSelection: Record "Custom Report Selection"; @@ -2991,16 +3022,19 @@ codeunit 134421 "Report Selections Tests" CustomReportSelection.Modify(true); end; +#endif local procedure GenerateGUIDWithSpecialSymbol(): Code[20] begin exit(LibraryUtility.GenerateGUID() + '&'); end; +#if not CLEAN29 local procedure GetStandardSalesInvoiceReportID(): Integer begin exit(REPORT::"Standard Sales - Invoice"); end; +#endif local procedure GetReportIDForPurchaseOrder(): Integer begin @@ -3017,6 +3051,7 @@ codeunit 134421 "Report Selections Tests" exit(REPORT::Statement); end; +#if not CLEAN29 local procedure GetCustomBodyLayout(var CustomReportLayout: Record "Custom Report Layout") var ReportLayoutList: Record "Report Layout List"; @@ -3048,6 +3083,7 @@ codeunit 134421 "Report Selections Tests" CustomReportLayout.Insert(); end; end; +#endif #if not CLEAN27 local procedure GetEmailItem(var EmailItem: Record "Email Item"; MessageType: Integer; BodyFilePath: Text[250]; Plaintext: Boolean) @@ -3058,12 +3094,15 @@ codeunit 134421 "Report Selections Tests" end; #endif +#if not CLEAN29 local procedure GetEmailItem(var EmailItem: Record "Email Item"; MessageType: Option "Custom Message","From Email Body Template"; var EmailBody: Codeunit "Temp Blob") begin EmailItem.Validate("Message Type", MessageType); EmailItem.SetBody(EmailBody); end; +#endif +#if not CLEAN29 local procedure SetUpCustomEmail(var SalesInvoiceHeader: Record "Sales Invoice Header"; EmailAddress: Text[80]; UseCustomForEmailBody: Boolean) var Customer: Record Customer; @@ -3076,6 +3115,7 @@ codeunit 134421 "Report Selections Tests" UpdateCustomReportSelections(SalesInvoiceHeader."Bill-to Customer No.", true, UseCustomForEmailBody, EmailAddress); end; +#endif local procedure GenerateRandomPackageTrackingNo(): Text[50] var @@ -3245,6 +3285,7 @@ codeunit 134421 "Report Selections Tests" CustomReportSelection.GetSendToEmailFromContacts(Contact); end; +#if not CLEAN29 local procedure UpdateContactEmail(var Contact: Record Contact; Email: Text[45]) begin Contact.Validate("E-Mail", Email); @@ -3260,6 +3301,7 @@ codeunit 134421 "Report Selections Tests" Customer.Validate("Primary Contact No.", Contact."No."); Customer.Modify(); end; +#endif #if not CLEAN28 local procedure StandardSalesInvoiceReportID(): Integer @@ -3268,6 +3310,7 @@ codeunit 134421 "Report Selections Tests" end; #endif +#if not CLEAN29 local procedure SetupSalesShipmentReportSelections(UseForEmailAttachment: Boolean; UseForEmailBody: Boolean) var OldReportSelections: Record "Report Selections"; @@ -3338,7 +3381,9 @@ codeunit 134421 "Report Selections Tests" CustomReportSelection.Modify(true); end; +#endif +#if not CLEAN29 local procedure GetStandardSalesShipmentReportID(): Integer begin exit(Report::"Standard Sales - Shipment"); @@ -3360,7 +3405,9 @@ codeunit 134421 "Report Selections Tests" LibrarySales.PostSalesDocument(SalesHeader, true, false); SalesPost.GetPostedDocumentRecord(SalesHeader, PostedDocumentVariant); end; +#endif +#if not CLEAN29 local procedure SetupSalesReturnReceiptReportSelections(UseForEmailAttachment: Boolean; UseForEmailBody: Boolean) var OldReportSelections: Record "Report Selections"; @@ -3431,7 +3478,9 @@ codeunit 134421 "Report Selections Tests" CustomReportSelection.Modify(true); end; +#endif +#if not CLEAN29 local procedure GetStandardSalesReturnReceiptReportID(): Integer begin exit(Report::"Standard Sales - Return Rcpt."); @@ -3453,12 +3502,15 @@ codeunit 134421 "Report Selections Tests" LibrarySales.PostSalesDocument(SalesHeader, true, false); SalesPost.GetPostedDocumentRecord(SalesHeader, PostedDocumentVariant); end; +#endif +#if not CLEAN29 local procedure UpdateYourReferenceSalesHeader(var SalesHeader: Record "Sales Header"; YourReference: Text[35]) begin SalesHeader."Your Reference" := YourReference; SalesHeader.Modify(); end; +#endif [RequestPageHandler] [Scope('OnPrem')] @@ -3637,6 +3689,7 @@ codeunit 134421 "Report Selections Tests" VendorReportSelections.CopyFromReportSelectionsAction.Invoke(); end; +#if not CLEAN29 [ModalPageHandler] procedure VendorReportSelectionsHandler(var VendorReportSelections: TestPage "Vendor Report Selections") begin @@ -3644,6 +3697,7 @@ codeunit 134421 "Report Selections Tests" VendorReportSelections."Custom Report Description".Drilldown(); VendorReportSelections."Custom Report Description".AssertEquals(LibraryVariableStorage.DequeueText()); end; +#endif [ModalPageHandler] procedure ProFormInvoiceCustomerReportSelectionsHandler(var CustomerReportSelections: TestPage "Customer Report Selections") diff --git a/src/Layers/ES/Tests/Report/TestCustomReports.Codeunit.al b/src/Layers/ES/Tests/Report/TestCustomReports.Codeunit.al index 86aa9786692..75dbf758c66 100644 --- a/src/Layers/ES/Tests/Report/TestCustomReports.Codeunit.al +++ b/src/Layers/ES/Tests/Report/TestCustomReports.Codeunit.al @@ -13,7 +13,9 @@ codeunit 134761 "Test Custom Reports" CustomerFullMod: Record Customer; CustomerPartialMod: Record Customer; CustomerNoMod: Record Customer; +#if not CLEAN29 CustomReportLayout: Record "Custom Report Layout"; +#endif QuoteSalesHeaderFullMod: Record "Sales Header"; OrderSalesHeaderFullMod: Record "Sales Header"; InvoiceSalesHeaderFullMod: Record "Sales Header"; @@ -37,7 +39,9 @@ codeunit 134761 "Test Custom Reports" Assert: Codeunit Assert; LibrarySales: Codeunit "Library - Sales"; LibraryInventory: Codeunit "Library - Inventory"; +#if not CLEAN29 LibraryPurchase: Codeunit "Library - Purchase"; +#endif LibraryVariableStorage: Codeunit "Library - Variable Storage"; LibraryTestInitialize: Codeunit "Library - Test Initialize"; LibraryUtility: Codeunit "Library - Utility"; @@ -51,9 +55,11 @@ codeunit 134761 "Test Custom Reports" IsInitialized: Boolean; ExpectedFilesErr: Label 'Expected files as report output in temporary directory. None found.', Comment = '%1, filename.'; TempFolderIndex: Integer; +#if not CLEAN29 StandardStatementModTxt: Label 'Standard Statement Mod'; StatementModTxt: Label 'Statement Mod'; StandardStatementFullModTxt: Label 'Standard Statement Full Mod'; +#endif InvoiceDiscountTxt: Label 'Invoice Discount'; SubtotalTxt: Label 'Subtotal'; DescriptionReportTotalsLineTxt: Label 'Description_ReportTotalsLine'; @@ -69,10 +75,15 @@ codeunit 134761 "Test Custom Reports" begin LibrarySales.CreateCustomer(CustomerFullMod); +#if not CLEAN29 CreateCustomReportLayout(REPORT::"Standard Sales - Quote", CustomReportLayout.Type::Word, 'Quote Customer Full Mod'); AssignCustomLayoutToCustomer( DATABASE::Customer, CustomerFullMod."No.", CustomReportSelection.Usage::"S.Quote", REPORT::"Standard Sales - Quote", CustomReportLayout.Code); +#else + AssignCustomLayoutToCustomer( + DATABASE::Customer, CustomerFullMod."No.", CustomReportSelection.Usage::"S.Quote", REPORT::"Standard Sales - Quote", ''); +#endif CustomReportSelection.SetRange("Source Type", DATABASE::Customer); CustomReportSelection.SetRange("Source No.", CustomerFullMod."No."); @@ -87,7 +98,9 @@ codeunit 134761 "Test Custom Reports" Assert.IsFalse(CustomReportSelection.FindFirst(), 'Customer.OnDelete failed to remove CustomReportSelection'); Clear(CustomReportSelection); +#if not CLEAN29 CustomReportLayout.DeleteAll(); +#endif end; [Test] @@ -806,6 +819,7 @@ codeunit 134761 "Test Custom Reports" Assert.ExpectedError(ReportIDMustHaveValueErr); end; +#if not CLEAN29 [Test] [Scope('OnPrem')] procedure UT_CleanEmailBodyLayoutCode_OnReportIdValidate() @@ -840,6 +854,7 @@ codeunit 134761 "Test Custom Reports" CustomReportSelection.TestField("Custom Report Layout Code", ''); CustomReportSelection.TestField("Use for Email Body", true); end; +#endif [Test] [Scope('OnPrem')] @@ -1121,6 +1136,7 @@ codeunit 134761 "Test Custom Reports" Assert.IsTrue(PurchCrMemoLine.HasTypeToFillMandatoryFields(), ''); end; +#if not CLEAN29 [Test] [HandlerFunctions('StandardStatementDefaultLayoutHandler,StatementCancelHandler')] [Scope('OnPrem')] @@ -1231,6 +1247,7 @@ codeunit 134761 "Test Custom Reports" // Tear down InitReportSelections(); end; +#endif [Test] [Scope('OnPrem')] @@ -1390,7 +1407,9 @@ codeunit 134761 "Test Custom Reports" // Clean out existing data and set up new ReportLayoutSelection.DeleteAll(); CustomReportSelection.DeleteAll(); +#if not CLEAN29 CustomReportLayout.DeleteAll(); +#endif InitReportSelections(); @@ -1398,49 +1417,85 @@ codeunit 134761 "Test Custom Reports" LibrarySales.CreateCustomer(CustomerPartialMod); LibrarySales.CreateCustomer(CustomerNoMod); Clear(CustomReportSelection); +#if not CLEAN29 CreateCustomReportLayout(REPORT::"Standard Sales - Quote", CustomReportLayout.Type::Word, 'Quote Customer Full Mod'); AssignCustomLayoutToCustomer( DATABASE::Customer, CustomerFullMod."No.", CustomReportSelection.Usage::"S.Quote", REPORT::"Standard Sales - Quote", CustomReportLayout.Code); +#else + AssignCustomLayoutToCustomer( + DATABASE::Customer, CustomerFullMod."No.", CustomReportSelection.Usage::"S.Quote", REPORT::"Standard Sales - Quote", ''); +#endif Clear(CustomReportSelection); +#if not CLEAN29 CreateCustomReportLayout(REPORT::"Standard Sales - Order Conf.", CustomReportLayout.Type::Word, 'Order Customer Full Mod'); AssignCustomLayoutToCustomer( DATABASE::Customer, CustomerFullMod."No.", CustomReportSelection.Usage::"S.Order", REPORT::"Standard Sales - Order Conf.", CustomReportLayout.Code); +#else + AssignCustomLayoutToCustomer( + DATABASE::Customer, CustomerFullMod."No.", CustomReportSelection.Usage::"S.Order", REPORT::"Standard Sales - Order Conf.", ''); +#endif Clear(CustomReportSelection); +#if not CLEAN29 CreateCustomReportLayout(REPORT::"Standard Sales - Invoice", CustomReportLayout.Type::Word, 'Invoice Customer Full Mod'); AssignCustomLayoutToCustomer( DATABASE::Customer, CustomerFullMod."No.", CustomReportSelection.Usage::"S.Invoice", REPORT::"Standard Sales - Invoice", CustomReportLayout.Code); +#else + AssignCustomLayoutToCustomer( + DATABASE::Customer, CustomerFullMod."No.", CustomReportSelection.Usage::"S.Invoice", REPORT::"Standard Sales - Invoice", ''); +#endif Clear(CustomReportSelection); +#if not CLEAN29 CreateCustomReportLayout(REPORT::"Standard Sales - Credit Memo", CustomReportLayout.Type::Word, 'Credit Memo Customer Full Mod'); AssignCustomLayoutToCustomer( DATABASE::Customer, CustomerFullMod."No.", CustomReportSelection.Usage::"S.Cr.Memo", REPORT::"Standard Sales - Credit Memo", CustomReportLayout.Code); +#else + AssignCustomLayoutToCustomer( + DATABASE::Customer, CustomerFullMod."No.", CustomReportSelection.Usage::"S.Cr.Memo", + REPORT::"Standard Sales - Credit Memo", ''); +#endif Clear(CustomReportSelection); +#if not CLEAN29 CreateCustomReportLayout(REPORT::"Standard Statement", CustomReportLayout.Type::Word, StandardStatementFullModTxt); AssignCustomLayoutToCustomer( DATABASE::Customer, CustomerFullMod."No.", CustomReportSelection.Usage::"C.Statement", REPORT::"Standard Statement", CustomReportLayout.Code); +#else + AssignCustomLayoutToCustomer( + DATABASE::Customer, CustomerFullMod."No.", CustomReportSelection.Usage::"C.Statement", REPORT::"Standard Statement", ''); +#endif CustomReportSelection."Send To Email" := 'test@contoso.com'; CustomReportSelection.Modify(); Clear(CustomReportSelection); +#if not CLEAN29 CreateCustomReportLayout(REPORT::Statement, CustomReportLayout.Type::RDLC, StatementModTxt); AssignCustomLayoutToCustomer( DATABASE::Customer, CustomerFullMod."No.", CustomReportSelection.Usage::"C.Statement", REPORT::Statement, CustomReportLayout.Code); +#else + AssignCustomLayoutToCustomer( + DATABASE::Customer, CustomerFullMod."No.", CustomReportSelection.Usage::"C.Statement", REPORT::Statement, ''); +#endif Clear(CustomReportSelection); +#if not CLEAN29 CreateCustomReportLayout(REPORT::"Standard Statement", CustomReportLayout.Type::Word, StandardStatementModTxt); AssignCustomLayoutToCustomer( DATABASE::Customer, CustomerFullMod."No.", CustomReportSelection.Usage::"C.Statement", REPORT::"Standard Statement", CustomReportLayout.Code); +#else + AssignCustomLayoutToCustomer( + DATABASE::Customer, CustomerFullMod."No.", CustomReportSelection.Usage::"C.Statement", REPORT::"Standard Statement", ''); +#endif CreateSalesRecord(QuoteSalesHeaderFullMod, QuoteSalesHeaderFullMod."Document Type"::Quote, CustomerFullMod); CreateSalesRecord(OrderSalesHeaderFullMod, QuoteSalesHeaderFullMod."Document Type"::Order, CustomerFullMod); @@ -1527,6 +1582,7 @@ codeunit 134761 "Test Custom Reports" CustomerReportSelections.Usage2.SetValue(Usage); end; +#if not CLEAN29 local procedure CreateCustomReportLayout(ReportID: Integer; LayoutType: Enum "Custom Report Layout Type"; Description: Text[80]) begin CustomReportLayout.Init(); @@ -1536,6 +1592,7 @@ codeunit 134761 "Test Custom Reports" CustomReportLayout.Description := Description; CustomReportLayout.Modify(); end; +#endif local procedure CreateSalesRecord(var SalesHeader: Record "Sales Header"; DocType: Enum "Sales Document Type"; Customer: Record Customer) var @@ -2173,6 +2230,7 @@ codeunit 134761 "Test Custom Reports" RequestPage.OK().Invoke(); end; +#if not CLEAN29 [RequestPageHandler] [Scope('OnPrem')] procedure StatementCancelHandler(var RequestPage: TestRequestPage Statement) @@ -2198,6 +2256,7 @@ codeunit 134761 "Test Custom Reports" begin PurchaseInvoice.Cancel().Invoke(); end; +#endif [ReportHandler] [Scope('OnPrem')] @@ -2241,11 +2300,14 @@ codeunit 134761 "Test Custom Reports" AddNewCustomerReportSelection(CustomerReportSelections, Usage::"Credit Memo", REPORT::"G/L Register"); end; +#if not CLEAN29 [ModalPageHandler] [Scope('OnPrem')] procedure CustomerReportSelectionHandler(var CustomerReportSelections: TestPage "Customer Report Selections") var +#pragma warning disable AL0432 ExpectedCustomReportLayout: Record "Custom Report Layout"; +#pragma warning restore AL0432 begin ExpectedCustomReportLayout.Get(LibraryVariableStorage.DequeueText()); @@ -2268,6 +2330,7 @@ codeunit 134761 "Test Custom Reports" ExpectedCustomReportLayout.Code, CustomReportSelection."Custom Report Layout Code", 'Incorrect Value in Customer Report Selections'); end; +#endif [RequestPageHandler] [Scope('OnPrem')] diff --git a/src/Layers/ES/Tests/SCM-Service/ServiceOrders.Codeunit.al b/src/Layers/ES/Tests/SCM-Service/ServiceOrders.Codeunit.al index 1e025586d8a..fa1edfdf767 100644 --- a/src/Layers/ES/Tests/SCM-Service/ServiceOrders.Codeunit.al +++ b/src/Layers/ES/Tests/SCM-Service/ServiceOrders.Codeunit.al @@ -17,7 +17,9 @@ using Microsoft.Finance.VAT.Setup; using Microsoft.Foundation.Address; using Microsoft.Foundation.ExtendedText; using Microsoft.Foundation.NoSeries; +#if not CLEAN29 using Microsoft.Foundation.Reporting; +#endif using Microsoft.Foundation.Shipping; using Microsoft.Foundation.UOM; using Microsoft.Inventory.Item; @@ -55,6 +57,7 @@ using System.IO; using System.Security.User; using System.TestLibraries.Utilities; +#pragma warning disable AL0432, AS0105 codeunit 136101 "Service Orders" { EventSubscriberInstance = Manual; @@ -5767,6 +5770,7 @@ codeunit 136101 "Service Orders" Assert.AreEqual(Customer[2]."Country/Region Code", ServiceHeader."VAT Country/Region Code", VATCountryRegionLbl); end; +#if not CLEAN29 [Test] [HandlerFunctions('ServiceOrderReportRequestPageHandler')] procedure PrintServiceOrderWithWorkDescription() @@ -5799,6 +5803,7 @@ codeunit 136101 "Service Orders" // [THEN] Verify no transaction error should occur. end; +#endif [Test] [Scope('OnPrem')] @@ -8172,6 +8177,7 @@ codeunit 136101 "Service Orders" exit(ServiceInvoiceHeader."No."); end; +#if not CLEAN29 local procedure CreateCustomReportSelectionForCustomer(CustomerNo: Code[20]; ReportSelectionUsage: Enum "Report Selection Usage"; ReportID: Integer) var CustomReportSelection: Record "Custom Report Selection"; @@ -8188,6 +8194,7 @@ codeunit 136101 "Service Orders" "Email Body Layout Code", CustomReportLayout.InitBuiltInLayout(CustomReportSelection."Report ID", CustomReportLayout.Type::Word.AsInteger())); CustomReportSelection.Insert(true); end; +#endif local procedure CreateShipmentMethod(var ShipmentMethod: Record "Shipment Method") begin @@ -8536,3 +8543,4 @@ codeunit 136101 "Service Orders" ServiceOrder.Cancel().Invoke(); end; } +#pragma warning restore AL0432, AS0105 diff --git a/src/Layers/FI/BaseApp/Foundation/Company/CompanyInitialize.Codeunit.al b/src/Layers/FI/BaseApp/Foundation/Company/CompanyInitialize.Codeunit.al index 6316c5c1c33..f95aff173c8 100644 --- a/src/Layers/FI/BaseApp/Foundation/Company/CompanyInitialize.Codeunit.al +++ b/src/Layers/FI/BaseApp/Foundation/Company/CompanyInitialize.Codeunit.al @@ -757,7 +757,11 @@ codeunit 2 "Company-Initialize" var AssistedCompanySetupStatus: Record "Assisted Company Setup Status"; ApplicationAreaSetup: Record "Application Area Setup"; +#if not CLEAN29 +#pragma warning disable AL0432, AS0105 CustomReportLayout: Record "Custom Report Layout"; +#pragma warning restore AL0432, AS0105 +#endif ReportLayoutSelection: Record "Report Layout Selection"; ExperienceTierSetup: Record "Experience Tier Setup"; begin @@ -768,8 +772,10 @@ codeunit 2 "Company-Initialize" AssistedCompanySetupStatus.DeleteAll(); ApplicationAreaSetup.SetRange("Company Name", Rec.Name); ApplicationAreaSetup.DeleteAll(); +#if not CLEAN29 CustomReportLayout.SetRange("Company Name", Rec.Name); CustomReportLayout.DeleteAll(); +#endif ReportLayoutSelection.SetRange("Company Name", Rec.Name); ReportLayoutSelection.DeleteAll(); diff --git a/src/Layers/FI/Tests/Report/ReportLayoutTest.Codeunit.al b/src/Layers/FI/Tests/Report/ReportLayoutTest.Codeunit.al index c8d6c7d2077..caa1f3a8e36 100644 --- a/src/Layers/FI/Tests/Report/ReportLayoutTest.Codeunit.al +++ b/src/Layers/FI/Tests/Report/ReportLayoutTest.Codeunit.al @@ -22,11 +22,15 @@ codeunit 134600 "Report Layout Test" LibraryUtility: Codeunit "Library - Utility"; LibraryRandom: Codeunit "Library - Random"; LibrarySales: Codeunit "Library - Sales"; +#pragma warning disable AA0137 LibraryTablesUT: Codeunit "Library - Tables UT"; +#pragma warning restore AA0137 LibraryVariableStorage: Codeunit "Library - Variable Storage"; LibraryTestInitialize: Codeunit "Library - Test Initialize"; LibrarySetupStorage: Codeunit "Library - Setup Storage"; +#if not CLEAN29 Usage: Option "Order Confirmation","Work Order","Pick Instruction"; +#endif IsInitialized: Boolean; local procedure Initialize() @@ -92,6 +96,7 @@ codeunit 134600 "Report Layout Test" asserterror ReportLayoutSelection.Validate(Type, ReportLayoutSelection.Type::"External Layout"); end; +#if not CLEAN29 [Test] [Scope('OnPrem')] procedure TestReportLayoutSelectionReportLayoutID() @@ -120,6 +125,7 @@ codeunit 134600 "Report Layout Test" // Verify Assert.IsTrue(ReportLayoutSelection.Type = ReportLayoutSelection.Type::"RDLC (built-in)", ''); end; +#endif [Test] [Scope('OnPrem')] @@ -133,6 +139,7 @@ codeunit 134600 "Report Layout Test" end; +#if not CLEAN29 [Test] [Scope('OnPrem')] procedure TestTableCustomReportLayoutTriggers() @@ -175,6 +182,7 @@ codeunit 134600 "Report Layout Test" CustomReportLayout.ClearLayout(); Assert.IsFalse(CustomReportLayout.ValidateLayout(false, false), ''); end; +#endif #if not CLEAN28 [Test] @@ -203,6 +211,7 @@ codeunit 134600 "Report Layout Test" end; #endif +#if not CLEAN29 [Test] [Scope('OnPrem')] procedure TestCopyRecord() @@ -283,6 +292,7 @@ codeunit 134600 "Report Layout Test" // Validate Assert.IsTrue(StrPos(GetLastErrorText, 'The RDLC layout does not comply with the current report design (for example') = 1, ''); end; +#endif [Test] [Scope('OnPrem')] @@ -555,6 +565,7 @@ codeunit 134600 "Report Layout Test" VerifyRun(REPORT::"Test Report - Processing Only"); end; +#if not CLEAN29 [Test] [HandlerFunctions('ScheduleAReportHandlerCancel')] [Scope('OnPrem')] @@ -648,6 +659,7 @@ codeunit 134600 "Report Layout Test" VerifySchedule(REPORT::"Test Report - Processing Only"); VerifyRun(REPORT::"Test Report - Processing Only"); end; +#endif [Test] [Scope('OnPrem')] @@ -667,6 +679,7 @@ codeunit 134600 "Report Layout Test" CompanyInformation.FieldCaption("Business Identity Code"), CompanyInformation.GetRegistrationNumberLbl(), WrongRegNoLblErr); end; +#if not CLEAN29 [Test] [HandlerFunctions('WorkOrder_RPH')] [Scope('OnPrem')] @@ -753,6 +766,7 @@ codeunit 134600 "Report Layout Test" // [THEN] REP 1305 "Order Confirmation" is shown // OrderConfirmation_RPH end; +#endif [Test] [HandlerFunctions('StandardSalesInvoiceRequestPageHandler')] @@ -795,21 +809,28 @@ codeunit 134600 "Report Layout Test" VerifyJobTaskNo(20000, SalesLine[2]."Job Task No."); end; +#if not CLEAN29 [Test] [Scope('OnPrem')] procedure TestLenghtOfDescriptionCustomReportLayout() var +#pragma warning disable AL0432 CustomReportLayout: Record "Custom Report Layout"; +#pragma warning restore AL0432 CustomReportSelection: Record "Custom Report Selection"; begin // [FEATURE] [UT] // [SCENARIO 252058] Length of "Custom Report Layout"."Description" shoud be equal to length of "Custom Report Selection"."Custom Report Description" +#pragma warning disable AL0432 LibraryTablesUT.CompareFieldTypeAndLength( CustomReportLayout, CustomReportLayout.FieldNo(Description), CustomReportSelection, CustomReportSelection.FieldNo("Custom Report Description")); +#pragma warning restore AL0432 end; +#endif +#if not CLEAN29 [Test] [HandlerFunctions('MessageHandler')] [Scope('OnPrem')] @@ -855,7 +876,9 @@ codeunit 134600 "Report Layout Test" // and getting Sales Header RecordId to be sure it point to correct record "SO" Assert.ExpectedMessage(Format(SalesHeader.RecordId()), LibraryVariableStorage.DequeueText()); // message from MessageHandler end; +#endif +#if not CLEAN29 local procedure InitCustomReportLayout(var CustomReportLayout: Record "Custom Report Layout"; LayoutType: Enum "Custom Report Layout Type"; WithCompanyName: Boolean) var LayoutCode: Code[20]; @@ -868,14 +891,17 @@ codeunit 134600 "Report Layout Test" CustomReportLayout.Modify(true); end; end; +#endif local procedure InitReportSelection(ReportID: Integer; Selection: Option "None","RDLC (Built-in)","Word (Built-in)","Custom RDLC","Custom Word","Excel Layout","External Layout") var ReportLayoutSelection: Record "Report Layout Selection"; TenantReportLayoutSelection: Record "Tenant Report Layout Selection"; ReportLayoutList: Record "Report Layout List"; +#if not CLEAN29 CustomReportLayout: Record "Custom Report Layout"; LayoutCode: Code[20]; +#endif begin if ReportLayoutSelection.Get(ReportID, CompanyName) then ReportLayoutSelection.Delete(); @@ -895,6 +921,7 @@ codeunit 134600 "Report Layout Test" ReportLayoutSelection.Type := ReportLayoutSelection.Type::"RDLC (built-in)"; Selection::"Word (Built-in)": ReportLayoutSelection.Type := ReportLayoutSelection.Type::"Word (built-in)"; +#if not CLEAN29 Selection::"Custom RDLC": begin ReportLayoutSelection.Type := ReportLayoutSelection.Type::"Custom Layout"; @@ -909,6 +936,7 @@ codeunit 134600 "Report Layout Test" CustomReportLayout.Get(LayoutCode); ReportLayoutSelection."Custom Report Layout Code" := CustomReportLayout.Code; end; +#endif Selection::"Excel Layout": begin SetupSelection(ReportLayoutList, TenantReportLayoutSelection, ReportLayoutList."Layout Format"::Excel); @@ -942,6 +970,7 @@ codeunit 134600 "Report Layout Test" TenantReportLayoutSelection.DeleteAll(true); end; +#if not CLEAN29 local procedure AddOrderConfirmationToCustomReportLayout(): Code[20] var CustomReportLayout: Record "Custom Report Layout"; @@ -960,7 +989,9 @@ codeunit 134600 "Report Layout Test" CustomerNo, CustomReportSelection.Usage::"S.Order", REPORT::"Standard Sales - Order Conf.", AddOrderConfirmationToCustomReportLayout()); end; +#endif +#if not CLEAN29 local procedure AddCustomerDocumentLayoutReport(CustomerNo: Code[20]; NewUsage: Enum "Report Selection Usage"; ReportID: Integer; CustomReportLayoutCode: Code[20]) var CustomReportSelection: Record "Custom Report Selection"; @@ -974,6 +1005,7 @@ codeunit 134600 "Report Layout Test" CustomReportSelection."Custom Report Layout Code" := CustomReportLayoutCode; CustomReportSelection.Insert(true); end; +#endif local procedure CreateSalesLineWithJobTaskNo(SalesHeader: Record "Sales Header"; var SalesLine: Record "Sales Line") var diff --git a/src/Layers/GB/BaseApp/Permissions/d365busfullaccess.permissionset.al b/src/Layers/GB/BaseApp/Permissions/d365busfullaccess.permissionset.al index cdc9452a2c5..a213c93c775 100644 --- a/src/Layers/GB/BaseApp/Permissions/d365busfullaccess.permissionset.al +++ b/src/Layers/GB/BaseApp/Permissions/d365busfullaccess.permissionset.al @@ -344,7 +344,11 @@ permissionset 959 "D365 BUS FULL ACCESS" tabledata "Current Salesperson" = RIMD, tabledata "Custom Address Format" = RIMD, tabledata "Custom Address Format Line" = RIMD, +#if not CLEAN29 +#pragma warning disable AL0432, AS0105 tabledata "Custom Report Layout" = RIMD, +#pragma warning restore AL0432, AS0105 +#endif tabledata "Custom Report Selection" = RIMD, tabledata "Customer Amount" = RIMD, tabledata "Customer Sales Buffer" = RIMD, diff --git a/src/Layers/IN/DemoTool/CreateRapidStartPackage.Codeunit.al b/src/Layers/IN/DemoTool/CreateRapidStartPackage.Codeunit.al index b6cf96a76b1..f90e1b81e23 100644 --- a/src/Layers/IN/DemoTool/CreateRapidStartPackage.Codeunit.al +++ b/src/Layers/IN/DemoTool/CreateRapidStartPackage.Codeunit.al @@ -263,7 +263,11 @@ codeunit 101995 "Create RapidStart Package" CreateTable(Database::"Word Template"); // Reporting +#if not CLEAN29 +#pragma warning disable AL0432, AS0105 CreateTable(DATABASE::"Custom Report Layout"); +#pragma warning restore AL0432, AS0105 +#endif CreateConfigPackageHelper.SetSkipTableTriggers(); // Office Add-Ins diff --git a/src/Layers/NA/BaseApp/Foundation/Company/CompanyInitialize.Codeunit.al b/src/Layers/NA/BaseApp/Foundation/Company/CompanyInitialize.Codeunit.al index 903c54c3a6f..99838d2d81a 100644 --- a/src/Layers/NA/BaseApp/Foundation/Company/CompanyInitialize.Codeunit.al +++ b/src/Layers/NA/BaseApp/Foundation/Company/CompanyInitialize.Codeunit.al @@ -759,7 +759,11 @@ codeunit 2 "Company-Initialize" var AssistedCompanySetupStatus: Record "Assisted Company Setup Status"; ApplicationAreaSetup: Record "Application Area Setup"; +#if not CLEAN29 +#pragma warning disable AL0432, AS0105 CustomReportLayout: Record "Custom Report Layout"; +#pragma warning restore AL0432, AS0105 +#endif ReportLayoutSelection: Record "Report Layout Selection"; ExperienceTierSetup: Record "Experience Tier Setup"; begin @@ -770,8 +774,10 @@ codeunit 2 "Company-Initialize" AssistedCompanySetupStatus.DeleteAll(); ApplicationAreaSetup.SetRange("Company Name", Rec.Name); ApplicationAreaSetup.DeleteAll(); +#if not CLEAN29 CustomReportLayout.SetRange("Company Name", Rec.Name); CustomReportLayout.DeleteAll(); +#endif ReportLayoutSelection.SetRange("Company Name", Rec.Name); ReportLayoutSelection.DeleteAll(); diff --git a/src/Layers/NA/Tests/Report/ReportLayoutTest.Codeunit.al b/src/Layers/NA/Tests/Report/ReportLayoutTest.Codeunit.al index 571b176f427..ca0e1614b18 100644 --- a/src/Layers/NA/Tests/Report/ReportLayoutTest.Codeunit.al +++ b/src/Layers/NA/Tests/Report/ReportLayoutTest.Codeunit.al @@ -22,12 +22,16 @@ codeunit 134600 "Report Layout Test" LibraryUtility: Codeunit "Library - Utility"; LibraryRandom: Codeunit "Library - Random"; LibrarySales: Codeunit "Library - Sales"; +#pragma warning disable AA0137 LibraryTablesUT: Codeunit "Library - Tables UT"; +#pragma warning restore AA0137 LibraryVariableStorage: Codeunit "Library - Variable Storage"; LibraryReportValidation: Codeunit "Library - Report Validation"; LibraryTestInitialize: Codeunit "Library - Test Initialize"; LibrarySetupStorage: Codeunit "Library - Setup Storage"; +#if not CLEAN29 Usage: Option "Order Confirmation","Work Order","Pick Instruction"; +#endif IsInitialized: Boolean; #if not CLEAN28 LayoutCodeShouldNotChangedErr: Label 'Layout code should not change.'; @@ -96,6 +100,7 @@ codeunit 134600 "Report Layout Test" asserterror ReportLayoutSelection.Validate(Type, ReportLayoutSelection.Type::"External Layout"); end; +#if not CLEAN29 [Test] [Scope('OnPrem')] procedure TestReportLayoutSelectionReportLayoutID() @@ -124,6 +129,7 @@ codeunit 134600 "Report Layout Test" // Verify Assert.IsTrue(ReportLayoutSelection.Type = ReportLayoutSelection.Type::"RDLC (built-in)", ''); end; +#endif [Test] [Scope('OnPrem')] @@ -137,6 +143,7 @@ codeunit 134600 "Report Layout Test" end; +#if not CLEAN29 [Test] [Scope('OnPrem')] procedure TestTableCustomReportLayoutTriggers() @@ -179,6 +186,7 @@ codeunit 134600 "Report Layout Test" CustomReportLayout.ClearLayout(); Assert.IsFalse(CustomReportLayout.ValidateLayout(false, false), ''); end; +#endif #if not CLEAN28 [Test] @@ -207,6 +215,7 @@ codeunit 134600 "Report Layout Test" end; #endif +#if not CLEAN29 [Test] [Scope('OnPrem')] procedure TestCopyRecord() @@ -287,6 +296,7 @@ codeunit 134600 "Report Layout Test" // Validate Assert.IsTrue(StrPos(GetLastErrorText, 'The RDLC layout does not comply with the current report design (for example') = 1, ''); end; +#endif [Test] [Scope('OnPrem')] @@ -559,6 +569,7 @@ codeunit 134600 "Report Layout Test" VerifyRun(REPORT::"Test Report - Processing Only"); end; +#if not CLEAN29 [Test] [HandlerFunctions('ScheduleAReportHandlerCancel')] [Scope('OnPrem')] @@ -652,6 +663,7 @@ codeunit 134600 "Report Layout Test" VerifySchedule(REPORT::"Test Report - Processing Only"); VerifyRun(REPORT::"Test Report - Processing Only"); end; +#endif [Test] [Scope('OnPrem')] @@ -671,6 +683,7 @@ codeunit 134600 "Report Layout Test" CompanyInformation.FieldCaption("Registration No."), CompanyInformation.GetRegistrationNumberLbl(), WrongRegNoLblErr); end; +#if not CLEAN29 [Test] [HandlerFunctions('WorkOrder_RPH')] [Scope('OnPrem')] @@ -757,6 +770,7 @@ codeunit 134600 "Report Layout Test" // [THEN] REP 1305 "Order Confirmation" is shown // OrderConfirmation_RPH end; +#endif [Test] [HandlerFunctions('StandardSalesInvoiceRequestPageHandler')] @@ -799,20 +813,26 @@ codeunit 134600 "Report Layout Test" VerifyJobTaskNo(20000, SalesLine[2]."Job Task No."); end; +#if not CLEAN29 [Test] [Scope('OnPrem')] procedure TestLenghtOfDescriptionCustomReportLayout() var +#pragma warning disable AL0432 CustomReportLayout: Record "Custom Report Layout"; +#pragma warning restore AL0432 CustomReportSelection: Record "Custom Report Selection"; begin // [FEATURE] [UT] // [SCENARIO 252058] Length of "Custom Report Layout"."Description" shoud be equal to length of "Custom Report Selection"."Custom Report Description" +#pragma warning disable AL0432 LibraryTablesUT.CompareFieldTypeAndLength( CustomReportLayout, CustomReportLayout.FieldNo(Description), CustomReportSelection, CustomReportSelection.FieldNo("Custom Report Description")); +#pragma warning restore AL0432 end; +#endif [Test] [HandlerFunctions('ReportHandlerReturnOrderConfirmation')] @@ -871,6 +891,7 @@ codeunit 134600 "Report Layout Test" LibraryReportDataset.AssertElementWithValueExists('Desc_SalesLineCaption', SalesLine.FieldCaption(Description)); end; +#if not CLEAN29 [Test] [HandlerFunctions('MessageHandler')] [Scope('OnPrem')] @@ -916,6 +937,7 @@ codeunit 134600 "Report Layout Test" // and getting Sales Header RecordId to be sure it point to correct record "SO" Assert.ExpectedMessage(Format(SalesHeader.RecordId()), LibraryVariableStorage.DequeueText()); // message from MessageHandler end; +#endif #if not CLEAN28 [Test] @@ -960,6 +982,7 @@ codeunit 134600 "Report Layout Test" end; #endif +#if not CLEAN29 local procedure InitCustomReportLayout(var CustomReportLayout: Record "Custom Report Layout"; LayoutType: Enum "Custom Report Layout Type"; WithCompanyName: Boolean) var LayoutCode: Code[20]; @@ -972,14 +995,17 @@ codeunit 134600 "Report Layout Test" CustomReportLayout.Modify(true); end; end; +#endif local procedure InitReportSelection(ReportID: Integer; Selection: Option "None","RDLC (Built-in)","Word (Built-in)","Custom RDLC","Custom Word","Excel Layout","External Layout") var ReportLayoutSelection: Record "Report Layout Selection"; TenantReportLayoutSelection: Record "Tenant Report Layout Selection"; ReportLayoutList: Record "Report Layout List"; +#if not CLEAN29 CustomReportLayout: Record "Custom Report Layout"; LayoutCode: Code[20]; +#endif begin if ReportLayoutSelection.Get(ReportID, CompanyName) then ReportLayoutSelection.Delete(); @@ -999,6 +1025,7 @@ codeunit 134600 "Report Layout Test" ReportLayoutSelection.Type := ReportLayoutSelection.Type::"RDLC (built-in)"; Selection::"Word (Built-in)": ReportLayoutSelection.Type := ReportLayoutSelection.Type::"Word (built-in)"; +#if not CLEAN29 Selection::"Custom RDLC": begin ReportLayoutSelection.Type := ReportLayoutSelection.Type::"Custom Layout"; @@ -1013,6 +1040,7 @@ codeunit 134600 "Report Layout Test" CustomReportLayout.Get(LayoutCode); ReportLayoutSelection."Custom Report Layout Code" := CustomReportLayout.Code; end; +#endif Selection::"Excel Layout": begin SetupSelection(ReportLayoutList, TenantReportLayoutSelection, ReportLayoutList."Layout Format"::Excel); @@ -1046,6 +1074,7 @@ codeunit 134600 "Report Layout Test" TenantReportLayoutSelection.DeleteAll(true); end; +#if not CLEAN29 local procedure AddOrderConfirmationToCustomReportLayout(): Code[20] var CustomReportLayout: Record "Custom Report Layout"; @@ -1064,7 +1093,9 @@ codeunit 134600 "Report Layout Test" CustomerNo, CustomReportSelection.Usage::"S.Order", REPORT::"Standard Sales - Order Conf.", AddOrderConfirmationToCustomReportLayout()); end; +#endif +#if not CLEAN29 local procedure AddCustomerDocumentLayoutReport(CustomerNo: Code[20]; NewUsage: Enum "Report Selection Usage"; ReportID: Integer; CustomReportLayoutCode: Code[20]) var CustomReportSelection: Record "Custom Report Selection"; @@ -1078,6 +1109,7 @@ codeunit 134600 "Report Layout Test" CustomReportSelection."Custom Report Layout Code" := CustomReportLayoutCode; CustomReportSelection.Insert(true); end; +#endif local procedure CreateSalesLineWithJobTaskNo(SalesHeader: Record "Sales Header"; var SalesLine: Record "Sales Line") var diff --git a/src/Layers/NA/Tests/Report/TestCustomReports.Codeunit.al b/src/Layers/NA/Tests/Report/TestCustomReports.Codeunit.al index 5349ee91368..eb7d855ab4b 100644 --- a/src/Layers/NA/Tests/Report/TestCustomReports.Codeunit.al +++ b/src/Layers/NA/Tests/Report/TestCustomReports.Codeunit.al @@ -13,7 +13,9 @@ codeunit 134761 "Test Custom Reports" CustomerFullMod: Record Customer; CustomerPartialMod: Record Customer; CustomerNoMod: Record Customer; +#if not CLEAN29 CustomReportLayout: Record "Custom Report Layout"; +#endif QuoteSalesHeaderFullMod: Record "Sales Header"; OrderSalesHeaderFullMod: Record "Sales Header"; InvoiceSalesHeaderFullMod: Record "Sales Header"; @@ -37,7 +39,9 @@ codeunit 134761 "Test Custom Reports" Assert: Codeunit Assert; LibrarySales: Codeunit "Library - Sales"; LibraryInventory: Codeunit "Library - Inventory"; +#if not CLEAN29 LibraryPurchase: Codeunit "Library - Purchase"; +#endif LibraryVariableStorage: Codeunit "Library - Variable Storage"; LibraryTestInitialize: Codeunit "Library - Test Initialize"; LibraryUtility: Codeunit "Library - Utility"; @@ -51,9 +55,11 @@ codeunit 134761 "Test Custom Reports" IsInitialized: Boolean; ExpectedFilesErr: Label 'Expected files as report output in temporary directory. None found.', Comment = '%1, filename.'; TempFolderIndex: Integer; +#if not CLEAN29 StandardStatementModTxt: Label 'Standard Statement Mod'; StatementModTxt: Label 'Statement Mod'; StandardStatementFullModTxt: Label 'Standard Statement Full Mod'; +#endif InvoiceDiscountTxt: Label 'Invoice Discount'; SubtotalTxt: Label 'Subtotal'; DescriptionReportTotalsLineTxt: Label 'Description_ReportTotalsLine'; @@ -69,10 +75,15 @@ codeunit 134761 "Test Custom Reports" begin LibrarySales.CreateCustomer(CustomerFullMod); +#if not CLEAN29 CreateCustomReportLayout(REPORT::"Standard Sales - Quote", CustomReportLayout.Type::Word, 'Quote Customer Full Mod'); AssignCustomLayoutToCustomer( DATABASE::Customer, CustomerFullMod."No.", CustomReportSelection.Usage::"S.Quote", REPORT::"Standard Sales - Quote", CustomReportLayout.Code); +#else + AssignCustomLayoutToCustomer( + DATABASE::Customer, CustomerFullMod."No.", CustomReportSelection.Usage::"S.Quote", REPORT::"Standard Sales - Quote", ''); +#endif CustomReportSelection.SetRange("Source Type", DATABASE::Customer); CustomReportSelection.SetRange("Source No.", CustomerFullMod."No."); @@ -87,7 +98,9 @@ codeunit 134761 "Test Custom Reports" Assert.IsFalse(CustomReportSelection.FindFirst(), 'Customer.OnDelete failed to remove CustomReportSelection'); Clear(CustomReportSelection); +#if not CLEAN29 CustomReportLayout.DeleteAll(); +#endif end; [Test] @@ -761,6 +774,7 @@ codeunit 134761 "Test Custom Reports" Assert.ExpectedError(ReportIDMustHaveValueErr); end; +#if not CLEAN29 [Test] [Scope('OnPrem')] procedure UT_CleanEmailBodyLayoutCode_OnReportIdValidate() @@ -795,6 +809,7 @@ codeunit 134761 "Test Custom Reports" CustomReportSelection.TestField("Custom Report Layout Code", ''); CustomReportSelection.TestField("Use for Email Body", true); end; +#endif [Test] [Scope('OnPrem')] @@ -1076,6 +1091,7 @@ codeunit 134761 "Test Custom Reports" Assert.IsTrue(PurchCrMemoLine.HasTypeToFillMandatoryFields(), ''); end; +#if not CLEAN29 [Test] [HandlerFunctions('StandardStatementDefaultLayoutHandler,StatementCancelHandler')] [Scope('OnPrem')] @@ -1186,6 +1202,7 @@ codeunit 134761 "Test Custom Reports" // Tear down InitReportSelections(); end; +#endif [Test] [Scope('OnPrem')] @@ -1375,7 +1392,9 @@ codeunit 134761 "Test Custom Reports" // Clean out existing data and set up new ReportLayoutSelection.DeleteAll(); CustomReportSelection.DeleteAll(); +#if not CLEAN29 CustomReportLayout.DeleteAll(); +#endif InitReportSelections(); @@ -1383,49 +1402,85 @@ codeunit 134761 "Test Custom Reports" LibrarySales.CreateCustomer(CustomerPartialMod); LibrarySales.CreateCustomer(CustomerNoMod); Clear(CustomReportSelection); +#if not CLEAN29 CreateCustomReportLayout(REPORT::"Standard Sales - Quote", CustomReportLayout.Type::Word, 'Quote Customer Full Mod'); AssignCustomLayoutToCustomer( DATABASE::Customer, CustomerFullMod."No.", CustomReportSelection.Usage::"S.Quote", REPORT::"Standard Sales - Quote", CustomReportLayout.Code); +#else + AssignCustomLayoutToCustomer( + DATABASE::Customer, CustomerFullMod."No.", CustomReportSelection.Usage::"S.Quote", REPORT::"Standard Sales - Quote", ''); +#endif Clear(CustomReportSelection); +#if not CLEAN29 CreateCustomReportLayout(REPORT::"Standard Sales - Order Conf.", CustomReportLayout.Type::Word, 'Order Customer Full Mod'); AssignCustomLayoutToCustomer( DATABASE::Customer, CustomerFullMod."No.", CustomReportSelection.Usage::"S.Order", REPORT::"Standard Sales - Order Conf.", CustomReportLayout.Code); +#else + AssignCustomLayoutToCustomer( + DATABASE::Customer, CustomerFullMod."No.", CustomReportSelection.Usage::"S.Order", REPORT::"Standard Sales - Order Conf.", ''); +#endif Clear(CustomReportSelection); +#if not CLEAN29 CreateCustomReportLayout(REPORT::"Standard Sales - Invoice", CustomReportLayout.Type::Word, 'Invoice Customer Full Mod'); AssignCustomLayoutToCustomer( DATABASE::Customer, CustomerFullMod."No.", CustomReportSelection.Usage::"S.Invoice", REPORT::"Standard Sales - Invoice", CustomReportLayout.Code); +#else + AssignCustomLayoutToCustomer( + DATABASE::Customer, CustomerFullMod."No.", CustomReportSelection.Usage::"S.Invoice", REPORT::"Standard Sales - Invoice", ''); +#endif Clear(CustomReportSelection); +#if not CLEAN29 CreateCustomReportLayout(REPORT::"Standard Sales - Credit Memo", CustomReportLayout.Type::Word, 'Credit Memo Customer Full Mod'); AssignCustomLayoutToCustomer( DATABASE::Customer, CustomerFullMod."No.", CustomReportSelection.Usage::"S.Cr.Memo", REPORT::"Standard Sales - Credit Memo", CustomReportLayout.Code); +#else + AssignCustomLayoutToCustomer( + DATABASE::Customer, CustomerFullMod."No.", CustomReportSelection.Usage::"S.Cr.Memo", + REPORT::"Standard Sales - Credit Memo", ''); +#endif Clear(CustomReportSelection); +#if not CLEAN29 CreateCustomReportLayout(REPORT::"Standard Statement", CustomReportLayout.Type::Word, StandardStatementFullModTxt); AssignCustomLayoutToCustomer( DATABASE::Customer, CustomerFullMod."No.", CustomReportSelection.Usage::"C.Statement", REPORT::"Standard Statement", CustomReportLayout.Code); +#else + AssignCustomLayoutToCustomer( + DATABASE::Customer, CustomerFullMod."No.", CustomReportSelection.Usage::"C.Statement", REPORT::"Standard Statement", ''); +#endif CustomReportSelection."Send To Email" := 'test@contoso.com'; CustomReportSelection.Modify(); Clear(CustomReportSelection); +#if not CLEAN29 CreateCustomReportLayout(REPORT::Statement, CustomReportLayout.Type::RDLC, StatementModTxt); AssignCustomLayoutToCustomer( DATABASE::Customer, CustomerFullMod."No.", CustomReportSelection.Usage::"C.Statement", REPORT::Statement, CustomReportLayout.Code); +#else + AssignCustomLayoutToCustomer( + DATABASE::Customer, CustomerFullMod."No.", CustomReportSelection.Usage::"C.Statement", REPORT::Statement, ''); +#endif Clear(CustomReportSelection); +#if not CLEAN29 CreateCustomReportLayout(REPORT::"Standard Statement", CustomReportLayout.Type::Word, StandardStatementModTxt); AssignCustomLayoutToCustomer( DATABASE::Customer, CustomerFullMod."No.", CustomReportSelection.Usage::"C.Statement", REPORT::"Standard Statement", CustomReportLayout.Code); +#else + AssignCustomLayoutToCustomer( + DATABASE::Customer, CustomerFullMod."No.", CustomReportSelection.Usage::"C.Statement", REPORT::"Standard Statement", ''); +#endif CreateSalesRecord(QuoteSalesHeaderFullMod, QuoteSalesHeaderFullMod."Document Type"::Quote, CustomerFullMod); CreateSalesRecord(OrderSalesHeaderFullMod, QuoteSalesHeaderFullMod."Document Type"::Order, CustomerFullMod); @@ -1512,6 +1567,7 @@ codeunit 134761 "Test Custom Reports" CustomerReportSelections.Usage2.SetValue(Usage); end; +#if not CLEAN29 local procedure CreateCustomReportLayout(ReportID: Integer; LayoutType: Enum "Custom Report Layout Type"; Description: Text[80]) begin CustomReportLayout.Init(); @@ -1521,6 +1577,7 @@ codeunit 134761 "Test Custom Reports" CustomReportLayout.Description := Description; CustomReportLayout.Modify(); end; +#endif local procedure CreateSalesRecord(var SalesHeader: Record "Sales Header"; DocType: Enum "Sales Document Type"; Customer: Record Customer) var @@ -2157,6 +2214,7 @@ codeunit 134761 "Test Custom Reports" RequestPage.OK().Invoke(); end; +#if not CLEAN29 [RequestPageHandler] [Scope('OnPrem')] procedure StatementCancelHandler(var RequestPage: TestRequestPage Statement) @@ -2182,6 +2240,7 @@ codeunit 134761 "Test Custom Reports" begin PurchaseInvoice.Cancel().Invoke(); end; +#endif [ReportHandler] [Scope('OnPrem')] @@ -2225,11 +2284,14 @@ codeunit 134761 "Test Custom Reports" AddNewCustomerReportSelection(CustomerReportSelections, Usage::"Credit Memo", REPORT::"G/L Register"); end; +#if not CLEAN29 [ModalPageHandler] [Scope('OnPrem')] procedure CustomerReportSelectionHandler(var CustomerReportSelections: TestPage "Customer Report Selections") var +#pragma warning disable AL0432 ExpectedCustomReportLayout: Record "Custom Report Layout"; +#pragma warning restore AL0432 begin ExpectedCustomReportLayout.Get(LibraryVariableStorage.DequeueText()); @@ -2252,6 +2314,7 @@ codeunit 134761 "Test Custom Reports" ExpectedCustomReportLayout.Code, CustomReportSelection."Custom Report Layout Code", 'Incorrect Value in Customer Report Selections'); end; +#endif [RequestPageHandler] [Scope('OnPrem')] diff --git a/src/Layers/NL/BaseApp/Foundation/Company/CompanyInitialize.Codeunit.al b/src/Layers/NL/BaseApp/Foundation/Company/CompanyInitialize.Codeunit.al index c21d11af1e2..741efaabac7 100644 --- a/src/Layers/NL/BaseApp/Foundation/Company/CompanyInitialize.Codeunit.al +++ b/src/Layers/NL/BaseApp/Foundation/Company/CompanyInitialize.Codeunit.al @@ -764,7 +764,11 @@ codeunit 2 "Company-Initialize" var AssistedCompanySetupStatus: Record "Assisted Company Setup Status"; ApplicationAreaSetup: Record "Application Area Setup"; +#if not CLEAN29 +#pragma warning disable AL0432, AS0105 CustomReportLayout: Record "Custom Report Layout"; +#pragma warning restore AL0432, AS0105 +#endif ReportLayoutSelection: Record "Report Layout Selection"; ExperienceTierSetup: Record "Experience Tier Setup"; begin @@ -775,8 +779,10 @@ codeunit 2 "Company-Initialize" AssistedCompanySetupStatus.DeleteAll(); ApplicationAreaSetup.SetRange("Company Name", Rec.Name); ApplicationAreaSetup.DeleteAll(); +#if not CLEAN29 CustomReportLayout.SetRange("Company Name", Rec.Name); CustomReportLayout.DeleteAll(); +#endif ReportLayoutSelection.SetRange("Company Name", Rec.Name); ReportLayoutSelection.DeleteAll(); diff --git a/src/Layers/NO/BaseApp/Foundation/Company/CompanyInitialize.Codeunit.al b/src/Layers/NO/BaseApp/Foundation/Company/CompanyInitialize.Codeunit.al index fcf6cd04efa..a7bdbc41c7d 100644 --- a/src/Layers/NO/BaseApp/Foundation/Company/CompanyInitialize.Codeunit.al +++ b/src/Layers/NO/BaseApp/Foundation/Company/CompanyInitialize.Codeunit.al @@ -781,7 +781,11 @@ codeunit 2 "Company-Initialize" var AssistedCompanySetupStatus: Record "Assisted Company Setup Status"; ApplicationAreaSetup: Record "Application Area Setup"; +#if not CLEAN29 +#pragma warning disable AL0432, AS0105 CustomReportLayout: Record "Custom Report Layout"; +#pragma warning restore AL0432, AS0105 +#endif ReportLayoutSelection: Record "Report Layout Selection"; ExperienceTierSetup: Record "Experience Tier Setup"; begin @@ -792,8 +796,10 @@ codeunit 2 "Company-Initialize" AssistedCompanySetupStatus.DeleteAll(); ApplicationAreaSetup.SetRange("Company Name", Rec.Name); ApplicationAreaSetup.DeleteAll(); +#if not CLEAN29 CustomReportLayout.SetRange("Company Name", Rec.Name); CustomReportLayout.DeleteAll(); +#endif ReportLayoutSelection.SetRange("Company Name", Rec.Name); ReportLayoutSelection.DeleteAll(); diff --git a/src/Layers/NO/BaseApp/Sales/Setup/ReportSelectionSales.Page.al b/src/Layers/NO/BaseApp/Sales/Setup/ReportSelectionSales.Page.al index dc692c7b385..1096f98e126 100644 --- a/src/Layers/NO/BaseApp/Sales/Setup/ReportSelectionSales.Page.al +++ b/src/Layers/NO/BaseApp/Sales/Setup/ReportSelectionSales.Page.al @@ -10,6 +10,7 @@ using System.Reflection; /// /// Configures default report selections for sales document types. Allows users to specify which reports to use for printing, emailing, and other output operations. /// +#pragma warning disable AS0032 page 306 "Report Selection - Sales" { AboutTitle = 'About report selection for sales'; @@ -120,6 +121,8 @@ page 306 "Report Selection - Sales" ToolTip = 'Specifies the ID of the custom email body layout that is used.'; Visible = false; } +#if not CLEAN29 +#pragma warning disable AL0432 field("Email Body Layout Description"; Rec."Email Body Layout Description") { ApplicationArea = Basic, Suite; @@ -131,13 +134,13 @@ page 306 "Report Selection - Sales" var CustomReportLayout: Record "Custom Report Layout"; begin -#pragma warning disable AL0432 if CustomReportLayout.LookupLayoutOK(Rec."Report ID") then -#pragma warning restore AL0432 Rec.Validate("Email Body Layout Code", CustomReportLayout.Code); end; #endif } +#pragma warning restore AL0432 +#endif } } area(factboxes) @@ -289,4 +292,5 @@ page 306 "Report Selection - Sales" begin end; } +#pragma warning restore AS0032 diff --git a/src/Layers/RU/BaseApp/Foundation/Company/CompanyInitialize.Codeunit.al b/src/Layers/RU/BaseApp/Foundation/Company/CompanyInitialize.Codeunit.al index 584f86c6e49..268b6a4341d 100644 --- a/src/Layers/RU/BaseApp/Foundation/Company/CompanyInitialize.Codeunit.al +++ b/src/Layers/RU/BaseApp/Foundation/Company/CompanyInitialize.Codeunit.al @@ -816,7 +816,11 @@ codeunit 2 "Company-Initialize" var AssistedCompanySetupStatus: Record "Assisted Company Setup Status"; ApplicationAreaSetup: Record "Application Area Setup"; +#if not CLEAN29 +#pragma warning disable AL0432, AS0105 CustomReportLayout: Record "Custom Report Layout"; +#pragma warning restore AL0432, AS0105 +#endif ReportLayoutSelection: Record "Report Layout Selection"; ExperienceTierSetup: Record "Experience Tier Setup"; begin @@ -827,8 +831,10 @@ codeunit 2 "Company-Initialize" AssistedCompanySetupStatus.DeleteAll(); ApplicationAreaSetup.SetRange("Company Name", Rec.Name); ApplicationAreaSetup.DeleteAll(); +#if not CLEAN29 CustomReportLayout.SetRange("Company Name", Rec.Name); CustomReportLayout.DeleteAll(); +#endif ReportLayoutSelection.SetRange("Company Name", Rec.Name); ReportLayoutSelection.DeleteAll(); diff --git a/src/Layers/RU/BaseApp/Foundation/Reporting/ReportSelections.Table.al b/src/Layers/RU/BaseApp/Foundation/Reporting/ReportSelections.Table.al index 6f140a81deb..5c2344cf60e 100644 --- a/src/Layers/RU/BaseApp/Foundation/Reporting/ReportSelections.Table.al +++ b/src/Layers/RU/BaseApp/Foundation/Reporting/ReportSelections.Table.al @@ -65,7 +65,11 @@ table 77 "Report Selections" { Caption = 'Custom Report Layout Code'; Editable = false; +#if not CLEAN29 +#pragma warning disable AL0432, AS0105 TableRelation = "Custom Report Layout".Code where(Code = field("Custom Report Layout Code"), "Built-In" = const(false)); +#pragma warning restore AL0432, AS0105 +#endif } field(19; "Use for Email Attachment"; Boolean) { @@ -99,9 +103,15 @@ table 77 "Report Selections" field(21; "Email Body Layout Code"; Code[20]) { Caption = 'Email Body Custom Layout Code'; +#if not CLEAN29 +#pragma warning disable AL0432, AS0105 TableRelation = if ("Email Body Layout Type" = const("Custom Report Layout")) "Custom Report Layout".Code where(Code = field("Email Body Layout Code"), "Report ID" = field("Report ID"), "Built-In" = const(false)) else if ("Email Body Layout Type" = const("HTML Layout")) "O365 HTML Template".Code; +#pragma warning restore AL0432, AS0105 +#else + TableRelation = if ("Email Body Layout Type" = const("HTML Layout")) "O365 HTML Template".Code; +#endif ToolTip = 'Specifies the ID of the custom email body layout that is used.'; trigger OnValidate() @@ -110,21 +120,33 @@ table 77 "Report Selections" Testfield("Use for Email Body", true); "Email Body Layout Name" := ''; end; +#if not CLEAN29 +#pragma warning disable AL0432 Calcfields("Email Body Layout Description"); +#pragma warning restore AL0432 +#endif end; } +#if not CLEAN29 field(22; "Email Body Layout Description"; Text[250]) { +#pragma warning disable AL0432 CalcFormula = lookup("Custom Report Layout".Description where(Code = field("Email Body Layout Code"))); +#pragma warning restore AL0432 Caption = 'Email Body Custom Layout Description'; Editable = false; FieldClass = Flowfield; + ObsoleteState = Pending; + ObsoleteReason = 'Replaced by the system report layout system ("Tenant Report Layout"). This field will be removed in a future version.'; + ObsoleteTag = '29.0'; ToolTip = 'Specifies a description of the custom email body layout that is used.'; #if not CLEAN28 trigger OnLookup() var +#pragma warning disable AL0432 CustomReportLayout: Record "Custom Report Layout"; +#pragma warning restore AL0432 begin if "Email Body Layout Type" = "Email Body Layout Type"::"Custom Report Layout" then #pragma warning disable AL0432 @@ -134,6 +156,7 @@ table 77 "Report Selections" end; #endif } +#endif field(25; "Email Body Layout Type"; Enum "Email Body Layout Type") { Caption = 'Email Body Layout Type'; @@ -166,7 +189,11 @@ table 77 "Report Selections" if "Email Body Layout Name" <> '' then begin "Use for Email Body" := true; "Email Body Layout Code" := ''; +#if not CLEAN29 +#pragma warning disable AL0432 "Email Body Layout Description" := ''; +#pragma warning restore AL0432 +#endif ReportLayoutList.SetRange(Name, "Email Body Layout Name"); ReportLayoutList.SetRange("Report ID", Rec."Report ID"); if not IsNullGuid("Email Body Layout AppID") then @@ -2475,13 +2502,17 @@ table 77 "Report Selections" exit((ReportUsage = "Report Selection Usage"::"V.Remittance".AsInteger()) and (TableId = Database::"Gen. Journal Line")); end; +#if not CLEAN29 internal procedure DoesAnyCustomLayotExist(): Boolean var +#pragma warning disable AL0432, AS0105 CustomReportLayout: Record "Custom Report Layout"; +#pragma warning restore AL0432, AS0105 begin CustomReportLayout.SetRange("Built-In", false); exit(not CustomReportLayout.IsEmpty()); end; +#endif [IntegrationEvent(false, false)] local procedure OnAfterGetCustomReportSelectionForTable(var CustomReportSelection: Record "Custom Report Selection"; TableNo: Integer) diff --git a/src/Layers/RU/BaseApp/Permissions/d365busfullaccess.permissionset.al b/src/Layers/RU/BaseApp/Permissions/d365busfullaccess.permissionset.al index ea92c5baced..aca1a6104f1 100644 --- a/src/Layers/RU/BaseApp/Permissions/d365busfullaccess.permissionset.al +++ b/src/Layers/RU/BaseApp/Permissions/d365busfullaccess.permissionset.al @@ -344,7 +344,11 @@ permissionset 959 "D365 BUS FULL ACCESS" tabledata "Current Salesperson" = RIMD, tabledata "Custom Address Format" = RIMD, tabledata "Custom Address Format Line" = RIMD, +#if not CLEAN29 +#pragma warning disable AL0432, AS0105 tabledata "Custom Report Layout" = RIMD, +#pragma warning restore AL0432, AS0105 +#endif tabledata "Custom Report Selection" = RIMD, tabledata "Customer Amount" = RIMD, tabledata "Customer Sales Buffer" = RIMD, diff --git a/src/Layers/RU/BaseApp/Purchases/Setup/ReportSelectionPurchase.Page.al b/src/Layers/RU/BaseApp/Purchases/Setup/ReportSelectionPurchase.Page.al index e418153e2fb..9590b47edd5 100644 --- a/src/Layers/RU/BaseApp/Purchases/Setup/ReportSelectionPurchase.Page.al +++ b/src/Layers/RU/BaseApp/Purchases/Setup/ReportSelectionPurchase.Page.al @@ -7,6 +7,7 @@ namespace Microsoft.Purchases.Setup; using Microsoft.Foundation.Reporting; using System.Reflection; +#pragma warning disable AS0032 page 347 "Report Selection - Purchase" { AboutTitle = 'About report selection for purchases'; @@ -127,6 +128,8 @@ page 347 "Report Selection - Purchase" ToolTip = 'Specifies the ID of the custom email body layout that is used.'; Visible = false; } +#if not CLEAN29 +#pragma warning disable AL0432 field("Email Body Layout Description"; Rec."Email Body Layout Description") { ApplicationArea = Basic, Suite; @@ -138,13 +141,13 @@ page 347 "Report Selection - Purchase" var CustomReportLayout: Record "Custom Report Layout"; begin -#pragma warning disable AL0432 if CustomReportLayout.LookupLayoutOK(Rec."Report ID") then -#pragma warning restore AL0432 Rec.Validate("Email Body Layout Code", CustomReportLayout.Code); end; #endif } +#pragma warning restore AL0432 +#endif } } area(factboxes) @@ -299,4 +302,5 @@ page 347 "Report Selection - Purchase" begin end; } +#pragma warning restore AS0032 diff --git a/src/Layers/RU/BaseApp/Sales/Setup/ReportSelectionSales.Page.al b/src/Layers/RU/BaseApp/Sales/Setup/ReportSelectionSales.Page.al index e6015003844..7605a93051c 100644 --- a/src/Layers/RU/BaseApp/Sales/Setup/ReportSelectionSales.Page.al +++ b/src/Layers/RU/BaseApp/Sales/Setup/ReportSelectionSales.Page.al @@ -10,6 +10,7 @@ using System.Reflection; /// /// Configures default report selections for sales document types. Allows users to specify which reports to use for printing, emailing, and other output operations. /// +#pragma warning disable AS0032 page 306 "Report Selection - Sales" { AboutTitle = 'About report selection for sales'; @@ -130,6 +131,8 @@ page 306 "Report Selection - Sales" ToolTip = 'Specifies the ID of the custom email body layout that is used.'; Visible = false; } +#if not CLEAN29 +#pragma warning disable AL0432 field("Email Body Layout Description"; Rec."Email Body Layout Description") { ApplicationArea = Basic, Suite; @@ -141,13 +144,13 @@ page 306 "Report Selection - Sales" var CustomReportLayout: Record "Custom Report Layout"; begin -#pragma warning disable AL0432 if CustomReportLayout.LookupLayoutOK(Rec."Report ID") then -#pragma warning restore AL0432 Rec.Validate("Email Body Layout Code", CustomReportLayout.Code); end; #endif } +#pragma warning restore AL0432 +#endif } } area(factboxes) @@ -315,4 +318,5 @@ page 306 "Report Selection - Sales" begin end; } +#pragma warning restore AS0032 diff --git a/src/Layers/RU/DemoTool/CreateRapidStartPackage.Codeunit.al b/src/Layers/RU/DemoTool/CreateRapidStartPackage.Codeunit.al index 12f3f3c2cd9..447a1420909 100644 --- a/src/Layers/RU/DemoTool/CreateRapidStartPackage.Codeunit.al +++ b/src/Layers/RU/DemoTool/CreateRapidStartPackage.Codeunit.al @@ -251,7 +251,11 @@ codeunit 101995 "Create RapidStart Package" CreateTable(Database::"Word Template"); // Reporting +#if not CLEAN29 +#pragma warning disable AL0432, AS0105 CreateTable(DATABASE::"Custom Report Layout"); +#pragma warning restore AL0432, AS0105 +#endif CreateConfigPackageHelper.SetSkipTableTriggers(); // Office Add-Ins diff --git a/src/Layers/RU/Tests/Integration-Internal/MailServiceTest.Codeunit.al b/src/Layers/RU/Tests/Integration-Internal/MailServiceTest.Codeunit.al index f6c3fe357aa..efff8bba0c0 100644 --- a/src/Layers/RU/Tests/Integration-Internal/MailServiceTest.Codeunit.al +++ b/src/Layers/RU/Tests/Integration-Internal/MailServiceTest.Codeunit.al @@ -1,3 +1,4 @@ +#pragma warning disable AL0432, AS0105 codeunit 139111 "Mail Service Test" { Subtype = Test; @@ -21,20 +22,26 @@ codeunit 139111 "Mail Service Test" LibrarySales: Codeunit "Library - Sales"; LibraryPurchase: Codeunit "Library - Purchase"; LibraryService: Codeunit "Library - Service"; +#if not CLEAN29 LibraryJob: Codeunit "Library - Job"; +#endif ActiveDirectoryMockEvents: Codeunit "Active Directory Mock Events"; IsInitialized: Boolean; EmailSubjectCapMsg: Label '%1 - %2 %3'; AttachmentNameTok: Label '%1 %2.pdf'; SalesInvoiceTxt: Label 'Sales Invoice'; +#if not CLEAN29 SalesQuoteTxt: Label 'Sales Quote'; +#endif SalesShipmentTxt: Label 'Sales Shipment'; SalesReceiptTxt: Label 'Sales Receipt'; PurchaseQuoteTxt: Label 'Purchase Quote'; PurchaseOrderTxt: Label 'Purchase Order'; ServiceInvoiceTxt: Label 'Service Invoice'; ServiceCrMemoTxt: Label 'Service Credit Memo'; +#if not CLEAN29 JobQuoteTxt: Label 'Project Quote'; +#endif IncorrectSubjectErr: Label 'Subject is not correct'; IncorrectAttachNameErr: Label 'Attachment Name is not correct'; @@ -110,6 +117,7 @@ codeunit 139111 "Mail Service Test" // [THEN] Send dialog appeared (handler has been invoked) end; +#if not CLEAN29 [Test] [HandlerFunctions('ValidateMailDialog')] [Scope('OnPrem')] @@ -177,6 +185,7 @@ codeunit 139111 "Mail Service Test" LibraryVariableStorage.AssertEmpty(); end; +#endif [Test] [HandlerFunctions('ValidateMailDialog')] @@ -207,6 +216,7 @@ codeunit 139111 "Mail Service Test" LibraryVariableStorage.AssertEmpty(); end; +#if not CLEAN29 [Test] [HandlerFunctions('ValidateMailDialog')] [Scope('OnPrem')] @@ -236,6 +246,7 @@ codeunit 139111 "Mail Service Test" LibraryVariableStorage.AssertEmpty(); end; +#endif [Test] [HandlerFunctions('SelectSendingOptionsOKModalPageHandler,ValidateMailDialog')] @@ -383,6 +394,7 @@ codeunit 139111 "Mail Service Test" end; end; +#if not CLEAN29 local procedure CreateCustomReportSelectionForCustomer(CustomerNo: Code[20]; ReportSelectionUsage: Enum "Report Selection Usage"; ReportID: Integer) var CustomReportSelection: Record "Custom Report Selection"; @@ -399,6 +411,7 @@ codeunit 139111 "Mail Service Test" "Email Body Layout Code", CustomReportLayout.InitBuiltInLayout(CustomReportSelection."Report ID", CustomReportLayout.Type::Word.AsInteger())); CustomReportSelection.Insert(true); end; +#endif local procedure CreateEmailPdfDefaultDocumentSendingProfile(); var @@ -564,4 +577,5 @@ codeunit 139111 "Mail Service Test" ActiveDirectoryMockEvents.Enable(); end; } +#pragma warning restore AL0432, AS0105 diff --git a/src/Layers/RU/Tests/Misc/PaymentServicesTest.Codeunit.al b/src/Layers/RU/Tests/Misc/PaymentServicesTest.Codeunit.al index 00d0a7ec64a..8d7dc8e205e 100644 --- a/src/Layers/RU/Tests/Misc/PaymentServicesTest.Codeunit.al +++ b/src/Layers/RU/Tests/Misc/PaymentServicesTest.Codeunit.al @@ -1,3 +1,4 @@ +#pragma warning disable AL0432, AS0105 codeunit 134425 "Payment Services Test" { EventSubscriberInstance = Manual; @@ -1486,20 +1487,26 @@ codeunit 134425 "Payment Services Test" local procedure SetupReportSelections() var +#if not CLEAN29 CustomReportLayout: Record "Custom Report Layout"; +#endif ReportSelections: Record "Report Selections"; begin ReportSelections.DeleteAll(); CreateDefaultReportSelection(); +#if not CLEAN29 GetCustomBodyLayout(CustomReportLayout); +#endif ReportSelections.Reset(); ReportSelections.SetRange(Usage, ReportSelections.Usage::"S.Invoice"); ReportSelections.FindFirst(); ReportSelections.Validate("Use for Email Attachment", true); ReportSelections.Validate("Use for Email Body", true); +#if not CLEAN29 ReportSelections.Validate("Email Body Layout Code", CustomReportLayout.Code); +#endif ReportSelections.Modify(true); end; @@ -1515,6 +1522,7 @@ codeunit 134425 "Payment Services Test" ReportSelections.Insert(); end; +#if not CLEAN29 local procedure GetReportID(): Integer begin exit(REPORT::"Standard Sales - Invoice"); @@ -1553,6 +1561,7 @@ codeunit 134425 "Payment Services Test" CustomReportLayout.Insert(); end; end; +#endif local procedure AssignMockSetupRecordID(var TempPaymentServiceSetup: Record "Payment Service Setup" temporary) var @@ -1992,3 +2001,4 @@ codeunit 134425 "Payment Services Test" ActiveDirectoryMockEvents.Enable(); end; } +#pragma warning restore AL0432, AS0105 diff --git a/src/Layers/RU/Tests/Misc/ReportSelectionsTests.Codeunit.al b/src/Layers/RU/Tests/Misc/ReportSelectionsTests.Codeunit.al index c4f940c2daf..2a4dac74189 100644 --- a/src/Layers/RU/Tests/Misc/ReportSelectionsTests.Codeunit.al +++ b/src/Layers/RU/Tests/Misc/ReportSelectionsTests.Codeunit.al @@ -28,22 +28,31 @@ FromEmailBodyTemplateTxt: Text; Initialized: Boolean; TemplateIdentificationTxt: Label 'a'; +#if not CLEAN29 CustomerEmailTxt: Label 'Customer@contoso.com'; CustomLayoutEmailTxt: Label 'CustomLayout@contoso.com'; +#endif WrongEmailAddressErr: Label 'Email Address is wrong on Send Email Dialog'; +#if not CLEAN29 DocumentNoTok: Label 'DocumentNo'; +#endif ReportIDMustHaveValueErr: Label 'Report ID must have a value'; +#if not CLEAN29 EmailAddressErr: Label 'Destination email address does not match expected address.'; +#endif StatementTitlePdfTxt: Label 'Statement'; ReportTitleTemplatePdfTxt: Label '%1 for %2 as of %3.pdf'; #if not CLEAN28 LayoutCodeShouldNotChangedErr: Label 'Layout code should not change.'; #endif SendToEmailTxt: Label 'test@test.com'; +#if not CLEAN29 MSXLbl: Label 'MS-X%1', Comment = '%1 = Random Value'; DocxLbl: Label 'docx'; MustSelectAndEmailBodyOrAttahmentErr: Label 'You must select an email body or attachment in report selection for %1.', Comment = '%1 = Usage, for example Sales Invoice'; +#endif +#if not CLEAN29 [Test] [HandlerFunctions('StandardSalesInvoiceRequestPageHandler')] [Scope('OnPrem')] @@ -87,7 +96,9 @@ // Verify Assert.ExpectedError('email body or attachment'); end; +#endif +#if not CLEAN29 [Test] [HandlerFunctions('EmailEditorHandlerCustomMessage,CloseEmailEditorHandler')] [Scope('OnPrem')] @@ -290,8 +301,10 @@ // Verify is within handler end; +#endif #if not CLEAN27 +#if not CLEAN29 [Test] [Scope('OnPrem')] procedure TestHTMLEmailBodyLoad() @@ -413,7 +426,9 @@ StrSubstNo('Destination email address does not match expected address %1', CustomLayoutEmailTxt)); end; #endif +#endif +#if not CLEAN29 [Test] [Scope('OnPrem')] procedure TestHTMLEmailBodyLoadFromBlob() @@ -553,6 +568,7 @@ LibraryVariableStorage.AssertEmpty(); end; +#endif [Test] [HandlerFunctions('EmailEditorHandler,CloseEmailEditorHandler')] @@ -835,6 +851,7 @@ LibraryVariableStorage.AssertEmpty(); end; +#if not CLEAN29 [Test] [HandlerFunctions('StatementOKRequestPageHandler,DownloadAttachmentNoConfirmHandler')] [Scope('OnPrem')] @@ -887,6 +904,7 @@ FindInteractionLogEntriesByCustomerNo(InteractionLogEntry, CustomerNo, InteractionLogEntry."Document Type"::"Sales Stmnt."); Assert.RecordCount(InteractionLogEntry, 1); end; +#endif [Test] @@ -1262,6 +1280,7 @@ Assert.IsTrue(StrPos(CustomerReportSelections.SendToEmail.Value, 'testcase@testcase.com') <> 0, 'Wrong email after contact update.'); end; +#if not CLEAN29 [Test] [Scope('OnPrem')] procedure PostedSalesInvoiceEmailHasMorePriorityThanCustomerEmail() @@ -1297,6 +1316,7 @@ // [THEN] The "a@a.com; b@b.com; c@c.com" address is used as target email address. Assert.AreEqual(SalesHeader."Sell-to E-Mail", EmailAddress, EmailAddressErr); end; +#endif [Test] [Scope('OnPrem')] @@ -1462,6 +1482,7 @@ LibraryTempNVBufferHandler.AssertQueueEmpty(); end; +#if not CLEAN29 [Test] [HandlerFunctions('TestAddressEmailEditorHandler,CloseEmailEditorHandler')] [Scope('OnPrem')] @@ -1558,6 +1579,7 @@ LibraryVariableStorage.AssertEmpty(); end; +#endif [Test] [Scope('OnPrem')] @@ -1977,6 +1999,7 @@ // No assertion needed - if we reach this point, the fix is working end; +#if not CLEAN29 [Test] [HandlerFunctions('SelectSendingOptionHandler,EmailEditorHandler,CloseEmailEditorHandler')] procedure TestSendPostedSalesShipmentToEMailAndPDF() @@ -2551,6 +2574,7 @@ // [THEN] Verify message type with Email Handler. end; +#endif local procedure Initialize() var @@ -2728,6 +2752,7 @@ SalesInvoiceHeader.Get(LibrarySales.PostSalesDocument(SalesHeader, true, true)); end; +#if not CLEAN29 local procedure OpenNewPostedSalesInvoice(var PostedSalesInvoice: TestPage "Posted Sales Invoice") var SalesInvoiceHeader: Record "Sales Invoice Header"; @@ -2752,11 +2777,11 @@ OldReportSelections.Usage::"S.Invoice", CustomReportLayout."Report ID", UseForEmailAttachment, UseForEmailBody, CustomReportLayout.Code); end; +#endif local procedure SetupReportSelectionsVendor(UseForEmailAttachment: Boolean; UseForEmailBody: Boolean) var OldReportSelections: Record "Report Selections"; - DummyCustomReportLayout: Record "Custom Report Layout"; begin OldReportSelections.Reset(); OldReportSelections.SetRange(Usage, OldReportSelections.Usage::"P.Order"); @@ -2764,8 +2789,7 @@ CreateReportSelection(OldReportSelections.Usage::"P.Order", '2', REPORT::Order); UpdateReportSelections( - OldReportSelections.Usage::"P.Order", GetReportIDForPurchaseOrder(), UseForEmailAttachment, UseForEmailBody, - DummyCustomReportLayout.Code); + OldReportSelections.Usage::"P.Order", GetReportIDForPurchaseOrder(), UseForEmailAttachment, UseForEmailBody, ''); end; local procedure SetupInvoiceReportLayoutSelection() @@ -2821,6 +2845,7 @@ ReportSelections.Modify(true); end; +#if not CLEAN29 local procedure UpdateCustomReportSelections(NewCustNo: Code[20]; UseForEmailAttachment: Boolean; UseForEmailBody: Boolean; SendToAddress: Text[200]) var CustomReportSelection: Record "Custom Report Selection"; @@ -2839,16 +2864,19 @@ CustomReportSelection.Modify(true); end; +#endif local procedure GenerateGUIDWithSpecialSymbol(): Code[20] begin exit(LibraryUtility.GenerateGUID() + '&'); end; +#if not CLEAN29 local procedure GetStandardSalesInvoiceReportID(): Integer begin exit(REPORT::"Standard Sales - Invoice"); end; +#endif local procedure GetReportIDForPurchaseOrder(): Integer begin @@ -2865,6 +2893,7 @@ exit(REPORT::Statement); end; +#if not CLEAN29 local procedure GetCustomBodyLayout(var CustomReportLayout: Record "Custom Report Layout") var ReportLayoutList: Record "Report Layout List"; @@ -2896,6 +2925,7 @@ CustomReportLayout.Insert(); end; end; +#endif #if not CLEAN27 local procedure GetEmailItem(var EmailItem: Record "Email Item"; MessageType: Integer; BodyFilePath: Text[250]; Plaintext: Boolean) @@ -2906,12 +2936,15 @@ end; #endif +#if not CLEAN29 local procedure GetEmailItem(var EmailItem: Record "Email Item"; MessageType: Option "Custom Message","From Email Body Template"; var EmailBody: Codeunit "Temp Blob") begin EmailItem.Validate("Message Type", MessageType); EmailItem.SetBody(EmailBody); end; +#endif +#if not CLEAN29 local procedure SetUpCustomEmail(var SalesInvoiceHeader: Record "Sales Invoice Header"; EmailAddress: Text[80]; UseCustomForEmailBody: Boolean) var Customer: Record Customer; @@ -2924,6 +2957,7 @@ UpdateCustomReportSelections(SalesInvoiceHeader."Bill-to Customer No.", true, UseCustomForEmailBody, EmailAddress); end; +#endif local procedure GenerateRandomPackageTrackingNo(): Text[50] var @@ -3093,6 +3127,7 @@ CustomReportSelection.GetSendToEmailFromContacts(Contact); end; +#if not CLEAN29 local procedure UpdateContactEmail(var Contact: Record Contact; Email: Text[45]) begin Contact.Validate("E-Mail", Email); @@ -3108,6 +3143,7 @@ Customer.Validate("Primary Contact No.", Contact."No."); Customer.Modify(); end; +#endif #if not CLEAN28 local procedure StandardSalesInvoiceReportID(): Integer @@ -3116,6 +3152,7 @@ end; #endif +#if not CLEAN29 local procedure SetupSalesShipmentReportSelections(UseForEmailAttachment: Boolean; UseForEmailBody: Boolean) var OldReportSelections: Record "Report Selections"; @@ -3186,7 +3223,9 @@ CustomReportSelection.Modify(true); end; +#endif +#if not CLEAN29 local procedure GetStandardSalesShipmentReportID(): Integer begin exit(Report::"Standard Sales - Shipment"); @@ -3208,7 +3247,9 @@ LibrarySales.PostSalesDocument(SalesHeader, true, false); SalesPost.GetPostedDocumentRecord(SalesHeader, PostedDocumentVariant); end; +#endif +#if not CLEAN29 local procedure SetupSalesReturnReceiptReportSelections(UseForEmailAttachment: Boolean; UseForEmailBody: Boolean) var OldReportSelections: Record "Report Selections"; @@ -3279,7 +3320,9 @@ CustomReportSelection.Modify(true); end; +#endif +#if not CLEAN29 local procedure GetStandardSalesReturnReceiptReportID(): Integer begin exit(Report::"Standard Sales - Return Rcpt."); @@ -3301,12 +3344,15 @@ LibrarySales.PostSalesDocument(SalesHeader, true, false); SalesPost.GetPostedDocumentRecord(SalesHeader, PostedDocumentVariant); end; +#endif +#if not CLEAN29 local procedure UpdateYourReferenceSalesHeader(var SalesHeader: Record "Sales Header"; YourReference: Text[35]) begin SalesHeader."Your Reference" := YourReference; SalesHeader.Modify(); end; +#endif [RequestPageHandler] [Scope('OnPrem')] @@ -3486,6 +3532,7 @@ VendorReportSelections.CopyFromReportSelectionsAction.Invoke(); end; +#if not CLEAN29 [ModalPageHandler] procedure VendorReportSelectionsHandler(var VendorReportSelections: TestPage "Vendor Report Selections") begin @@ -3493,6 +3540,7 @@ VendorReportSelections."Custom Report Description".Drilldown(); VendorReportSelections."Custom Report Description".AssertEquals(LibraryVariableStorage.DequeueText()); end; +#endif [ModalPageHandler] procedure ProFormInvoiceCustomerReportSelectionsHandler(var CustomerReportSelections: TestPage "Customer Report Selections") diff --git a/src/Layers/US/Tests/Local/EmailCustomReportLayout.Codeunit.al b/src/Layers/US/Tests/Local/EmailCustomReportLayout.Codeunit.al index a511d8bff65..fda28ab2d2f 100644 --- a/src/Layers/US/Tests/Local/EmailCustomReportLayout.Codeunit.al +++ b/src/Layers/US/Tests/Local/EmailCustomReportLayout.Codeunit.al @@ -1223,6 +1223,7 @@ codeunit 144083 "EMail Custom Report Layout" exit(REPORT::"ExportElecPayments - Word"); end; +#if not CLEAN29 local procedure GetBuiltInLayoutCode(ReportID: Integer): Code[20]; var CustomReportLayout: Record "Custom Report Layout"; @@ -1243,6 +1244,7 @@ codeunit 144083 "EMail Custom Report Layout" exit(CustomReportLayout.Code); end; +#endif local procedure InsertCustomReportSelectionVendor(var CustomReportSelection: Record "Custom Report Selection"; Vendor: Record "Vendor"; ReportID: Integer; UseForEmailAttachment: Boolean; UseForEmailBody: Boolean; SendToAddress: Text[200]; ReportUsage: Enum "Report Selection Usage"); begin @@ -1258,11 +1260,15 @@ codeunit 144083 "EMail Custom Report Layout" CustomReportSelection.Validate(Sequence, CustomReportSelection.COUNT + 1); CustomReportSelection.Validate("Report ID", ReportID); CustomReportSelection.Validate("Use For Email Attachment", UseForEmailAttachment); +#if not CLEAN29 if CustomReportSelection."Use For Email Attachment" then CustomReportSelection.Validate("Custom Report Layout Code", GetBuiltInLayoutCode(ReportID)); +#endif CustomReportSelection.Validate("Use For Email Body", UseForEmailBody); +#if not CLEAN29 if CustomReportSelection."Use For Email Body" then CustomReportSelection.Validate("Email Body Layout Code", GetBuiltInLayoutCode(ReportID)); +#endif CustomReportSelection.Validate("Send To Email", SendToAddress); CustomReportSelection.Insert(true); end; @@ -1281,11 +1287,15 @@ codeunit 144083 "EMail Custom Report Layout" CustomReportSelection.Validate(Sequence, CustomReportSelection.COUNT + 1); CustomReportSelection.Validate("Report ID", ReportID); CustomReportSelection.Validate("Use For Email Attachment", UseForEmailAttachment); +#if not CLEAN29 if CustomReportSelection."Use For Email Attachment" then CustomReportSelection.Validate("Custom Report Layout Code", GetBuiltInLayoutCode(ReportID)); +#endif CustomReportSelection.Validate("Use For Email Body", UseForEmailBody); +#if not CLEAN29 if CustomReportSelection."Use For Email Body" then CustomReportSelection.Validate("Email Body Layout Code", GetBuiltInLayoutCode(ReportID)); +#endif CustomReportSelection.Validate("Send To Email", SendToAddress); CustomReportSelection.Insert(true); end; @@ -1300,11 +1310,15 @@ codeunit 144083 "EMail Custom Report Layout" ReportSelections.Validate(Sequence, '1'); ReportSelections.Validate("Report ID", ReportID); ReportSelections.Validate("Use For Email Attachment", UseForEmailAttachment); +#if not CLEAN29 if ReportSelections."Use For Email Attachment" then ReportSelections.Validate("Custom Report Layout Code", GetBuiltInLayoutCode(ReportID)); +#endif ReportSelections.Validate("Use For Email Body", UseForEmailBody); +#if not CLEAN29 if ReportSelections."Use For Email Body" then ReportSelections.Validate("Email Body Layout Code", GetBuiltInLayoutCode(ReportID)); +#endif ReportSelections.Insert(true); end; diff --git a/src/Layers/US/Tests/Local/SMTPEmailCustomReportLayout.Codeunit.al b/src/Layers/US/Tests/Local/SMTPEmailCustomReportLayout.Codeunit.al index 8abc104da1c..5f0b9001c9b 100644 --- a/src/Layers/US/Tests/Local/SMTPEmailCustomReportLayout.Codeunit.al +++ b/src/Layers/US/Tests/Local/SMTPEmailCustomReportLayout.Codeunit.al @@ -1161,6 +1161,7 @@ codeunit 144055 "SMTPEMail Custom Report Layout" exit(REPORT::"ExportElecPayments - Word"); end; +#if not CLEAN29 local procedure GetBuiltInLayoutCode(ReportID: Integer): Code[20]; var CustomReportLayout: Record "Custom Report Layout"; @@ -1181,6 +1182,7 @@ codeunit 144055 "SMTPEMail Custom Report Layout" exit(CustomReportLayout.Code); end; +#endif local procedure InsertCustomReportSelectionVendor(var CustomReportSelection: Record "Custom Report Selection"; Vendor: Record "Vendor"; ReportID: Integer; UseForEmailAttachment: Boolean; UseForEmailBody: Boolean; SendToAddress: Text[200]; ReportUsage: Enum "Report Selection Usage"); begin @@ -1196,11 +1198,15 @@ codeunit 144055 "SMTPEMail Custom Report Layout" CustomReportSelection.Validate(Sequence, CustomReportSelection.COUNT + 1); CustomReportSelection.Validate("Report ID", ReportID); CustomReportSelection.Validate("Use For Email Attachment", UseForEmailAttachment); +#if not CLEAN29 if CustomReportSelection."Use For Email Attachment" then CustomReportSelection.Validate("Custom Report Layout Code", GetBuiltInLayoutCode(ReportID)); +#endif CustomReportSelection.Validate("Use For Email Body", UseForEmailBody); +#if not CLEAN29 if CustomReportSelection."Use For Email Body" then CustomReportSelection.Validate("Email Body Layout Code", GetBuiltInLayoutCode(ReportID)); +#endif CustomReportSelection.Validate("Send To Email", SendToAddress); CustomReportSelection.Insert(true); end; @@ -1219,11 +1225,15 @@ codeunit 144055 "SMTPEMail Custom Report Layout" CustomReportSelection.Validate(Sequence, CustomReportSelection.COUNT + 1); CustomReportSelection.Validate("Report ID", ReportID); CustomReportSelection.Validate("Use For Email Attachment", UseForEmailAttachment); +#if not CLEAN29 if CustomReportSelection."Use For Email Attachment" then CustomReportSelection.Validate("Custom Report Layout Code", GetBuiltInLayoutCode(ReportID)); +#endif CustomReportSelection.Validate("Use For Email Body", UseForEmailBody); +#if not CLEAN29 if CustomReportSelection."Use For Email Body" then CustomReportSelection.Validate("Email Body Layout Code", GetBuiltInLayoutCode(ReportID)); +#endif CustomReportSelection.Validate("Send To Email", SendToAddress); CustomReportSelection.Insert(true); end; @@ -1238,11 +1248,15 @@ codeunit 144055 "SMTPEMail Custom Report Layout" ReportSelections.Validate(Sequence, '1'); ReportSelections.Validate("Report ID", ReportID); ReportSelections.Validate("Use For Email Attachment", UseForEmailAttachment); +#if not CLEAN29 if ReportSelections."Use For Email Attachment" then ReportSelections.Validate("Custom Report Layout Code", GetBuiltInLayoutCode(ReportID)); +#endif ReportSelections.Validate("Use For Email Body", UseForEmailBody); +#if not CLEAN29 if ReportSelections."Use For Email Body" then ReportSelections.Validate("Email Body Layout Code", GetBuiltInLayoutCode(ReportID)); +#endif ReportSelections.Insert(true); end; diff --git a/src/Layers/W1/BaseApp/CRM/Interaction/Attachment.Table.al b/src/Layers/W1/BaseApp/CRM/Interaction/Attachment.Table.al index 5775473a55a..9f735d7be54 100644 --- a/src/Layers/W1/BaseApp/CRM/Interaction/Attachment.Table.al +++ b/src/Layers/W1/BaseApp/CRM/Interaction/Attachment.Table.al @@ -7,7 +7,6 @@ namespace Microsoft.CRM.Interaction; using Microsoft.CRM.Segment; using Microsoft.CRM.Setup; using Microsoft.Foundation.NoSeries; -using Microsoft.Foundation.Reporting; using System.Environment; using System.IO; using System.Utilities; @@ -774,9 +773,9 @@ table 5062 Attachment local procedure GetCustomLayoutCodeLength(): Integer var - DummyCustomReportLayout: Record "Custom Report Layout"; + CustomLayoutCode: Code[20]; begin - exit(MaxStrLen(DummyCustomReportLayout.Code)); + exit(MaxStrLen(CustomLayoutCode)); end; local procedure ProcessWebAttachment(FileName: Text) diff --git a/src/Layers/W1/BaseApp/CRM/Interaction/InteractTmplLanguages.Page.al b/src/Layers/W1/BaseApp/CRM/Interaction/InteractTmplLanguages.Page.al index 79408c217c2..5ba02c90408 100644 --- a/src/Layers/W1/BaseApp/CRM/Interaction/InteractTmplLanguages.Page.al +++ b/src/Layers/W1/BaseApp/CRM/Interaction/InteractTmplLanguages.Page.al @@ -4,8 +4,11 @@ // ------------------------------------------------------------------------------------------------ namespace Microsoft.CRM.Interaction; +#if not CLEAN29 using Microsoft.Foundation.Reporting; +#endif +#pragma warning disable AS0032 page 5154 "Interact. Tmpl. Languages" { Caption = 'Interact. Tmpl. Languages'; @@ -62,6 +65,7 @@ page 5154 "Interact. Tmpl. Languages" UpdateAttachments(Rec."Custom Layout Code"); end; } +#if not CLEAN29 field(CustLayoutDescription; CustomReportLayoutDescription) { ApplicationArea = RelationshipMgmt; @@ -72,7 +76,9 @@ page 5154 "Interact. Tmpl. Languages" #if not CLEAN28 trigger OnLookup(var Text: Text): Boolean var +#pragma warning disable AL0432 CustomReportLayout: Record "Custom Report Layout"; +#pragma warning restore AL0432 begin #pragma warning disable AL0432 if CustomReportLayout.LookupLayoutOK(REPORT::"Email Merge") then begin @@ -88,7 +94,9 @@ page 5154 "Interact. Tmpl. Languages" trigger OnValidate() var +#pragma warning disable AL0432, AS0105 CustomReportLayout: Record "Custom Report Layout"; +#pragma warning restore AL0432, AS0105 begin if CustomReportLayoutDescription = '' then begin Rec.Validate("Custom Layout Code", ''); @@ -106,6 +114,7 @@ page 5154 "Interact. Tmpl. Languages" UpdateAttachments(Rec."Custom Layout Code"); end; } +#endif field(ReportLayoutName; Rec."Report Layout Name") { ApplicationArea = All; @@ -231,31 +240,47 @@ page 5154 "Interact. Tmpl. Languages" trigger OnAfterGetCurrRecord() begin +#if not CLEAN29 +#pragma warning disable AL0432 Rec.CalcFields("Custom Layout Description"); CustomReportLayoutDescription := Rec."Custom Layout Description"; +#pragma warning restore AL0432 +#endif end; trigger OnAfterGetRecord() begin +#if not CLEAN29 +#pragma warning disable AL0432 Rec.CalcFields("Custom Layout Description"); CustomReportLayoutDescription := Rec."Custom Layout Description"; +#pragma warning restore AL0432 +#endif end; trigger OnOpenPage() +#if not CLEAN29 var +#pragma warning disable AL0432, AS0105 CustomReportLayout: Record "Custom Report Layout"; +#pragma warning restore AL0432, AS0105 +#endif begin +#if not CLEAN29 CustLayoutVisible := CustomReportLayout.ReadPermission; if CustLayoutVisible then begin CustomReportLayout.SetRange("Report ID", Report::"Email Merge"); CustLayoutVisible := not CustomReportLayout.IsEmpty(); end; +#endif end; var +#if not CLEAN29 CustomReportLayoutDescription: Text; CustLayoutVisible: Boolean; CouldNotFindCustomReportLayoutErr: Label 'There is no Custom Report Layout with %1 in the description.', Comment = '%1 Description of Custom Report Layout'; +#endif local procedure UpdateAttachments(NewCustomLayoutCode: Code[20]) begin @@ -265,7 +290,11 @@ page 5154 "Interact. Tmpl. Languages" if xRec."Custom Layout Code" <> '' then Rec.RemoveAttachment(false); +#if not CLEAN29 +#pragma warning disable AL0432 Rec.CalcFields("Custom Layout Description"); +#pragma warning restore AL0432 +#endif CurrPage.Update(); end; @@ -280,4 +309,5 @@ page 5154 "Interact. Tmpl. Languages" CurrPage.Update(); end; } +#pragma warning restore AS0032 diff --git a/src/Layers/W1/BaseApp/CRM/Interaction/InteractionTmplLanguage.Table.al b/src/Layers/W1/BaseApp/CRM/Interaction/InteractionTmplLanguage.Table.al index 68ef6c25ed3..57640aeb9c6 100644 --- a/src/Layers/W1/BaseApp/CRM/Interaction/InteractionTmplLanguage.Table.al +++ b/src/Layers/W1/BaseApp/CRM/Interaction/InteractionTmplLanguage.Table.al @@ -47,22 +47,37 @@ table 5103 "Interaction Tmpl. Language" { Caption = 'Custom Layout Code'; ToolTip = 'Specifies the number of the report layout.'; +#if not CLEAN29 +#pragma warning disable AL0432, AS0105 TableRelation = "Custom Report Layout" where("Report ID" = const(Report::"Email Merge")); +#pragma warning restore AL0432, AS0105 +#endif trigger OnValidate() begin if Rec."Custom Layout Code" <> '' then Rec.Validate("Report Layout Name", ''); +#if not CLEAN29 +#pragma warning disable AL0432 CalcFields("Custom Layout Description"); +#pragma warning restore AL0432 +#endif end; } +#if not CLEAN29 field(6; "Custom Layout Description"; Text[250]) { +#pragma warning disable AL0432 CalcFormula = lookup("Custom Report Layout".Description where(Code = field("Custom Layout Code"))); +#pragma warning restore AL0432 Caption = 'Custom Layout Description'; Editable = false; FieldClass = FlowField; + ObsoleteState = Pending; + ObsoleteReason = 'Replaced by the system report layout system ("Tenant Report Layout"). This field will be removed in a future version.'; + ObsoleteTag = '29.0'; } +#endif field(7; "Word Template Code"; Code[30]) { ToolTip = 'Specifies the Word template to use when you create communications for an interaction. The Word template will create either a document or be used as the body text in an email.'; diff --git a/src/Layers/W1/BaseApp/CopyCompany.Report.al b/src/Layers/W1/BaseApp/CopyCompany.Report.al index 9ac722501cc..26735b45b4c 100644 --- a/src/Layers/W1/BaseApp/CopyCompany.Report.al +++ b/src/Layers/W1/BaseApp/CopyCompany.Report.al @@ -53,11 +53,15 @@ report 357 "Copy Company" if ReportLayoutSelection.Insert() then; end; } +#if not CLEAN29 +#pragma warning disable AL0432, AS0105 dataitem("Custom Report Layout"; "Custom Report Layout") +#pragma warning restore AL0432, AS0105 { DataItemLink = "Company Name" = field(Name); DataItemTableView = sorting("Report ID", "Company Name", Type); +#pragma warning disable AL0432, AS0105 trigger OnAfterGetRecord() var CustomReportLayout: Record "Custom Report Layout"; @@ -67,7 +71,9 @@ report 357 "Copy Company" CustomReportLayout."Company Name" := NewCompanyName; if CustomReportLayout.Insert(true) then; end; +#pragma warning restore AL0432, AS0105 } +#endif dataitem("Feature Data Update Status"; "Feature Data Update Status") { DataItemLink = "Company Name" = field(Name); diff --git a/src/Layers/W1/BaseApp/FeatureReportSelection.codeunit.al b/src/Layers/W1/BaseApp/FeatureReportSelection.codeunit.al index f9aa79731ce..ceeececa3fa 100644 --- a/src/Layers/W1/BaseApp/FeatureReportSelection.codeunit.al +++ b/src/Layers/W1/BaseApp/FeatureReportSelection.codeunit.al @@ -1,3 +1,5 @@ +#pragma warning disable AS0018, AS0088 +#if not CLEAN29 // ------------------------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. @@ -10,6 +12,9 @@ using System.Reflection; codeunit 5409 "Feature - Report Selection" implements "Feature Data Update" { + ObsoleteState = Pending; + ObsoleteReason = 'Migrates layouts out of the Custom Report Layout table, which is replaced by the system tables Tenant Report Layout and Report Layout Selection.'; + ObsoleteTag = '29.0'; Permissions = TableData "Feature Data Update Status" = rm; TableNo = "Tenant Report Layout"; @@ -48,7 +53,9 @@ codeunit 5409 "Feature - Report Selection" implements "Feature Data Update" procedure UpdateData(FeatureDataUpdateStatus: Record "Feature Data Update Status") var +#pragma warning disable AL0432, AS0105 CustomReportLayout: Record "Custom Report Layout"; +#pragma warning restore AL0432, AS0105 StartDateTime: DateTime; begin StartDateTime := CurrentDateTime; @@ -63,7 +70,9 @@ codeunit 5409 "Feature - Report Selection" implements "Feature Data Update" local procedure CountRecords() var +#pragma warning disable AL0432, AS0105 CustomReportLayout: Record "Custom Report Layout"; +#pragma warning restore AL0432, AS0105 TenantReportLayout: Record "Tenant Report Layout"; NoOfNonUpdatedLayouts: Integer; NullGuid: Guid; @@ -77,17 +86,25 @@ codeunit 5409 "Feature - Report Selection" implements "Feature Data Update" NoOfNonUpdatedLayouts += 1; until CustomReportLayout.Next() = 0; if NoOfNonUpdatedLayouts > 0 then +#if not CLEAN29 +#pragma warning disable AL0432, AS0105 InsertDocumentEntry(Database::"Custom Report Layout", CustomReportLayout.TableCaption(), NoOfNonUpdatedLayouts); +#pragma warning restore AL0432, AS0105 +#endif end; procedure MigrateCustomReportLayouts() var +#pragma warning disable AL0432, AS0105 NonFilteredCustomReportLayout: Record "Custom Report Layout"; +#pragma warning restore AL0432, AS0105 begin MigrateCustomReportLayouts(NonFilteredCustomReportLayout); end; +#pragma warning disable AL0432, AS0105 procedure MigrateCustomReportLayouts(var CustomReportLayout: Record "Custom Report Layout") +#pragma warning restore AL0432, AS0105 var TenantReportLayout: Record "Tenant Report Layout"; ReportLayoutSelection: Record "Report Layout Selection"; @@ -157,3 +174,5 @@ codeunit 5409 "Feature - Report Selection" implements "Feature Data Update" TempDocumentEntry.Insert(); end; } +#endif +#pragma warning restore AS0018, AS0088 diff --git a/src/Layers/W1/BaseApp/Foundation/Company/CompanyInitialize.Codeunit.al b/src/Layers/W1/BaseApp/Foundation/Company/CompanyInitialize.Codeunit.al index a513eb3dc39..67feddb4d31 100644 --- a/src/Layers/W1/BaseApp/Foundation/Company/CompanyInitialize.Codeunit.al +++ b/src/Layers/W1/BaseApp/Foundation/Company/CompanyInitialize.Codeunit.al @@ -753,7 +753,11 @@ codeunit 2 "Company-Initialize" var AssistedCompanySetupStatus: Record "Assisted Company Setup Status"; ApplicationAreaSetup: Record "Application Area Setup"; +#if not CLEAN29 +#pragma warning disable AL0432, AS0105 CustomReportLayout: Record "Custom Report Layout"; +#pragma warning restore AL0432, AS0105 +#endif ReportLayoutSelection: Record "Report Layout Selection"; ExperienceTierSetup: Record "Experience Tier Setup"; begin @@ -764,8 +768,10 @@ codeunit 2 "Company-Initialize" AssistedCompanySetupStatus.DeleteAll(); ApplicationAreaSetup.SetRange("Company Name", Rec.Name); ApplicationAreaSetup.DeleteAll(); +#if not CLEAN29 CustomReportLayout.SetRange("Company Name", Rec.Name); CustomReportLayout.DeleteAll(); +#endif ReportLayoutSelection.SetRange("Company Name", Rec.Name); ReportLayoutSelection.DeleteAll(); diff --git a/src/Layers/W1/BaseApp/Foundation/Reporting/CustomLayoutReporting.Codeunit.al b/src/Layers/W1/BaseApp/Foundation/Reporting/CustomLayoutReporting.Codeunit.al index 6961bd30a78..031225dce99 100644 --- a/src/Layers/W1/BaseApp/Foundation/Reporting/CustomLayoutReporting.Codeunit.al +++ b/src/Layers/W1/BaseApp/Foundation/Reporting/CustomLayoutReporting.Codeunit.al @@ -1029,11 +1029,18 @@ codeunit 8800 "Custom Layout Reporting" exit(CustomLayoutReporting.CallReportSaveAs(ReportID, RequestParameterText, ReportFormatValue, FileStream, RecRef)) end; +#pragma warning disable AA0137 local procedure IsWordLayout(ReportID: Integer; CustomReportLayoutCode: Code[20]): Boolean +#pragma warning restore AA0137 var +#if not CLEAN29 +#pragma warning disable AL0432, AS0105 CustomReportLayout: Record "Custom Report Layout"; +#pragma warning restore AL0432, AS0105 +#endif ReportManagementHelper: Codeunit "Report Management Helper"; begin +#if not CLEAN29 if CustomReportLayoutCode <> '' then begin CustomReportLayout.Code := CustomReportLayoutCode; if CustomReportLayout.Find('=') then @@ -1041,6 +1048,7 @@ codeunit 8800 "Custom Layout Reporting" exit(ReportManagementHelper.SelectedLayoutType(ReportID) = ReportLayoutType::Word); end; +#endif exit(ReportManagementHelper.SelectedLayoutType(ReportID) = ReportLayoutType::Word); end; diff --git a/src/Layers/W1/BaseApp/Foundation/Reporting/CustomReportLayout.Table.al b/src/Layers/W1/BaseApp/Foundation/Reporting/CustomReportLayout.Table.al index 854be6e470b..0e8aa184a7b 100644 --- a/src/Layers/W1/BaseApp/Foundation/Reporting/CustomReportLayout.Table.al +++ b/src/Layers/W1/BaseApp/Foundation/Reporting/CustomReportLayout.Table.al @@ -11,10 +11,18 @@ using System.Reflection; using System.Security.AccessControl; using System.Utilities; +#pragma warning disable AS0105 table 9650 "Custom Report Layout" { Caption = 'Custom Report Layout'; DataPerCompany = false; + ObsoleteReason = 'Replaced by system tables "Tenant Report Layout" and "Report Layout Selection". This table will be removed in a future version.'; +#if not CLEAN29 + ObsoleteState = Pending; +#else + ObsoleteState = Removed; +#endif + ObsoleteTag = '29.0'; #if not CLEAN28 #pragma warning disable AL0432 DrillDownPageID = "Custom Report Layouts"; @@ -1105,3 +1113,4 @@ table 9650 "Custom Report Layout" end; #endif } +#pragma warning restore AS0105 diff --git a/src/Layers/W1/BaseApp/Foundation/Reporting/CustomReportLayouts.Page.al b/src/Layers/W1/BaseApp/Foundation/Reporting/CustomReportLayouts.Page.al index 27edaa8021c..4aba4d000f8 100644 --- a/src/Layers/W1/BaseApp/Foundation/Reporting/CustomReportLayouts.Page.al +++ b/src/Layers/W1/BaseApp/Foundation/Reporting/CustomReportLayouts.Page.al @@ -19,7 +19,9 @@ page 9650 "Custom Report Layouts" Caption = 'Custom Report Layouts'; InsertAllowed = false; PageType = List; +#pragma warning disable AL0432 SourceTable = "Custom Report Layout"; +#pragma warning restore AL0432 SourceTableView = sorting("Report ID", "Company Name", Type); UsageCategory = Administration; AboutTitle = 'About Custom Report Layouts'; @@ -270,8 +272,10 @@ page 9650 "Custom Report Layouts" trigger OnAction() var +#pragma warning disable AL0432 CustomReportLayout: Record "Custom Report Layout"; FeatureReportSelection: Codeunit "Feature - Report Selection"; +#pragma warning restore AL0432 begin CustomReportLayout.Copy(Rec); CurrPage.SetSelectionFilter(CustomReportLayout); @@ -357,7 +361,9 @@ page 9650 "Custom Report Layouts" trigger OnAfterGetCurrRecord() var +#pragma warning disable AL0432 CustomReportLayout: Record "Custom Report Layout"; +#pragma warning restore AL0432 ReportLayoutSelection: Record "Report Layout Selection"; DocumentSharing: Codeunit "Document Sharing"; begin diff --git a/src/Layers/W1/BaseApp/Foundation/Reporting/CustomReportSelection.Table.al b/src/Layers/W1/BaseApp/Foundation/Reporting/CustomReportSelection.Table.al index 41186a20f5c..565d2d27547 100644 --- a/src/Layers/W1/BaseApp/Foundation/Reporting/CustomReportSelection.Table.al +++ b/src/Layers/W1/BaseApp/Foundation/Reporting/CustomReportSelection.Table.al @@ -68,20 +68,35 @@ table 9657 "Custom Report Selection" field(7; "Custom Report Layout Code"; Code[20]) { Caption = 'Custom Report Layout Code'; +#if not CLEAN29 +#pragma warning disable AL0432, AS0105 TableRelation = "Custom Report Layout" where(Code = field("Custom Report Layout Code")); +#pragma warning restore AL0432, AS0105 +#endif trigger OnValidate() begin +#if not CLEAN29 +#pragma warning disable AL0432 CalcFields("Custom Report Description"); +#pragma warning restore AL0432 +#endif end; } +#if not CLEAN29 field(8; "Custom Report Description"; Text[250]) { +#pragma warning disable AL0432 CalcFormula = lookup("Custom Report Layout".Description where(Code = field("Custom Report Layout Code"))); +#pragma warning restore AL0432 Caption = 'Custom Report Description'; FieldClass = FlowField; + ObsoleteState = Pending; + ObsoleteReason = 'Replaced by the system report layout system ("Tenant Report Layout"). This field will be removed in a future version.'; + ObsoleteTag = '29.0'; ToolTip = 'Specifies a description of the custom report layout.'; } +#endif field(9; "Send To Email"; Text[200]) { Caption = 'Send To Email'; @@ -131,25 +146,40 @@ table 9657 "Custom Report Selection" field(21; "Email Body Layout Code"; Code[20]) { Caption = 'Email Body Layout Code'; +#if not CLEAN29 +#pragma warning disable AL0432, AS0105 TableRelation = "Custom Report Layout" where(Code = field("Email Body Layout Code"), "Report ID" = field("Report ID")); +#pragma warning restore AL0432, AS0105 +#endif ToolTip = 'Specifies the ID of the email body layout that is used.'; trigger OnValidate() begin if "Email Body Layout Code" <> '' then TestField("Use for Email Body", true); +#if not CLEAN29 +#pragma warning disable AL0432 CalcFields("Email Body Layout Description"); +#pragma warning restore AL0432 +#endif end; } +#if not CLEAN29 field(22; "Email Body Layout Description"; Text[250]) { +#pragma warning disable AL0432 CalcFormula = lookup("Custom Report Layout".Description where(Code = field("Email Body Layout Code"))); +#pragma warning restore AL0432 Caption = 'Email Body Layout Description'; Editable = false; FieldClass = FlowField; + ObsoleteState = Pending; + ObsoleteReason = 'Replaced by the system report layout system ("Tenant Report Layout"). This field will be removed in a future version.'; + ObsoleteTag = '29.0'; ToolTip = 'Specifies a description of the custom email body layout that is used.'; } +#endif field(23; "Use Email from Contact"; Boolean) { Caption = 'Use Email from Contacts'; @@ -258,7 +288,9 @@ table 9657 "Custom Report Selection" local procedure LookupCustomReportLayout(CurrentLayoutCode: Code[20]): Code[20] #if not CLEAN28 var +#pragma warning disable AL0432 CustomReportLayout: Record "Custom Report Layout"; +#pragma warning restore AL0432 #endif begin #if not CLEAN28 diff --git a/src/Layers/W1/BaseApp/Foundation/Reporting/DocumentReportMgt.Codeunit.al b/src/Layers/W1/BaseApp/Foundation/Reporting/DocumentReportMgt.Codeunit.al index 93fefa40123..3956ecc02c5 100644 --- a/src/Layers/W1/BaseApp/Foundation/Reporting/DocumentReportMgt.Codeunit.al +++ b/src/Layers/W1/BaseApp/Foundation/Reporting/DocumentReportMgt.Codeunit.al @@ -5,7 +5,9 @@ namespace Microsoft.Foundation.Reporting; using System; +#if not CLEAN29 using System.Environment; +#endif using System.Reflection; using System.Utilities; using System.Xml; @@ -18,8 +20,10 @@ codeunit 9651 "Document Report Mgt." end; var +#if not CLEAN29 ClientTypeMgt: Codeunit "Client Type Management"; +#endif UpgradeNotSupportedErr: Label 'Upgrade is not supported after version 20.'; #pragma warning disable AA0470 TemplateValidationQst: Label 'The Word layout does not comply with the current report design (for example, fields are missing or the report ID is wrong).\The following errors were detected during the layout validation:\%1\Do you want to continue?'; @@ -28,9 +32,13 @@ codeunit 9651 "Document Report Mgt." AbortWithValidationErr: Label 'The Word layout action has been canceled because of validation errors.'; #pragma warning disable AA0470 TemplateAfterUpdateValidationErr: Label 'The automatic update could not resolve all the conflicts in the current Word layout. For example, the layout uses fields that are missing in the report design or the report ID is wrong.\The following errors were detected:\%1\You must manually update the layout to match the current report design.'; +#if not CLEAN29 UpgradeMessageMsg: Label 'The report upgrade process returned the following log messages:\%1.'; +#endif #pragma warning restore AA0470 +#if not CLEAN29 NoReportLayoutUpgradeRequiredMsg: Label 'The layout upgrade process completed without detecting any required changes in the current application.'; +#endif CompanyInformationPicErr: Label 'The document contains elements that cannot be converted to PDF. This may be caused by missing image data in the document.'; procedure ValidateWordLayout(ReportID: Integer; DocumentStream: InStream; useConfirm: Boolean; updateContext: Boolean): Boolean @@ -154,10 +162,14 @@ codeunit 9651 "Document Report Mgt." exit(XmlHasDataset); end; +#if not CLEAN29 [Scope('OnPrem')] + [Obsolete('Upgrades layouts stored in the Custom Report Layout table, which is replaced by the system tables Tenant Report Layout and Report Layout Selection.', '29.0')] procedure ApplyUpgradeToReports(var ReportUpgradeCollection: DotNet ReportUpgradeCollection; testOnly: Boolean): Boolean var +#pragma warning disable AL0432, AS0105 CustomReportLayout: Record "Custom Report Layout"; +#pragma warning restore AL0432, AS0105 ReportUpgrade: DotNet ReportUpgradeSet; ReportChangeLogCollection: DotNet IReportChangeLogCollection; begin @@ -196,6 +208,7 @@ codeunit 9651 "Document Report Mgt." else Message(UpgradeMessageMsg, Format(ReportChangeLogCollection)); end; +#endif [Scope('OnPrem')] procedure BulkUpgrade(testMode: Boolean) diff --git a/src/Layers/W1/BaseApp/Foundation/Reporting/ReportLayoutSelection.Page.al b/src/Layers/W1/BaseApp/Foundation/Reporting/ReportLayoutSelection.Page.al index 17e29d82fd7..4bb9d4b51e5 100644 --- a/src/Layers/W1/BaseApp/Foundation/Reporting/ReportLayoutSelection.Page.al +++ b/src/Layers/W1/BaseApp/Foundation/Reporting/ReportLayoutSelection.Page.al @@ -8,6 +8,7 @@ using System.Environment; using System.Environment.Configuration; using System.Reflection; +#pragma warning disable AS0032 page 9652 "Report Layout Selection" { AdditionalSearchTerms = 'customization,document layout'; @@ -70,7 +71,11 @@ page 9652 "Report Layout Selection" field("Custom Report Layout Code"; Rec."Custom Report Layout Code") { ApplicationArea = Basic, Suite; +#if not CLEAN29 +#pragma warning disable AL0432, AS0105 TableRelation = "Custom Report Layout" where("Report ID" = field("Report ID")); +#pragma warning restore AL0432, AS0105 +#endif Visible = false; trigger OnValidate() @@ -88,9 +93,14 @@ page 9652 "Report Layout Selection" ToolTip = 'Specifies the description of the layout that is used by the report.'; trigger OnValidate() +#if not CLEAN29 var +#pragma warning disable AL0432, AS0105 CustomReportLayout2: Record "Custom Report Layout"; +#pragma warning restore AL0432, AS0105 +#endif begin +#if not CLEAN29 if Rec.Type = Rec.Type::"Custom Layout" then begin CustomReportLayout2.SetCurrentKey("Report ID", "Company Name", Type); CustomReportLayout2.SetRange("Report ID", ReportLayoutSelection."Report ID"); @@ -105,7 +115,9 @@ page 9652 "Report Layout Selection" end; end else ValidateBuiltInReportLayoutDescription(); - +#else + ValidateBuiltInReportLayoutDescription(); +#endif CurrPage.Update(false); end; } @@ -113,6 +125,8 @@ page 9652 "Report Layout Selection" } area(factboxes) { +#if not CLEAN29 +#pragma warning disable AL0432 part("Custom Layouts"; "Report Layouts Part") { ApplicationArea = Basic, Suite; @@ -121,6 +135,8 @@ page 9652 "Report Layout Selection" SubPageLink = "Report ID" = field("Report ID"); UpdatePropagation = Both; } +#pragma warning restore AL0432 +#endif } } @@ -300,7 +316,9 @@ page 9652 "Report Layout Selection" CustomLayoutDescription: Text; IsInitialized: Boolean; DocumentReportExperienceEnabled: Boolean; +#if not CLEAN29 CouldNotFindCustomReportLayoutErr: Label 'There is no custom report layout with %1 in the description.', Comment = '%1 Description of custom report layout'; +#endif CouldNotFindBuiltInReportLayoutErr: Label 'There is no built-in report layout with %1 in the description.', Comment = '%1 Description of custom report layout'; ShowLayoutPartsMsg: Label 'Header/Footer Part: %1\Theme Part: %2', Comment = '%1 = resolved header/footer part, %2 = resolved theme part'; PartWithSourceTxt: Label '%1 (from %2)', Comment = '%1 = part name, %2 = where the part is resolved from'; @@ -349,6 +367,7 @@ page 9652 "Report Layout Selection" Rec.Type := ReportLayoutSelection.Type; Rec."Custom Report Layout Code" := ReportLayoutSelection."Custom Report Layout Code"; +#if not CLEAN29 case Rec.Type of Rec.Type::"Custom Layout": Rec.CalcFields("Report Layout Description"); @@ -363,6 +382,15 @@ page 9652 "Report Layout Selection" end; CustomLayoutDescription := Rec."Report Layout Description"; +#else + if TenantReportLayoutSelection.Get(Rec."Report ID", SelectedCompany) then + CustomLayoutDescription := TenantReportLayoutSelection."Layout Name" + else + if ReportMetadata.Get(Rec."Report ID") then + CustomLayoutDescription := ReportMetadata.DefaultLayoutName + else + CustomLayoutDescription := DefaultLbl; +#endif end; local procedure LookupLayout() @@ -441,7 +469,9 @@ page 9652 "Report Layout Selection" local procedure SetDefaultSelectionFromReportLayoutList(var ReportLayoutList: Record "Report Layout List"; LayoutName: Text[250]) begin Rec.Validate(Type, LayoutFormatToType(ReportLayoutList."Layout Format")); +#if not CLEAN29 Rec."Report Layout Description" := LayoutName; +#endif CustomLayoutDescription := LayoutName; end; @@ -485,7 +515,9 @@ page 9652 "Report Layout Selection" #if not CLEAN28 local procedure SelectReportLayout(): Boolean var +#pragma warning disable AL0432 CustomReportLayout: Record "Custom Report Layout"; +#pragma warning restore AL0432 OK: Boolean; begin CustomReportLayout.FilterGroup(4); @@ -599,4 +631,5 @@ page 9652 "Report Layout Selection" begin end; } +#pragma warning restore AS0032 diff --git a/src/Layers/W1/BaseApp/Foundation/Reporting/ReportLayoutSelection.Table.al b/src/Layers/W1/BaseApp/Foundation/Reporting/ReportLayoutSelection.Table.al index eca422ff988..610f32ab804 100644 --- a/src/Layers/W1/BaseApp/Foundation/Reporting/ReportLayoutSelection.Table.al +++ b/src/Layers/W1/BaseApp/Foundation/Reporting/ReportLayoutSelection.Table.al @@ -75,7 +75,11 @@ table 9651 "Report Layout Selection" { Caption = 'Custom Report Layout Code'; ToolTip = 'Specifies the custom report layout.'; +#if not CLEAN29 +#pragma warning disable AL0432, AS0105 TableRelation = "Custom Report Layout" where("Report ID" = field("Report ID")); +#pragma warning restore AL0432, AS0105 +#endif trigger OnValidate() begin @@ -85,12 +89,19 @@ table 9651 "Report Layout Selection" Type := Type::"Custom Layout"; end; } +#if not CLEAN29 field(7; "Report Layout Description"; Text[250]) { +#pragma warning disable AL0432, AS0105 CalcFormula = lookup("Custom Report Layout".Description where(Code = field("Custom Report Layout Code"))); +#pragma warning restore AL0432, AS0105 Caption = 'Report Layout Description'; FieldClass = FlowField; + ObsoleteState = Pending; + ObsoleteReason = 'Replaced by the system report layout system ("Tenant Report Layout"). This field will be removed in a future version.'; + ObsoleteTag = '29.0'; } +#endif field(8; "Report Caption"; Text[80]) { CalcFormula = lookup("Report Metadata".Caption where(ID = field("Report ID"))); diff --git a/src/Layers/W1/BaseApp/Foundation/Reporting/ReportLayoutUpdateLog.Page.al b/src/Layers/W1/BaseApp/Foundation/Reporting/ReportLayoutUpdateLog.Page.al index 7fc16640ebb..9ebcc761c1e 100644 --- a/src/Layers/W1/BaseApp/Foundation/Reporting/ReportLayoutUpdateLog.Page.al +++ b/src/Layers/W1/BaseApp/Foundation/Reporting/ReportLayoutUpdateLog.Page.al @@ -69,7 +69,9 @@ page 9656 "Report Layout Update Log" trigger OnAction() var +#pragma warning disable AL0432 CustomReportLayout: Record "Custom Report Layout"; +#pragma warning restore AL0432 begin CustomReportLayout.SetFilter("Report ID", Format(Rec."Report ID")); CustomReportLayout.SetFilter(Description, Rec."Layout Description"); diff --git a/src/Layers/W1/BaseApp/Foundation/Reporting/ReportLayoutsPart.Page.al b/src/Layers/W1/BaseApp/Foundation/Reporting/ReportLayoutsPart.Page.al index b0d9327711a..cdf24d510a2 100644 --- a/src/Layers/W1/BaseApp/Foundation/Reporting/ReportLayoutsPart.Page.al +++ b/src/Layers/W1/BaseApp/Foundation/Reporting/ReportLayoutsPart.Page.al @@ -1,4 +1,5 @@ -// ------------------------------------------------------------------------------------------------ +#if not CLEAN29 +// ------------------------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // ------------------------------------------------------------------------------------------------ @@ -9,7 +10,12 @@ page 9653 "Report Layouts Part" Caption = 'Report Layouts Part'; Editable = false; PageType = ListPart; + ObsoleteState = Pending; + ObsoleteReason = 'Replaced by the system "Report Layouts" page. This page will be removed in a future version.'; + ObsoleteTag = '29.0'; +#pragma warning disable AL0432 SourceTable = "Custom Report Layout"; +#pragma warning restore AL0432 SourceTableView = sorting("Report ID", "Company Name", Type); layout @@ -39,4 +45,5 @@ page 9653 "Report Layouts Part" { } } +#endif diff --git a/src/Layers/W1/BaseApp/Foundation/Reporting/ReportManagement.Codeunit.al b/src/Layers/W1/BaseApp/Foundation/Reporting/ReportManagement.Codeunit.al index 81a4462b166..ef926392a4a 100644 --- a/src/Layers/W1/BaseApp/Foundation/Reporting/ReportManagement.Codeunit.al +++ b/src/Layers/W1/BaseApp/Foundation/Reporting/ReportManagement.Codeunit.al @@ -7,10 +7,14 @@ namespace Microsoft.Foundation.Reporting; using Microsoft.Foundation.Company; using System.Device; using System.Environment; +#if not CLEAN29 using System.Environment.Configuration; +#endif using System.Reflection; using System.Text; +#if not CLEAN29 using System.Utilities; +#endif codeunit 44 ReportManagement { @@ -156,14 +160,22 @@ codeunit 44 ReportManagement [EventSubscriber(ObjectType::Codeunit, Codeunit::"Reporting Triggers", 'SelectReportLayoutCode', '', false, false)] local procedure SelectReportLayoutCode(ObjectId: Integer; var LayoutCode: Text; var LayoutType: Option "None",RDLC,Word,Excel,Custom; var Success: Boolean) var +#if not CLEAN29 +#pragma warning disable AL0432, AS0105 CustomReportLayout: Record "Custom Report Layout"; +#pragma warning restore AL0432, AS0105 FeatureKey: Record "Feature Key"; +#endif ReportLayoutSelection: Record "Report Layout Selection"; DesignTimeReportSelection: Codeunit "Design-time Report Selection"; +#if not CLEAN29 AppLayoutType: Enum "Custom Report Layout Type"; +#endif SelectedLayoutName: Text[250]; SelectedAppID: Guid; +#if not CLEAN29 PlatformRenderingInPlatformTxt: Label 'RenderWordReportsInPlatform', Locked = true; +#endif begin OnSelectReportLayoutCode(ObjectId, LayoutCode, LayoutType, Success); if Success then @@ -181,6 +193,7 @@ codeunit 44 ReportManagement then SelectedLayoutName := ReportLayoutSelection."Custom Report Layout Code"; +#if not CLEAN29 if (SelectedLayoutName <> '') and (StrLen(SelectedLayoutName) <= MaxStrLen(CustomReportLayout."Code")) then // The code field in Custom Report Layout table can have a maximum size of 20 characters. if CustomReportLayout.Get(SelectedLayoutName.ToUpper()) then begin @@ -203,6 +216,7 @@ codeunit 44 ReportManagement Success := true; exit; end; +#endif if SelectedLayoutName <> '' then begin // A layout code is defined, but not found in application table. The layout type is not known and it's expected that the code refers to a layout in the platform. @@ -220,14 +234,19 @@ codeunit 44 ReportManagement [EventSubscriber(ObjectType::Codeunit, Codeunit::"Reporting Triggers", 'FetchReportLayoutByCode', '', false, false)] local procedure FetchReportLayoutByCode(ObjectId: Integer; LayoutCode: Text; var TargetStream: OutStream; var Success: Boolean) var +#if not CLEAN29 +#pragma warning disable AL0432, AS0105 CustomReportLayout: Record "Custom Report Layout"; +#pragma warning restore AL0432, AS0105 TempBlobIn: codeunit "Temp Blob"; TempInStream: InStream; +#endif begin OnFetchReportLayoutByCode(ObjectId, LayoutCode, TargetStream, Success); if Success then exit; +#if not CLEAN29 if not CustomReportLayout.Get(LayoutCode) then LayoutCode := ''; @@ -237,6 +256,7 @@ codeunit 44 ReportManagement CopyStream(TargetStream, TempInStream); Success := true; end; +#endif end; [EventSubscriber(ObjectType::Codeunit, Codeunit::"Reporting Triggers", 'SelectReportLayoutUI', '', false, false)] diff --git a/src/Layers/W1/BaseApp/Foundation/Reporting/ReportSelections.Table.al b/src/Layers/W1/BaseApp/Foundation/Reporting/ReportSelections.Table.al index a2c8a9f792d..f1a964c57ad 100644 --- a/src/Layers/W1/BaseApp/Foundation/Reporting/ReportSelections.Table.al +++ b/src/Layers/W1/BaseApp/Foundation/Reporting/ReportSelections.Table.al @@ -65,7 +65,11 @@ table 77 "Report Selections" { Caption = 'Custom Report Layout Code'; Editable = false; +#if not CLEAN29 +#pragma warning disable AL0432, AS0105 TableRelation = "Custom Report Layout".Code where(Code = field("Custom Report Layout Code"), "Built-In" = const(false)); +#pragma warning restore AL0432, AS0105 +#endif } field(19; "Use for Email Attachment"; Boolean) { @@ -99,9 +103,15 @@ table 77 "Report Selections" field(21; "Email Body Layout Code"; Code[20]) { Caption = 'Email Body Custom Layout Code'; +#if not CLEAN29 +#pragma warning disable AL0432, AS0105 TableRelation = if ("Email Body Layout Type" = const("Custom Report Layout")) "Custom Report Layout".Code where(Code = field("Email Body Layout Code"), "Report ID" = field("Report ID"), "Built-In" = const(false)) else if ("Email Body Layout Type" = const("HTML Layout")) "O365 HTML Template".Code; +#pragma warning restore AL0432, AS0105 +#else + TableRelation = if ("Email Body Layout Type" = const("HTML Layout")) "O365 HTML Template".Code; +#endif ToolTip = 'Specifies the ID of the custom email body layout that is used.'; trigger OnValidate() @@ -110,21 +120,33 @@ table 77 "Report Selections" Testfield("Use for Email Body", true); "Email Body Layout Name" := ''; end; +#if not CLEAN29 +#pragma warning disable AL0432 Calcfields("Email Body Layout Description"); +#pragma warning restore AL0432 +#endif end; } +#if not CLEAN29 field(22; "Email Body Layout Description"; Text[250]) { +#pragma warning disable AL0432 CalcFormula = lookup("Custom Report Layout".Description where(Code = field("Email Body Layout Code"))); +#pragma warning restore AL0432 Caption = 'Email Body Custom Layout Description'; Editable = false; FieldClass = Flowfield; + ObsoleteState = Pending; + ObsoleteReason = 'Replaced by the system report layout system ("Tenant Report Layout"). This field will be removed in a future version.'; + ObsoleteTag = '29.0'; ToolTip = 'Specifies a description of the custom email body layout that is used.'; #if not CLEAN28 trigger OnLookup() var +#pragma warning disable AL0432 CustomReportLayout: Record "Custom Report Layout"; +#pragma warning restore AL0432 begin if "Email Body Layout Type" = "Email Body Layout Type"::"Custom Report Layout" then #pragma warning disable AL0432 @@ -134,6 +156,7 @@ table 77 "Report Selections" end; #endif } +#endif field(25; "Email Body Layout Type"; Enum "Email Body Layout Type") { Caption = 'Email Body Layout Type'; @@ -166,7 +189,11 @@ table 77 "Report Selections" if "Email Body Layout Name" <> '' then begin "Use for Email Body" := true; "Email Body Layout Code" := ''; +#if not CLEAN29 +#pragma warning disable AL0432 "Email Body Layout Description" := ''; +#pragma warning restore AL0432 +#endif ReportLayoutList.SetRange(Name, "Email Body Layout Name"); ReportLayoutList.SetRange("Report ID", Rec."Report ID"); if not IsNullGuid("Email Body Layout AppID") then @@ -2429,13 +2456,17 @@ table 77 "Report Selections" exit((ReportUsage = "Report Selection Usage"::"V.Remittance".AsInteger()) and (TableId = Database::"Gen. Journal Line")); end; +#if not CLEAN29 internal procedure DoesAnyCustomLayotExist(): Boolean var +#pragma warning disable AL0432, AS0105 CustomReportLayout: Record "Custom Report Layout"; +#pragma warning restore AL0432, AS0105 begin CustomReportLayout.SetRange("Built-In", false); exit(not CustomReportLayout.IsEmpty()); end; +#endif [IntegrationEvent(false, false)] local procedure OnAfterGetCustomReportSelectionForTable(var CustomReportSelection: Record "Custom Report Selection"; TableNo: Integer) diff --git a/src/Layers/W1/BaseApp/OtherCapabilities/Upgrade/UpgradeCustomReportImpl.Codeunit.al b/src/Layers/W1/BaseApp/OtherCapabilities/Upgrade/UpgradeCustomReportImpl.Codeunit.al index 667c6b60ed3..1ec90dacb7d 100644 --- a/src/Layers/W1/BaseApp/OtherCapabilities/Upgrade/UpgradeCustomReportImpl.Codeunit.al +++ b/src/Layers/W1/BaseApp/OtherCapabilities/Upgrade/UpgradeCustomReportImpl.Codeunit.al @@ -1,3 +1,5 @@ +#pragma warning disable AS0088 +#if not CLEAN29 // ------------------------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. @@ -11,6 +13,9 @@ using System.Upgrade; codeunit 104057 "Upgrade Custom Report Impl." { + ObsoleteState = Pending; + ObsoleteReason = 'Upgrades layouts stored in the Custom Report Layout table, which is replaced by the system tables Tenant Report Layout and Report Layout Selection.'; + ObsoleteTag = '29.0'; // to allow test or manual upgrade trigger OnRun() @@ -20,7 +25,9 @@ codeunit 104057 "Upgrade Custom Report Impl." local procedure UpgradeCompany() var +#pragma warning disable AL0432, AS0105 CustomReportLayout: Record "Custom Report Layout"; +#pragma warning restore AL0432, AS0105 ReportLayout: Record "Report Layout"; ReportLayoutList: Record "Report Layout List"; UpgradeTag: Codeunit "Upgrade Tag"; @@ -157,4 +164,6 @@ codeunit 104057 "Upgrade Custom Report Impl." exit(''); end; end; -} \ No newline at end of file +} +#endif +#pragma warning restore AS0088 diff --git a/src/Layers/W1/BaseApp/OtherCapabilities/Upgrade/UpgradeCustomReportLayouts.Codeunit.al b/src/Layers/W1/BaseApp/OtherCapabilities/Upgrade/UpgradeCustomReportLayouts.Codeunit.al index b7e50b65285..55c97290506 100644 --- a/src/Layers/W1/BaseApp/OtherCapabilities/Upgrade/UpgradeCustomReportLayouts.Codeunit.al +++ b/src/Layers/W1/BaseApp/OtherCapabilities/Upgrade/UpgradeCustomReportLayouts.Codeunit.al @@ -1,3 +1,5 @@ +#pragma warning disable AS0088 +#if not CLEAN29 // ------------------------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. @@ -6,10 +8,15 @@ namespace Microsoft.Upgrade; codeunit 104054 "Upgrade Custom Report Layouts" { + ObsoleteState = Pending; + ObsoleteReason = 'Runs the upgrade of layouts stored in the Custom Report Layout table, which is replaced by the system tables Tenant Report Layout and Report Layout Selection.'; + ObsoleteTag = '29.0'; Subtype = Upgrade; trigger OnUpgradePerCompany() begin Codeunit.Run(Codeunit::"Upgrade Custom Report Impl."); end; -} \ No newline at end of file +} +#endif +#pragma warning restore AS0088 diff --git a/src/Layers/W1/BaseApp/Permissions/OnPrem/FoundationUI.PermissionSet.al b/src/Layers/W1/BaseApp/Permissions/OnPrem/FoundationUI.PermissionSet.al index f3f146d58fc..846cad71d39 100644 --- a/src/Layers/W1/BaseApp/Permissions/OnPrem/FoundationUI.PermissionSet.al +++ b/src/Layers/W1/BaseApp/Permissions/OnPrem/FoundationUI.PermissionSet.al @@ -119,7 +119,11 @@ permissionset 6946 "Foundation UI" tabledata "Contact Business Relation" = R, tabledata "Cost Accounting Setup" = Rim, tabledata "CRM Connection Setup" = R, +#if not CLEAN29 +#pragma warning disable AL0432, AS0105 tabledata "Custom Report Layout" = RIMD, +#pragma warning restore AL0432, AS0105 +#endif tabledata "Customer Discount Group" = R, tabledata "Customized Calendar Change" = R, tabledata "Customized Calendar Entry" = R, diff --git a/src/Layers/W1/BaseApp/Permissions/d365automation.permissionset.al b/src/Layers/W1/BaseApp/Permissions/d365automation.permissionset.al index 4c9ce73b87c..9ead1dd778f 100644 --- a/src/Layers/W1/BaseApp/Permissions/d365automation.permissionset.al +++ b/src/Layers/W1/BaseApp/Permissions/d365automation.permissionset.al @@ -644,7 +644,11 @@ permissionset 5117 "D365 AUTOMATION" tabledata "Cust. Ledger Entry" = RiMd, tabledata "Custom Address Format" = RIMD, tabledata "Custom Address Format Line" = RIMD, +#if not CLEAN29 +#pragma warning disable AL0432, AS0105 tabledata "Custom Report Layout" = RIMD, +#pragma warning restore AL0432, AS0105 +#endif tabledata "Custom Report Selection" = RIMD, tabledata Customer = RIMD, tabledata "Customer Amount" = RIMD, diff --git a/src/Layers/W1/BaseApp/Permissions/d365basicedit.permissionset.al b/src/Layers/W1/BaseApp/Permissions/d365basicedit.permissionset.al index 31398c434c0..f73e535b778 100644 --- a/src/Layers/W1/BaseApp/Permissions/d365basicedit.permissionset.al +++ b/src/Layers/W1/BaseApp/Permissions/d365basicedit.permissionset.al @@ -278,7 +278,11 @@ permissionset 208 "D365 Basic - Edit" tabledata "Currency Total Buffer" = imd, tabledata "Custom Address Format" = IMD, tabledata "Custom Address Format Line" = IMD, +#if not CLEAN29 +#pragma warning disable AL0432, AS0105 tabledata "Custom Report Layout" = IMD, +#pragma warning restore AL0432, AS0105 +#endif tabledata "Custom Report Selection" = IMD, tabledata Customer = im, tabledata "Customer Amount" = IMD, diff --git a/src/Layers/W1/BaseApp/Permissions/d365basicisv.permissionset.al b/src/Layers/W1/BaseApp/Permissions/d365basicisv.permissionset.al index 53dfeae3f73..141f040e32d 100644 --- a/src/Layers/W1/BaseApp/Permissions/d365basicisv.permissionset.al +++ b/src/Layers/W1/BaseApp/Permissions/d365basicisv.permissionset.al @@ -401,7 +401,11 @@ permissionset 732 "D365 BASIC ISV" tabledata "Cust. Ledger Entry" = RiMd, tabledata "Custom Address Format" = RIMD, tabledata "Custom Address Format Line" = RIMD, +#if not CLEAN29 +#pragma warning disable AL0432, AS0105 tabledata "Custom Report Layout" = RIMD, +#pragma warning restore AL0432, AS0105 +#endif tabledata "Custom Report Selection" = RIMD, tabledata Customer = RIMD, tabledata "Customer Amount" = RIMD, diff --git a/src/Layers/W1/BaseApp/Permissions/d365basicread.permissionset.al b/src/Layers/W1/BaseApp/Permissions/d365basicread.permissionset.al index 4e500e176dc..28bbe02e7dc 100644 --- a/src/Layers/W1/BaseApp/Permissions/d365basicread.permissionset.al +++ b/src/Layers/W1/BaseApp/Permissions/d365basicread.permissionset.al @@ -361,7 +361,11 @@ permissionset 209 "D365 Basic - Read" tabledata "Currency Total Buffer" = R, tabledata "Custom Address Format" = R, tabledata "Custom Address Format Line" = R, +#if not CLEAN29 +#pragma warning disable AL0432, AS0105 tabledata "Custom Report Layout" = R, +#pragma warning restore AL0432, AS0105 +#endif tabledata "Custom Report Selection" = R, tabledata Customer = R, tabledata "Customer Amount" = R, diff --git a/src/Layers/W1/BaseApp/Permissions/d365busfullaccess.permissionset.al b/src/Layers/W1/BaseApp/Permissions/d365busfullaccess.permissionset.al index c89326f032d..e93390fbf19 100644 --- a/src/Layers/W1/BaseApp/Permissions/d365busfullaccess.permissionset.al +++ b/src/Layers/W1/BaseApp/Permissions/d365busfullaccess.permissionset.al @@ -344,7 +344,11 @@ permissionset 959 "D365 BUS FULL ACCESS" tabledata "Current Salesperson" = RIMD, tabledata "Custom Address Format" = RIMD, tabledata "Custom Address Format Line" = RIMD, +#if not CLEAN29 +#pragma warning disable AL0432, AS0105 tabledata "Custom Report Layout" = RIMD, +#pragma warning restore AL0432, AS0105 +#endif tabledata "Custom Report Selection" = RIMD, tabledata "Customer Amount" = RIMD, tabledata "Customer Sales Buffer" = RIMD, diff --git a/src/Layers/W1/BaseApp/Permissions/d365read.permissionset.al b/src/Layers/W1/BaseApp/Permissions/d365read.permissionset.al index a1a933d659a..db2eeb5dffe 100644 --- a/src/Layers/W1/BaseApp/Permissions/d365read.permissionset.al +++ b/src/Layers/W1/BaseApp/Permissions/d365read.permissionset.al @@ -593,7 +593,11 @@ permissionset 1044 "D365 READ" tabledata "Cust. Ledger Entry" = R, tabledata "Custom Address Format" = R, tabledata "Custom Address Format Line" = R, +#if not CLEAN29 +#pragma warning disable AL0432, AS0105 tabledata "Custom Report Layout" = R, +#pragma warning restore AL0432, AS0105 +#endif tabledata "Custom Report Selection" = R, tabledata Customer = R, tabledata "Customer Amount" = R, diff --git a/src/Layers/W1/BaseApp/Permissions/d365teammember.permissionset.al b/src/Layers/W1/BaseApp/Permissions/d365teammember.permissionset.al index 53f3403e1f6..b041fe8c4fa 100644 --- a/src/Layers/W1/BaseApp/Permissions/d365teammember.permissionset.al +++ b/src/Layers/W1/BaseApp/Permissions/d365teammember.permissionset.al @@ -631,7 +631,11 @@ permissionset 7931 "D365 TEAM MEMBER" tabledata "Cust. Ledger Entry" = RiMd, tabledata "Custom Address Format" = RM, tabledata "Custom Address Format Line" = RM, +#if not CLEAN29 +#pragma warning disable AL0432, AS0105 tabledata "Custom Report Layout" = RM, +#pragma warning restore AL0432, AS0105 +#endif tabledata "Custom Report Selection" = RIMD, tabledata Customer = RM, tabledata "Customer Amount" = RM, diff --git a/src/Layers/W1/BaseApp/Permissions/intelligentcloud.permissionset.al b/src/Layers/W1/BaseApp/Permissions/intelligentcloud.permissionset.al index 71d6e792745..2c919df98b2 100644 --- a/src/Layers/W1/BaseApp/Permissions/intelligentcloud.permissionset.al +++ b/src/Layers/W1/BaseApp/Permissions/intelligentcloud.permissionset.al @@ -624,7 +624,11 @@ permissionset 6121 "INTELLIGENT CLOUD" tabledata "Cust. Ledger Entry" = R, tabledata "Custom Address Format" = R, tabledata "Custom Address Format Line" = R, +#if not CLEAN29 +#pragma warning disable AL0432, AS0105 tabledata "Custom Report Layout" = R, +#pragma warning restore AL0432, AS0105 +#endif tabledata "Custom Report Selection" = R, tabledata Customer = R, tabledata "Customer Amount" = R, diff --git a/src/Layers/W1/BaseApp/Projects/Project/Setup/ReportSelectionJob.Page.al b/src/Layers/W1/BaseApp/Projects/Project/Setup/ReportSelectionJob.Page.al index 9063afdb04b..3ed797fce16 100644 --- a/src/Layers/W1/BaseApp/Projects/Project/Setup/ReportSelectionJob.Page.al +++ b/src/Layers/W1/BaseApp/Projects/Project/Setup/ReportSelectionJob.Page.al @@ -7,6 +7,7 @@ namespace Microsoft.Projects.Project.Setup; using Microsoft.Foundation.Reporting; using System.Reflection; +#pragma warning disable AS0032 page 307 "Report Selection - Job" { AboutTitle = 'About report selection for projects'; @@ -118,6 +119,8 @@ page 307 "Report Selection - Job" ToolTip = 'Specifies the ID of the custom email body layout that is used.'; Visible = false; } +#if not CLEAN29 +#pragma warning disable AL0432 field("Email Body Layout Description"; Rec."Email Body Layout Description") { ApplicationArea = Basic, Suite; @@ -129,13 +132,13 @@ page 307 "Report Selection - Job" var CustomReportLayout: Record "Custom Report Layout"; begin -#pragma warning disable AL0432 if CustomReportLayout.LookupLayoutOK(Rec."Report ID") then -#pragma warning restore AL0432 Rec.Validate("Email Body Layout Code", CustomReportLayout.Code); end; #endif } +#pragma warning restore AL0432 +#endif } } area(factboxes) @@ -215,3 +218,4 @@ page 307 "Report Selection - Job" begin end; } +#pragma warning restore AS0032 diff --git a/src/Layers/W1/BaseApp/Purchases/Setup/ReportSelectionPurchase.Page.al b/src/Layers/W1/BaseApp/Purchases/Setup/ReportSelectionPurchase.Page.al index 88b09e4d37d..4899b4b9762 100644 --- a/src/Layers/W1/BaseApp/Purchases/Setup/ReportSelectionPurchase.Page.al +++ b/src/Layers/W1/BaseApp/Purchases/Setup/ReportSelectionPurchase.Page.al @@ -7,6 +7,7 @@ namespace Microsoft.Purchases.Setup; using Microsoft.Foundation.Reporting; using System.Reflection; +#pragma warning disable AS0032 page 347 "Report Selection - Purchase" { AboutTitle = 'About report selection for purchases'; @@ -117,6 +118,8 @@ page 347 "Report Selection - Purchase" ToolTip = 'Specifies the ID of the custom email body layout that is used.'; Visible = false; } +#if not CLEAN29 +#pragma warning disable AL0432 field("Email Body Layout Description"; Rec."Email Body Layout Description") { ApplicationArea = Basic, Suite; @@ -128,13 +131,13 @@ page 347 "Report Selection - Purchase" var CustomReportLayout: Record "Custom Report Layout"; begin -#pragma warning disable AL0432 if CustomReportLayout.LookupLayoutOK(Rec."Report ID") then -#pragma warning restore AL0432 Rec.Validate("Email Body Layout Code", CustomReportLayout.Code); end; #endif } +#pragma warning restore AL0432 +#endif } } area(factboxes) @@ -273,4 +276,5 @@ page 347 "Report Selection - Purchase" begin end; } +#pragma warning restore AS0032 diff --git a/src/Layers/W1/BaseApp/Purchases/Setup/VendorReportSelections.Page.al b/src/Layers/W1/BaseApp/Purchases/Setup/VendorReportSelections.Page.al index 4a1452debca..ccd70db4be7 100644 --- a/src/Layers/W1/BaseApp/Purchases/Setup/VendorReportSelections.Page.al +++ b/src/Layers/W1/BaseApp/Purchases/Setup/VendorReportSelections.Page.al @@ -9,6 +9,7 @@ using Microsoft.Foundation.Reporting; using Microsoft.Purchases.Vendor; using System.Reflection; +#pragma warning disable AS0032 page 9658 "Vendor Report Selections" { Caption = 'Document Layouts'; @@ -23,7 +24,9 @@ page 9658 "Vendor Report Selections" { repeater(Group) { +#if not CLEAN29 FreezeColumn = "Custom Report Description"; +#endif field(Usage2; Usage2) { ApplicationArea = Basic, Suite; @@ -56,6 +59,8 @@ page 9658 "Vendor Report Selections" ApplicationArea = Basic, Suite; Caption = 'Report Name'; } +#if not CLEAN29 +#pragma warning disable AL0432 field("Custom Report Description"; Rec."Custom Report Description") { ApplicationArea = Basic, Suite; @@ -94,6 +99,8 @@ page 9658 "Vendor Report Selections" end; end; } +#pragma warning restore AL0432 +#endif field(SendToEmail; Rec."Send To Email") { ApplicationArea = Basic, Suite; @@ -117,6 +124,8 @@ page 9658 "Vendor Report Selections" ApplicationArea = Basic, Suite; Visible = false; } +#if not CLEAN29 +#pragma warning disable AL0432 field("Email Body Layout Description"; Rec."Email Body Layout Description") { ApplicationArea = Basic, Suite; @@ -136,6 +145,8 @@ page 9658 "Vendor Report Selections" CurrPage.Update(true); end; } +#pragma warning restore AL0432 +#endif field("Email Body Layout"; ReportSelectionsImpl.GetReportLayoutCaption(Rec."Report ID", Rec."Email Body Layout Name", Rec."Email Body Layout AppID")) { ApplicationArea = Basic, Suite; @@ -255,7 +266,9 @@ page 9658 "Vendor Report Selections" var ReportSelectionsImpl: Codeunit "Report Selections Impl"; +#if not CLEAN29 CouldNotFindCustomReportLayoutErr: Label 'There is no custom report layout with %1 in the description.', Comment = '%1 Description of custom report layout'; +#endif protected var Usage2: Enum "Report Selection Usage Vendor"; @@ -307,4 +320,5 @@ page 9658 "Vendor Report Selections" begin end; } +#pragma warning restore AS0032 diff --git a/src/Layers/W1/BaseApp/Sales/Reminder/ReportSelectionReminder.Page.al b/src/Layers/W1/BaseApp/Sales/Reminder/ReportSelectionReminder.Page.al index bc89a3fe5c5..c64486caccd 100644 --- a/src/Layers/W1/BaseApp/Sales/Reminder/ReportSelectionReminder.Page.al +++ b/src/Layers/W1/BaseApp/Sales/Reminder/ReportSelectionReminder.Page.al @@ -10,6 +10,7 @@ using System.Reflection; /// /// Configures which reports are used when printing or emailing reminders and finance charges. /// +#pragma warning disable AS0032 page 524 "Report Selection - Reminder" { AboutTitle = 'About report selection for reminders'; @@ -85,6 +86,8 @@ page 524 "Report Selection - Reminder" ToolTip = 'Specifies the ID of the custom email body layout that is used.'; Visible = false; } +#if not CLEAN29 +#pragma warning disable AL0432 field("Email Body Layout Description"; Rec."Email Body Layout Description") { ApplicationArea = Basic, Suite; @@ -96,13 +99,13 @@ page 524 "Report Selection - Reminder" var CustomReportLayout: Record "Custom Report Layout"; begin -#pragma warning disable AL0432 if CustomReportLayout.LookupLayoutOK(Rec."Report ID") then -#pragma warning restore AL0432 Rec.Validate("Email Body Layout Code", CustomReportLayout.Code); end; #endif } +#pragma warning restore AL0432 +#endif } } area(factboxes) @@ -133,12 +136,16 @@ page 524 "Report Selection - Reminder" begin InitUsageFilter(); SetUsageFilter(false); +#if not CLEAN29 CustomLayoutsExist := Rec.DoesAnyCustomLayotExist(); +#endif end; var ReportUsage2: Enum "Report Selection Usage Reminder"; +#if not CLEAN29 CustomLayoutsExist: Boolean; +#endif local procedure SetUsageFilter(ModifyRec: Boolean) begin @@ -192,4 +199,5 @@ page 524 "Report Selection - Reminder" begin end; } +#pragma warning restore AS0032 diff --git a/src/Layers/W1/BaseApp/Sales/Setup/CustomerReportSelections.Page.al b/src/Layers/W1/BaseApp/Sales/Setup/CustomerReportSelections.Page.al index f4f80099a8c..a4eee8a6199 100644 --- a/src/Layers/W1/BaseApp/Sales/Setup/CustomerReportSelections.Page.al +++ b/src/Layers/W1/BaseApp/Sales/Setup/CustomerReportSelections.Page.al @@ -12,6 +12,7 @@ using System.Reflection; /// /// Displays and manages customer-specific document layouts for sales reports. Allows configuration of report selections, email settings, and custom layouts per customer. /// +#pragma warning disable AS0032 page 9657 "Customer Report Selections" { Caption = 'Document Layouts'; @@ -26,7 +27,9 @@ page 9657 "Customer Report Selections" { repeater(Group) { +#if not CLEAN29 FreezeColumn = "Custom Report Description"; +#endif field(Usage2; Usage2) { ApplicationArea = Basic, Suite; @@ -74,6 +77,8 @@ page 9657 "Customer Report Selections" ApplicationArea = Basic, Suite; Caption = 'Report Name'; } +#if not CLEAN29 +#pragma warning disable AL0432 field("Custom Report Description"; Rec."Custom Report Description") { ApplicationArea = Basic, Suite; @@ -111,6 +116,8 @@ page 9657 "Customer Report Selections" end; end; } +#pragma warning restore AL0432 +#endif field(SendToEmail; Rec."Send To Email") { ApplicationArea = Basic, Suite; @@ -134,6 +141,8 @@ page 9657 "Customer Report Selections" ApplicationArea = Basic, Suite; Visible = false; } +#if not CLEAN29 +#pragma warning disable AL0432 field("Email Body Layout Description"; Rec."Email Body Layout Description") { ApplicationArea = Basic, Suite; @@ -153,6 +162,8 @@ page 9657 "Customer Report Selections" CurrPage.Update(true); end; } +#pragma warning restore AL0432 +#endif field("Email Body Layout"; ReportSelectionsImpl.GetReportLayoutCaption(Rec."Report ID", Rec."Email Body Layout Name", Rec."Email Body Layout AppID")) { ApplicationArea = Basic, Suite; @@ -273,7 +284,9 @@ page 9657 "Customer Report Selections" var ReportSelectionsImpl: Codeunit "Report Selections Impl"; +#if not CLEAN29 CouldNotFindCustomReportLayoutErr: Label 'There is no custom report layout with %1 in the description.', Comment = '%1 Description of custom report layout'; +#endif protected var Usage2: Enum "Custom Report Selection Sales"; @@ -336,3 +349,4 @@ page 9657 "Customer Report Selections" begin end; } +#pragma warning restore AS0032 diff --git a/src/Layers/W1/BaseApp/Sales/Setup/ReportSelectionSales.Page.al b/src/Layers/W1/BaseApp/Sales/Setup/ReportSelectionSales.Page.al index b9cc2cf29d5..a23fb75847d 100644 --- a/src/Layers/W1/BaseApp/Sales/Setup/ReportSelectionSales.Page.al +++ b/src/Layers/W1/BaseApp/Sales/Setup/ReportSelectionSales.Page.al @@ -10,6 +10,7 @@ using System.Reflection; /// /// Configures default report selections for sales document types. Allows users to specify which reports to use for printing, emailing, and other output operations. /// +#pragma warning disable AS0032 page 306 "Report Selection - Sales" { AboutTitle = 'About report selection for sales'; @@ -120,6 +121,8 @@ page 306 "Report Selection - Sales" ToolTip = 'Specifies the ID of the custom email body layout that is used.'; Visible = false; } +#if not CLEAN29 +#pragma warning disable AL0432 field("Email Body Layout Description"; Rec."Email Body Layout Description") { ApplicationArea = Basic, Suite; @@ -131,13 +134,13 @@ page 306 "Report Selection - Sales" var CustomReportLayout: Record "Custom Report Layout"; begin -#pragma warning disable AL0432 if CustomReportLayout.LookupLayoutOK(Rec."Report ID") then -#pragma warning restore AL0432 Rec.Validate("Email Body Layout Code", CustomReportLayout.Code); end; #endif } +#pragma warning restore AL0432 +#endif } } area(factboxes) @@ -285,4 +288,5 @@ page 306 "Report Selection - Sales" begin end; } +#pragma warning restore AS0032 diff --git a/src/Layers/W1/BaseApp/Service/Setup/ReportSelectionService.Page.al b/src/Layers/W1/BaseApp/Service/Setup/ReportSelectionService.Page.al index c664e8349d8..4ecd7597e1f 100644 --- a/src/Layers/W1/BaseApp/Service/Setup/ReportSelectionService.Page.al +++ b/src/Layers/W1/BaseApp/Service/Setup/ReportSelectionService.Page.al @@ -7,6 +7,7 @@ namespace Microsoft.Service.Setup; using Microsoft.Foundation.Reporting; using System.Reflection; +#pragma warning disable AS0032 page 5932 "Report Selection - Service" { AboutTitle = 'About report selection for service'; @@ -116,6 +117,8 @@ page 5932 "Report Selection - Service" ToolTip = 'Specifies the ID of the custom email body layout that is used.'; Visible = false; } +#if not CLEAN29 +#pragma warning disable AL0432 field("Email Body Layout Description"; Rec."Email Body Layout Description") { ApplicationArea = Basic, Suite; @@ -127,13 +130,13 @@ page 5932 "Report Selection - Service" var CustomReportLayout: Record "Custom Report Layout"; begin -#pragma warning disable AL0432 if CustomReportLayout.LookupLayoutOK(Rec."Report ID") then -#pragma warning restore AL0432 Rec.Validate("Email Body Layout Code", CustomReportLayout.Code); end; #endif } +#pragma warning restore AL0432 +#endif } } area(factboxes) @@ -241,3 +244,4 @@ page 5932 "Report Selection - Service" begin end; } +#pragma warning restore AS0032 diff --git a/src/Layers/W1/BaseApp/System/RapidStart/ConfigPackageManagement.Codeunit.al b/src/Layers/W1/BaseApp/System/RapidStart/ConfigPackageManagement.Codeunit.al index a74b4ac71d5..146ec05cde5 100644 --- a/src/Layers/W1/BaseApp/System/RapidStart/ConfigPackageManagement.Codeunit.al +++ b/src/Layers/W1/BaseApp/System/RapidStart/ConfigPackageManagement.Codeunit.al @@ -1512,9 +1512,13 @@ codeunit 8611 "Config. Package Management" Database::Microsoft.Pricing.Calculation."Price Calculation Setup", Database::"Company Information": ConfigPackageTable."Processing Order" += 1; +#if not CLEAN29 +#pragma warning disable AL0432, AS0105 Database::Microsoft.Foundation.Reporting."Custom Report Layout": +#pragma warning restore AL0432, AS0105 // Moving Layouts to be on the top ConfigPackageTable."Processing Order" := 0; +#endif // Moving Jobs tables down so contacts table can be processed first Database::Microsoft.Projects.Project.Job.Job, Database::Microsoft.Projects.Project.Job."Job Task", Database::Microsoft.Projects.Project.Planning."Job Planning Line", Database::Microsoft.Projects.Project.Journal."Job Journal Line", diff --git a/src/Layers/W1/BaseApp/System/RapidStart/ConfigTableProcessingRule.Table.al b/src/Layers/W1/BaseApp/System/RapidStart/ConfigTableProcessingRule.Table.al index 82428909c0b..4c792a4a05d 100644 --- a/src/Layers/W1/BaseApp/System/RapidStart/ConfigTableProcessingRule.Table.al +++ b/src/Layers/W1/BaseApp/System/RapidStart/ConfigTableProcessingRule.Table.al @@ -2,7 +2,9 @@ using Microsoft.Finance.GeneralLedger.Journal; using Microsoft.Finance.GeneralLedger.Posting; +#if not CLEAN29 using Microsoft.Foundation.Reporting; +#endif using Microsoft.Inventory.Item; using Microsoft.Inventory.Setup; using Microsoft.Inventory.Transfer; @@ -146,8 +148,12 @@ table 8631 "Config. Table Processing Rule" exit(Action in [Action::Invoice, Action::Receive]); Database::"Gen. Journal Line", Database::"Gen. Journal Batch": exit(Action = Action::Post); +#if not CLEAN29 +#pragma warning disable AL0432, AS0105 Database::"Custom Report Layout": +#pragma warning restore AL0432, AS0105 exit(Action = Action::Post); +#endif Database::"Transfer Header": exit(Action in [Action::Ship, Action::Receive]); Database::Item: @@ -187,8 +193,12 @@ table 8631 "Config. Table Processing Rule" exit(RunActionOnGenJnlLine(RecRef)); Database::"Gen. Journal Batch": exit(RunActionOnGenJnlBatch(RecRef)); +#if not CLEAN29 +#pragma warning disable AL0432, AS0105 Database::"Custom Report Layout": +#pragma warning restore AL0432, AS0105 exit(RunActionOnCustomReportLayout(RecRef)); +#endif Database::"Transfer Header": exit(RunActionOnTransferHeader(RecRef)); Database::Item: @@ -325,9 +335,12 @@ table 8631 "Config. Table Processing Rule" Clear(ConfigPackageFilters); end; +#if not CLEAN29 local procedure RunActionOnCustomReportLayout(RecRef: RecordRef): Boolean var +#pragma warning disable AL0432, AS0105 CustomReportLayout: Record "Custom Report Layout"; +#pragma warning restore AL0432, AS0105 ReportLayoutSelection: Record "Report Layout Selection"; begin RecRef.SetTable(CustomReportLayout); @@ -346,6 +359,7 @@ table 8631 "Config. Table Processing Rule" end; exit(false); end; +#endif [IntegrationEvent(false, false)] local procedure OnDoesTableHaveCustomRuleInRapidStart(TableID: Integer; var Result: Boolean) diff --git a/src/Layers/W1/BaseApp/Utilities/DataClassificationEvalData.Codeunit.al b/src/Layers/W1/BaseApp/Utilities/DataClassificationEvalData.Codeunit.al index 7a028453143..7b211f22146 100644 --- a/src/Layers/W1/BaseApp/Utilities/DataClassificationEvalData.Codeunit.al +++ b/src/Layers/W1/BaseApp/Utilities/DataClassificationEvalData.Codeunit.al @@ -300,7 +300,9 @@ codeunit 1751 "Data Classification Eval. Data" ClassifyVATEntry(); ClassifyVATRegistrationLog(); ClassifyInsuranceRegister(); +#if not CLEAN29 ClassifyCustomReportLayout(); +#endif ClassifyCostBudgetRegister(); ClassifyCostBudgetEntry(); ClassifyCostAllocationTarget(); @@ -2905,15 +2907,21 @@ codeunit 1751 "Data Classification Eval. Data" SetFieldToPersonal(TableNo, DummyInsuranceRegister.FieldNo("User ID")); end; +#if not CLEAN29 local procedure ClassifyCustomReportLayout() var +#pragma warning disable AL0432, AS0105 DummyCustomReportLayout: Record "Custom Report Layout"; +#pragma warning restore AL0432, AS0105 TableNo: Integer; begin +#pragma warning disable AL0432, AS0105 TableNo := DATABASE::"Custom Report Layout"; +#pragma warning restore AL0432, AS0105 SetTableFieldsToNormal(TableNo); SetFieldToPersonal(TableNo, DummyCustomReportLayout.FieldNo("Last Modified by User")); end; +#endif local procedure ClassifyCostBudgetRegister() var diff --git a/src/Layers/W1/DemoTool/CreateInteractTemplLang.Codeunit.al b/src/Layers/W1/DemoTool/CreateInteractTemplLang.Codeunit.al index 62e138f14c1..3e6d36e8690 100644 --- a/src/Layers/W1/DemoTool/CreateInteractTemplLang.Codeunit.al +++ b/src/Layers/W1/DemoTool/CreateInteractTemplLang.Codeunit.al @@ -28,12 +28,18 @@ codeunit 101596 "Create Interact. Templ. Lang." CustomReportLayoutCode: Code[20]; AttachmentNo: Integer; begin +#if not CLEAN29 if LowerCase(FileExtension) = 'html' then InsertInteractionTmplLanguage := InsertCustomAttachment(FileExtension, AttachmentNo, CustomReportLayoutCode) else InsertInteractionTmplLanguage := InsertFileAttachment(InteractionTemplateCode, LanguageCode, FileExtension, AttachmentNo); +#else + CustomReportLayoutCode := ''; + InsertInteractionTmplLanguage := + InsertFileAttachment(InteractionTemplateCode, LanguageCode, FileExtension, AttachmentNo); +#endif if InsertInteractionTmplLanguage then InsertDataWithAttachment(InteractionTemplateCode, LanguageCode, AttachmentNo, CustomReportLayoutCode); @@ -77,9 +83,12 @@ codeunit 101596 "Create Interact. Templ. Lang." Attachment.Insert(); end; +#if not CLEAN29 local procedure InsertCustomAttachment(FileExtension: Text[250]; var AttachmentNo: Integer; var CustomReportLayoutCode: Code[20]): Boolean var +#pragma warning disable AL0432, AS0105 CustomReportLayout: Record "Custom Report Layout"; +#pragma warning restore AL0432, AS0105 Attachment: Record Attachment; begin CustomReportLayout.SetRange("Report ID", REPORT::"Email Merge"); @@ -93,6 +102,7 @@ codeunit 101596 "Create Interact. Templ. Lang." exit(false); end; +#endif local procedure InsertFileAttachment(InteractionTemplateCode: Code[10]; LanguageCode: Code[10]; FileExtension: Text[250]; var AttachmentNo: Integer): Boolean var diff --git a/src/Layers/W1/DemoTool/CreateRapidStartPackage.Codeunit.al b/src/Layers/W1/DemoTool/CreateRapidStartPackage.Codeunit.al index f7fa667ba27..64c67f338fe 100644 --- a/src/Layers/W1/DemoTool/CreateRapidStartPackage.Codeunit.al +++ b/src/Layers/W1/DemoTool/CreateRapidStartPackage.Codeunit.al @@ -250,7 +250,11 @@ codeunit 101995 "Create RapidStart Package" CreateTable(Database::"Word Template"); // Reporting +#if not CLEAN29 +#pragma warning disable AL0432, AS0105 CreateTable(DATABASE::"Custom Report Layout"); +#pragma warning restore AL0432, AS0105 +#endif CreateConfigPackageHelper.SetSkipTableTriggers(); // Office Add-Ins diff --git a/src/Layers/W1/Tests/ApplicationTestLibrary/LibraryMarketing.Codeunit.al b/src/Layers/W1/Tests/ApplicationTestLibrary/LibraryMarketing.Codeunit.al index 587752a3cc1..2be6cd4eda4 100644 --- a/src/Layers/W1/Tests/ApplicationTestLibrary/LibraryMarketing.Codeunit.al +++ b/src/Layers/W1/Tests/ApplicationTestLibrary/LibraryMarketing.Codeunit.al @@ -1,6 +1,7 @@ /// /// Provides utility functions for creating and managing marketing-related entities in test scenarios, including contacts, campaigns, and segments. /// +#pragma warning disable AL0432, AS0105 codeunit 131900 "Library - Marketing" { @@ -546,6 +547,8 @@ codeunit 131900 "Library - Marketing" WebSource.Insert(true); end; +#if not CLEAN29 + [Obsolete('Creates a layout in the Custom Report Layout table, which is replaced by the system tables Tenant Report Layout and Report Layout Selection.', '29.0')] procedure CreateEmailMergeCustomLayoutNo(): Code[20] var CustomReportLayout: Record "Custom Report Layout"; @@ -557,6 +560,7 @@ codeunit 131900 "Library - Marketing" CustomReportLayout.Insert(true); exit(CustomReportLayout.Code); end; +#endif procedure CreateEmailMergeAttachment(var Attachment: Record Attachment) ContentBodyText: Text begin @@ -591,6 +595,8 @@ codeunit 131900 "Library - Marketing" Contact.FindSet(); end; +#if not CLEAN29 + [Obsolete('Reads the Custom Report Layout table, which is replaced by the system tables Tenant Report Layout and Report Layout Selection. Use FindEmailMergeCustomLayoutName instead.', '29.0')] procedure FindEmailMergeCustomLayoutNo(): Code[20] var CustomReportLayout: Record "Custom Report Layout"; @@ -600,6 +606,7 @@ codeunit 131900 "Library - Marketing" CustomReportLayout.FindFirst(); exit(CustomReportLayout.Code); end; +#endif procedure FindEmailMergeCustomLayoutName(): Text[250] var @@ -645,4 +652,5 @@ codeunit 131900 "Library - Marketing" Contact.Modify(); end; } +#pragma warning restore AL0432, AS0105 diff --git a/src/Layers/W1/Tests/Integration-Internal/MailServiceTest.Codeunit.al b/src/Layers/W1/Tests/Integration-Internal/MailServiceTest.Codeunit.al index 8ebecceb2a3..9692f61c495 100644 --- a/src/Layers/W1/Tests/Integration-Internal/MailServiceTest.Codeunit.al +++ b/src/Layers/W1/Tests/Integration-Internal/MailServiceTest.Codeunit.al @@ -1,3 +1,4 @@ +#pragma warning disable AL0432, AS0105 codeunit 139111 "Mail Service Test" { Subtype = Test; @@ -18,20 +19,26 @@ codeunit 139111 "Mail Service Test" LibrarySales: Codeunit "Library - Sales"; LibraryPurchase: Codeunit "Library - Purchase"; LibraryService: Codeunit "Library - Service"; +#if not CLEAN29 LibraryJob: Codeunit "Library - Job"; +#endif ActiveDirectoryMockEvents: Codeunit "Active Directory Mock Events"; IsInitialized: Boolean; EmailSubjectCapMsg: Label '%1 - %2 %3'; AttachmentNameTok: Label '%1 %2.pdf'; SalesInvoiceTxt: Label 'Sales Invoice'; +#if not CLEAN29 SalesQuoteTxt: Label 'Sales Quote'; +#endif SalesShipmentTxt: Label 'Sales Shipment'; SalesReceiptTxt: Label 'Sales Receipt'; PurchaseQuoteTxt: Label 'Purchase Quote'; PurchaseOrderTxt: Label 'Purchase Order'; ServiceInvoiceTxt: Label 'Service Invoice'; ServiceCrMemoTxt: Label 'Service Credit Memo'; +#if not CLEAN29 JobQuoteTxt: Label 'Project Quote'; +#endif IncorrectSubjectErr: Label 'Subject is not correct'; IncorrectAttachNameErr: Label 'Attachment Name is not correct'; @@ -165,6 +172,7 @@ codeunit 139111 "Mail Service Test" // [THEN] Send dialog appeared (handler has been invoked) end; +#if not CLEAN29 [Test] [HandlerFunctions('ValidateMailDialog')] [Scope('OnPrem')] @@ -232,6 +240,7 @@ codeunit 139111 "Mail Service Test" LibraryVariableStorage.AssertEmpty(); end; +#endif [Test] [HandlerFunctions('ValidateMailDialog')] @@ -262,6 +271,7 @@ codeunit 139111 "Mail Service Test" LibraryVariableStorage.AssertEmpty(); end; +#if not CLEAN29 [Test] [HandlerFunctions('ValidateMailDialog')] [Scope('OnPrem')] @@ -291,6 +301,7 @@ codeunit 139111 "Mail Service Test" LibraryVariableStorage.AssertEmpty(); end; +#endif [Test] [HandlerFunctions('SelectSendingOptionsOKModalPageHandler,ValidateMailDialog')] @@ -437,6 +448,7 @@ codeunit 139111 "Mail Service Test" end; end; +#if not CLEAN29 local procedure CreateCustomReportSelectionForCustomer(CustomerNo: Code[20]; ReportSelectionUsage: Enum "Report Selection Usage"; ReportID: Integer) var CustomReportSelection: Record "Custom Report Selection"; @@ -453,6 +465,7 @@ codeunit 139111 "Mail Service Test" "Email Body Layout Code", CustomReportLayout.InitBuiltInLayout(CustomReportSelection."Report ID", CustomReportLayout.Type::Word.AsInteger())); CustomReportSelection.Insert(true); end; +#endif local procedure CreateEmailPdfDefaultDocumentSendingProfile(); var @@ -626,4 +639,5 @@ codeunit 139111 "Mail Service Test" ActiveDirectoryMockEvents.Enable(); end; } +#pragma warning restore AL0432, AS0105 diff --git a/src/Layers/W1/Tests/Job/JobQuoteReportTests.Codeunit.al b/src/Layers/W1/Tests/Job/JobQuoteReportTests.Codeunit.al index 2d1f45be79e..6e30397d05f 100644 --- a/src/Layers/W1/Tests/Job/JobQuoteReportTests.Codeunit.al +++ b/src/Layers/W1/Tests/Job/JobQuoteReportTests.Codeunit.al @@ -1,3 +1,4 @@ +#pragma warning disable AL0432, AS0105 codeunit 136314 "Job Quote Report Tests" { Subtype = Test; @@ -138,6 +139,7 @@ codeunit 136314 "Job Quote Report Tests" TearDown(); end; +#if not CLEAN29 [Test] [HandlerFunctions('ConfirmHandlerTrue,MessageHandler,PostandSendPageHandlerNo')] [Scope('OnPrem')] @@ -189,6 +191,7 @@ codeunit 136314 "Job Quote Report Tests" RemoveReportLayout(); TearDown(); end; +#endif [Test] [HandlerFunctions('ConfirmHandlerTrue,MessageHandler,PostandSendPageHandlerYes,EmailEditorHandler,CloseEmailEditorHandler')] @@ -327,6 +330,7 @@ codeunit 136314 "Job Quote Report Tests" LibraryReportValidation.DownloadFile(); end; +#if not CLEAN29 local procedure CreateJobQueueReportSelection() var CustomReportSelection: Record "Custom Report Selection"; @@ -342,6 +346,7 @@ codeunit 136314 "Job Quote Report Tests" CustomReportSelection.Init(); end; +#endif local procedure VerifyJobQuoteReport(JobPlanningLine: Record "Job Planning Line"; Column: Text[250]; Column2: Text[250]; Column3: Text[250]; Column4: Text[250]) begin @@ -418,6 +423,7 @@ codeunit 136314 "Job Quote Report Tests" SetReportLayout(ReportLayoutSelection.Type::"RDLC (built-in)", ''); end; +#if not CLEAN29 local procedure SetReportLayoutForCustomWord() var CustomReportLayout: Record "Custom Report Layout"; @@ -432,6 +438,7 @@ codeunit 136314 "Job Quote Report Tests" SetReportLayout(ReportLayoutSelection.Type::"Custom Layout", CustomReportLayoutCode); end; +#endif local procedure SetReportLayout(LayoutSelection: Integer; CustomReportLayoutCode: Code[20]) begin @@ -533,4 +540,5 @@ codeunit 136314 "Job Quote Report Tests" RequestPage.Cancel().Invoke(); end; } +#pragma warning restore AL0432, AS0105 diff --git a/src/Layers/W1/Tests/Misc/DocumentSendingPostTests.Codeunit.al b/src/Layers/W1/Tests/Misc/DocumentSendingPostTests.Codeunit.al index 88299fdea64..bac847a384c 100644 --- a/src/Layers/W1/Tests/Misc/DocumentSendingPostTests.Codeunit.al +++ b/src/Layers/W1/Tests/Misc/DocumentSendingPostTests.Codeunit.al @@ -1,3 +1,4 @@ +#pragma warning disable AL0432, AS0105 codeunit 139197 DocumentSendingPostTests { EventSubscriberInstance = Manual; @@ -2573,6 +2574,7 @@ codeunit 139197 DocumentSendingPostTests "Document Exchange Status", ServiceCrMemoHeader."Document Exchange Status"::"Sent to Document Exchange Service"); end; +#if not CLEAN29 [Test] [HandlerFunctions('EmailDialogHandlerNo,CloseEmailEditorHandler')] [Scope('OnPrem')] @@ -2634,6 +2636,7 @@ codeunit 139197 DocumentSendingPostTests // Verify email address in EmailDialogHandlerNo LibraryVariableStorage.AssertEmpty(); end; +#endif [Test] [HandlerFunctions('VerifyAndCancelCustomerProfileSelectionMethodStrMenuHandler')] @@ -3397,6 +3400,7 @@ codeunit 139197 DocumentSendingPostTests SalesInvoiceHeader.Get(InvoiceNo); end; +#if not CLEAN29 [Test] [HandlerFunctions('ConfirmHandler,VerifySelectSendingOptionHandler,EmailDialogHandlerNo,CloseEmailEditorHandler')] [Scope('OnPrem')] @@ -3796,6 +3800,7 @@ codeunit 139197 DocumentSendingPostTests LibraryVariableStorage.AssertEmpty(); end; +#endif [Test] [HandlerFunctions('SelectSendingOptionHandler,EmailDialogHandlerNo,CloseEmailEditorHandler')] @@ -4289,6 +4294,7 @@ codeunit 139197 DocumentSendingPostTests LibraryTestInitialize.OnAfterTestSuiteInitialize(Codeunit::DocumentSendingPostTests); end; +#if not CLEAN29 local procedure Scenario_423995(EmailAddressCustomer: array[2] of Text[80]; DocumentLayoutEmail: array[2] of Text[80]; SellToEmail: Text[80]; var PostedInvoiceNo: Code[20]; var DocumentSendingProfileEmail: Record "Document Sending Profile"; var AttachmentName: Text) var SalesHeader: Record "Sales Header"; @@ -4331,7 +4337,9 @@ codeunit 139197 DocumentSendingPostTests PostedInvoiceNo := LibrarySales.PostSalesDocument(SalesHeader, true, true); end; +#endif +#if not CLEAN29 local procedure Scenario_423995_Verify(PostedInvoiceNo: Code[20]; DocumentSendingProfileEmail: Record "Document Sending Profile"; ExpectedTargetEmail: Text[80]; ExpectedAttachmentName: Text) var SalesInvoiceHeader: Record "Sales Invoice Header"; @@ -4347,6 +4355,7 @@ codeunit 139197 DocumentSendingPostTests SalesInvoiceHeader.SendRecords(); end; +#endif local procedure SetupInvoiceReportLayoutSelection() var @@ -4761,6 +4770,7 @@ codeunit 139197 DocumentSendingPostTests exit(LibraryUtility.GenerateGUID() + '@microsoft.com'); end; +#if not CLEAN29 local procedure FindCustomReportLayout(ReportID: Integer): Code[20] var CustomReportLayout: Record "Custom Report Layout"; @@ -4793,6 +4803,7 @@ codeunit 139197 DocumentSendingPostTests end; exit(CustomReportLayout.Code); end; +#endif local procedure UnsupportedDocumentType(DocumentType: Enum "Sales Document Type") var @@ -5537,4 +5548,5 @@ codeunit 139197 DocumentSendingPostTests TestMode := true end; } +#pragma warning restore AL0432, AS0105 diff --git a/src/Layers/W1/Tests/Misc/PaymentServicesTest.Codeunit.al b/src/Layers/W1/Tests/Misc/PaymentServicesTest.Codeunit.al index 759d230e94f..b8c3bb1d806 100644 --- a/src/Layers/W1/Tests/Misc/PaymentServicesTest.Codeunit.al +++ b/src/Layers/W1/Tests/Misc/PaymentServicesTest.Codeunit.al @@ -1,3 +1,4 @@ +#pragma warning disable AL0432, AS0105 codeunit 134425 "Payment Services Test" { EventSubscriberInstance = Manual; @@ -1487,20 +1488,26 @@ codeunit 134425 "Payment Services Test" local procedure SetupReportSelections() var +#if not CLEAN29 CustomReportLayout: Record "Custom Report Layout"; +#endif ReportSelections: Record "Report Selections"; begin ReportSelections.DeleteAll(); CreateDefaultReportSelection(); +#if not CLEAN29 GetCustomBodyLayout(CustomReportLayout); +#endif ReportSelections.Reset(); ReportSelections.SetRange(Usage, ReportSelections.Usage::"S.Invoice"); ReportSelections.FindFirst(); ReportSelections.Validate("Use for Email Attachment", true); ReportSelections.Validate("Use for Email Body", true); +#if not CLEAN29 ReportSelections.Validate("Email Body Layout Code", CustomReportLayout.Code); +#endif ReportSelections.Modify(true); end; @@ -1515,6 +1522,7 @@ codeunit 134425 "Payment Services Test" ReportSelections.Insert(); end; +#if not CLEAN29 local procedure GetReportID(): Integer begin exit(REPORT::"Standard Sales - Invoice"); @@ -1553,6 +1561,7 @@ codeunit 134425 "Payment Services Test" CustomReportLayout.Insert(); end; end; +#endif local procedure AssignMockSetupRecordID(var TempPaymentServiceSetup: Record "Payment Service Setup" temporary) var @@ -1992,3 +2001,4 @@ codeunit 134425 "Payment Services Test" ActiveDirectoryMockEvents.Enable(); end; } +#pragma warning restore AL0432, AS0105 diff --git a/src/Layers/W1/Tests/Misc/ReportSelectionsTests.Codeunit.al b/src/Layers/W1/Tests/Misc/ReportSelectionsTests.Codeunit.al index 5a409f06960..6c239e239d5 100644 --- a/src/Layers/W1/Tests/Misc/ReportSelectionsTests.Codeunit.al +++ b/src/Layers/W1/Tests/Misc/ReportSelectionsTests.Codeunit.al @@ -1,3 +1,4 @@ +#pragma warning disable AL0432, AS0105 codeunit 134421 "Report Selections Tests" { Subtype = Test; @@ -28,22 +29,31 @@ codeunit 134421 "Report Selections Tests" FromEmailBodyTemplateTxt: Text; Initialized: Boolean; TemplateIdentificationTxt: Label 'a'; +#if not CLEAN29 CustomerEmailTxt: Label 'Customer@contoso.com'; CustomLayoutEmailTxt: Label 'CustomLayout@contoso.com'; +#endif WrongEmailAddressErr: Label 'Email Address is wrong on Send Email Dialog'; +#if not CLEAN29 DocumentNoTok: Label 'DocumentNo'; +#endif ReportIDMustHaveValueErr: Label 'Report ID must have a value'; +#if not CLEAN29 EmailAddressErr: Label 'Destination email address does not match expected address.'; +#endif StatementTitlePdfTxt: Label 'Statement'; ReportTitleTemplatePdfTxt: Label '%1 for %2 as of %3.pdf'; #if not CLEAN28 LayoutCodeShouldNotChangedErr: Label 'Layout code should not change.'; #endif SendToEmailTxt: Label 'test@test.com'; +#if not CLEAN29 MSXLbl: Label 'MS-X%1', Comment = '%1 = Random Value'; DocxLbl: Label 'docx'; MustSelectAndEmailBodyOrAttahmentErr: Label 'You must select an email body or attachment in report selection for %1.', Comment = '%1 = Usage, for example Sales Invoice'; +#endif +#if not CLEAN29 [Test] [HandlerFunctions('StandardSalesInvoiceRequestPageHandler')] [Scope('OnPrem')] @@ -92,6 +102,7 @@ codeunit 134421 "Report Selections Tests" // Verify VerifySendEmailPage(FromEmailBodyTemplateTxt, TemplateIdentificationTxt, PostedSalesInvoice."No.".Value); end; +#endif [Test] [HandlerFunctions('SelectSendingOptionHandler,EmailEditorHandler,CloseEmailEditorHandler')] @@ -118,6 +129,7 @@ codeunit 134421 "Report Selections Tests" VerifySendEmailPage(FromEmailBodyTemplateTxt, TemplateIdentificationTxt, PurchaseOrder."No.".Value); end; +#if not CLEAN29 [Test] [Scope('OnPrem')] procedure TesteEmailNoBodyNoAttachmentRaisesError() @@ -136,6 +148,7 @@ codeunit 134421 "Report Selections Tests" // Verify Assert.ExpectedError('email body or attachment'); end; +#endif [Test] [HandlerFunctions('SelectSendingOptionHandler')] @@ -157,6 +170,7 @@ codeunit 134421 "Report Selections Tests" Assert.ExpectedError('email body or attachment'); end; +#if not CLEAN29 [Test] [HandlerFunctions('EmailEditorHandlerCustomMessage,CloseEmailEditorHandler')] [Scope('OnPrem')] @@ -359,8 +373,10 @@ codeunit 134421 "Report Selections Tests" // Verify is within handler end; +#endif #if not CLEAN27 +#if not CLEAN29 [Test] [Scope('OnPrem')] procedure TestHTMLEmailBodyLoad() @@ -482,7 +498,9 @@ codeunit 134421 "Report Selections Tests" StrSubstNo('Destination email address does not match expected address %1', CustomLayoutEmailTxt)); end; #endif +#endif +#if not CLEAN29 [Test] [Scope('OnPrem')] procedure TestHTMLEmailBodyLoadFromBlob() @@ -622,6 +640,7 @@ codeunit 134421 "Report Selections Tests" LibraryVariableStorage.AssertEmpty(); end; +#endif [Test] [HandlerFunctions('SelectSendingOptionHandlerPrint,PurchaseOrderRequestPageHandler')] @@ -663,6 +682,7 @@ codeunit 134421 "Report Selections Tests" Assert.RecordCount(PurchaseHeaderArchive, 2); end; +#if not CLEAN29 [Test] [HandlerFunctions('StandardSalesInvoiceRequestPageHandler')] [Scope('OnPrem')] @@ -687,6 +707,7 @@ codeunit 134421 "Report Selections Tests" LibraryVariableStorage.AssertEmpty(); end; +#endif [Test] [HandlerFunctions('EmailEditorHandler,CloseEmailEditorHandler')] @@ -973,6 +994,7 @@ codeunit 134421 "Report Selections Tests" LibraryVariableStorage.AssertEmpty(); end; +#if not CLEAN29 [Test] [HandlerFunctions('StatementOKRequestPageHandler,DownloadAttachmentNoConfirmHandler')] [Scope('OnPrem')] @@ -1025,6 +1047,7 @@ codeunit 134421 "Report Selections Tests" FindInteractionLogEntriesByCustomerNo(InteractionLogEntry, CustomerNo, InteractionLogEntry."Document Type"::"Sales Stmnt."); Assert.RecordCount(InteractionLogEntry, 1); end; +#endif [Test] @@ -1366,6 +1389,7 @@ codeunit 134421 "Report Selections Tests" Assert.IsTrue(StrPos(CustomerReportSelections.SendToEmail.Value, 'testcase@testcase.com') <> 0, 'Wrong email after contact update.'); end; +#if not CLEAN29 [Test] [Scope('OnPrem')] procedure PostedSalesInvoiceEmailHasMorePriorityThanCustomerEmail() @@ -1401,6 +1425,7 @@ codeunit 134421 "Report Selections Tests" // [THEN] The "a@a.com; b@b.com; c@c.com" address is used as target email address. Assert.AreEqual(SalesHeader."Sell-to E-Mail", EmailAddress, EmailAddressErr); end; +#endif [Test] [Scope('OnPrem')] @@ -1566,6 +1591,7 @@ codeunit 134421 "Report Selections Tests" LibraryTempNVBufferHandler.AssertQueueEmpty(); end; +#if not CLEAN29 [Test] [HandlerFunctions('TestAddressEmailEditorHandler,CloseEmailEditorHandler')] [Scope('OnPrem')] @@ -1614,6 +1640,7 @@ codeunit 134421 "Report Selections Tests" LibraryVariableStorage.AssertEmpty(); end; +#endif [Test] [Scope('OnPrem')] @@ -2081,6 +2108,7 @@ codeunit 134421 "Report Selections Tests" // No assertion needed - if we reach this point, the fix is working end; +#if not CLEAN29 [Test] [HandlerFunctions('SelectSendingOptionHandler,EmailEditorHandler,CloseEmailEditorHandler')] procedure TestSendPostedSalesShipmentToEMailAndPDF() @@ -2655,6 +2683,7 @@ codeunit 134421 "Report Selections Tests" // [THEN] Verify message type with Email Handler. end; +#endif local procedure Initialize() var @@ -2859,6 +2888,7 @@ codeunit 134421 "Report Selections Tests" SalesInvoiceHeader.Get(LibrarySales.PostSalesDocument(SalesHeader, true, true)); end; +#if not CLEAN29 local procedure OpenNewPostedSalesInvoice(var PostedSalesInvoice: TestPage "Posted Sales Invoice") var SalesInvoiceHeader: Record "Sales Invoice Header"; @@ -2867,6 +2897,7 @@ codeunit 134421 "Report Selections Tests" PostedSalesInvoice.OpenEdit(); PostedSalesInvoice.GotoRecord(SalesInvoiceHeader); end; +#endif [Scope('OnPrem')] procedure OpenNewPurchaseOrder(var PurchaseOrderPage: TestPage "Purchase Order") @@ -2878,6 +2909,7 @@ codeunit 134421 "Report Selections Tests" PurchaseOrderPage.GotoRecord(PurchaseHeader); end; +#if not CLEAN29 local procedure SetupReportSelections(UseForEmailAttachment: Boolean; UseForEmailBody: Boolean) var OldReportSelections: Record "Report Selections"; @@ -2893,19 +2925,18 @@ codeunit 134421 "Report Selections Tests" OldReportSelections.Usage::"S.Invoice", CustomReportLayout."Report ID", UseForEmailAttachment, UseForEmailBody, CustomReportLayout.Code); end; +#endif local procedure SetupReportSelectionsVendor(UseForEmailAttachment: Boolean; UseForEmailBody: Boolean) var OldReportSelections: Record "Report Selections"; - DummyCustomReportLayout: Record "Custom Report Layout"; begin OldReportSelections.Reset(); OldReportSelections.SetRange(Usage, OldReportSelections.Usage::"P.Order"); OldReportSelections.FindFirst(); UpdateReportSelections( - OldReportSelections.Usage::"P.Order", GetReportIDForPurchaseOrder(), UseForEmailAttachment, UseForEmailBody, - DummyCustomReportLayout.Code); + OldReportSelections.Usage::"P.Order", GetReportIDForPurchaseOrder(), UseForEmailAttachment, UseForEmailBody, ''); end; local procedure SetupInvoiceReportLayoutSelection() @@ -2967,6 +2998,7 @@ codeunit 134421 "Report Selections Tests" ReportSelections.Modify(true); end; +#if not CLEAN29 local procedure UpdateCustomReportSelections(NewCustNo: Code[20]; UseForEmailAttachment: Boolean; UseForEmailBody: Boolean; SendToAddress: Text[200]) var CustomReportSelection: Record "Custom Report Selection"; @@ -2985,16 +3017,19 @@ codeunit 134421 "Report Selections Tests" CustomReportSelection.Modify(true); end; +#endif local procedure GenerateGUIDWithSpecialSymbol(): Code[20] begin exit(LibraryUtility.GenerateGUID() + '&'); end; +#if not CLEAN29 local procedure GetStandardSalesInvoiceReportID(): Integer begin exit(REPORT::"Standard Sales - Invoice"); end; +#endif local procedure GetReportIDForPurchaseOrder(): Integer begin @@ -3011,6 +3046,7 @@ codeunit 134421 "Report Selections Tests" exit(REPORT::Statement); end; +#if not CLEAN29 local procedure GetCustomBodyLayout(var CustomReportLayout: Record "Custom Report Layout") var ReportLayoutList: Record "Report Layout List"; @@ -3042,6 +3078,7 @@ codeunit 134421 "Report Selections Tests" CustomReportLayout.Insert(); end; end; +#endif #if not CLEAN27 local procedure GetEmailItem(var EmailItem: Record "Email Item"; MessageType: Integer; BodyFilePath: Text[250]; Plaintext: Boolean) @@ -3052,12 +3089,15 @@ codeunit 134421 "Report Selections Tests" end; #endif +#if not CLEAN29 local procedure GetEmailItem(var EmailItem: Record "Email Item"; MessageType: Option "Custom Message","From Email Body Template"; var EmailBody: Codeunit "Temp Blob") begin EmailItem.Validate("Message Type", MessageType); EmailItem.SetBody(EmailBody); end; +#endif +#if not CLEAN29 local procedure SetUpCustomEmail(var SalesInvoiceHeader: Record "Sales Invoice Header"; EmailAddress: Text[80]; UseCustomForEmailBody: Boolean) var Customer: Record Customer; @@ -3070,6 +3110,7 @@ codeunit 134421 "Report Selections Tests" UpdateCustomReportSelections(SalesInvoiceHeader."Bill-to Customer No.", true, UseCustomForEmailBody, EmailAddress); end; +#endif local procedure GenerateRandomPackageTrackingNo(): Text[50] var @@ -3239,6 +3280,7 @@ codeunit 134421 "Report Selections Tests" CustomReportSelection.GetSendToEmailFromContacts(Contact); end; +#if not CLEAN29 local procedure UpdateContactEmail(var Contact: Record Contact; Email: Text[45]) begin Contact.Validate("E-Mail", Email); @@ -3254,6 +3296,7 @@ codeunit 134421 "Report Selections Tests" Customer.Validate("Primary Contact No.", Contact."No."); Customer.Modify(); end; +#endif #if not CLEAN28 local procedure StandardSalesInvoiceReportID(): Integer @@ -3262,6 +3305,7 @@ codeunit 134421 "Report Selections Tests" end; #endif +#if not CLEAN29 local procedure SetupSalesShipmentReportSelections(UseForEmailAttachment: Boolean; UseForEmailBody: Boolean) var OldReportSelections: Record "Report Selections"; @@ -3332,7 +3376,9 @@ codeunit 134421 "Report Selections Tests" CustomReportSelection.Modify(true); end; +#endif +#if not CLEAN29 local procedure GetStandardSalesShipmentReportID(): Integer begin exit(Report::"Standard Sales - Shipment"); @@ -3354,7 +3400,9 @@ codeunit 134421 "Report Selections Tests" LibrarySales.PostSalesDocument(SalesHeader, true, false); SalesPost.GetPostedDocumentRecord(SalesHeader, PostedDocumentVariant); end; +#endif +#if not CLEAN29 local procedure SetupSalesReturnReceiptReportSelections(UseForEmailAttachment: Boolean; UseForEmailBody: Boolean) var OldReportSelections: Record "Report Selections"; @@ -3425,7 +3473,9 @@ codeunit 134421 "Report Selections Tests" CustomReportSelection.Modify(true); end; +#endif +#if not CLEAN29 local procedure GetStandardSalesReturnReceiptReportID(): Integer begin exit(Report::"Standard Sales - Return Rcpt."); @@ -3447,12 +3497,15 @@ codeunit 134421 "Report Selections Tests" LibrarySales.PostSalesDocument(SalesHeader, true, false); SalesPost.GetPostedDocumentRecord(SalesHeader, PostedDocumentVariant); end; +#endif +#if not CLEAN29 local procedure UpdateYourReferenceSalesHeader(var SalesHeader: Record "Sales Header"; YourReference: Text[35]) begin SalesHeader."Your Reference" := YourReference; SalesHeader.Modify(); end; +#endif [RequestPageHandler] [Scope('OnPrem')] @@ -3631,6 +3684,7 @@ codeunit 134421 "Report Selections Tests" VendorReportSelections.CopyFromReportSelectionsAction.Invoke(); end; +#if not CLEAN29 [ModalPageHandler] procedure VendorReportSelectionsHandler(var VendorReportSelections: TestPage "Vendor Report Selections") begin @@ -3638,6 +3692,7 @@ codeunit 134421 "Report Selections Tests" VendorReportSelections."Custom Report Description".Drilldown(); VendorReportSelections."Custom Report Description".AssertEquals(LibraryVariableStorage.DequeueText()); end; +#endif [ModalPageHandler] procedure ProFormInvoiceCustomerReportSelectionsHandler(var CustomerReportSelections: TestPage "Customer Report Selections") @@ -3670,3 +3725,4 @@ codeunit 134421 "Report Selections Tests" ReportLayouts.OK().Invoke(); end; } +#pragma warning restore AL0432, AS0105 diff --git a/src/Layers/W1/Tests/NewObjectTests-Internal/CloudMigrationPropertyTest.Codeunit.al b/src/Layers/W1/Tests/NewObjectTests-Internal/CloudMigrationPropertyTest.Codeunit.al index 2cd2b3fd851..2bb0f3cba90 100644 --- a/src/Layers/W1/Tests/NewObjectTests-Internal/CloudMigrationPropertyTest.Codeunit.al +++ b/src/Layers/W1/Tests/NewObjectTests-Internal/CloudMigrationPropertyTest.Codeunit.al @@ -680,7 +680,7 @@ codeunit 135160 "Cloud Migration Property Test" ListOfTablesToMigrate.Add(Database::"XML Schema Restriction"); ListOfTablesToMigrate.Add(Database::"XML Schema"); ListOfTablesToMigrate.Add(Database::"Zone"); - ListOfTablesToMigrate.Add(Database::"Custom Report Layout"); + ListOfTablesToMigrate.Add(9650); // Database::"Custom Report Layout" ListOfTablesToMigrate.Add(Database::"Feature Data Update Status"); ListOfTablesToMigrate.Add(Database::"Feature Data Update Status"); ListOfTablesToMigrate.Add(Database::"Image Analysis Setup"); diff --git a/src/Layers/W1/Tests/Rapid Start/ERMRSProcessData.Codeunit.al b/src/Layers/W1/Tests/Rapid Start/ERMRSProcessData.Codeunit.al index e11dda36113..99b1ace4b3c 100644 --- a/src/Layers/W1/Tests/Rapid Start/ERMRSProcessData.Codeunit.al +++ b/src/Layers/W1/Tests/Rapid Start/ERMRSProcessData.Codeunit.al @@ -1,3 +1,4 @@ +#pragma warning disable AL0432, AS0105 codeunit 136612 "ERM RS Process Data" { EventSubscriberInstance = Manual; @@ -1522,6 +1523,7 @@ codeunit 136612 "ERM RS Process Data" Assert.AreEqual(1, Customer.Count, 'There is not one Customer in the Customer table. Deletion failed.'); end; +#if not CLEAN29 [Test] [Scope('OnPrem')] procedure RunPostActionOnCustomReportLayout() @@ -1568,13 +1570,16 @@ codeunit 136612 "ERM RS Process Data" Assert.IsTrue( ReportLayoutSelection."Custom Report Layout Code" = CustomLayoutCode, StrSubstNo('Expected report layout %1.', CustomLayoutCode)); end; +#endif local procedure Initialize() var ConfigPackageTable: Record "Config. Package Table"; ConfigPackageFilter: Record "Config. Package Filter"; ConfigTableProcessingRule: Record "Config. Table Processing Rule"; +#if not CLEAN29 CustomReportLayout: Record "Custom Report Layout"; +#endif ReportLayoutSelection: Record "Report Layout Selection"; begin LibraryTestInitialize.OnTestInitialize(CODEUNIT::"ERM RS Process Data"); @@ -1583,7 +1588,9 @@ codeunit 136612 "ERM RS Process Data" ConfigPackageTable.DeleteAll(true); ConfigPackageFilter.DeleteAll(true); ConfigTableProcessingRule.DeleteAll(true); +#if not CLEAN29 CustomReportLayout.DeleteAll(); +#endif ReportLayoutSelection.DeleteAll(true); end; @@ -2087,6 +2094,7 @@ codeunit 136612 "ERM RS Process Data" Assert.IsFalse(ConfigTableProcessingRules.FilterInfo.Editable(), 'Filter info should not be editable'); end; +#if not CLEAN29 local procedure CreateCustomReportLayouts(ReportQty: Integer; ReportID: Integer) var CustomReportLayout: Record "Custom Report Layout"; @@ -2097,6 +2105,7 @@ codeunit 136612 "ERM RS Process Data" CustomReportLayout.Description := StrSubstNo('Layout %1', i); end; end; +#endif [EventSubscriber(ObjectType::Table, Database::"Config. Table Processing Rule", 'OnDoesTableHaveCustomRuleInRapidStart', '', false, false)] local procedure OnDoesTableHaveCustomHandler(TableID: Integer; var Result: Boolean) @@ -2119,4 +2128,5 @@ codeunit 136612 "ERM RS Process Data" end end; } +#pragma warning restore AL0432, AS0105 diff --git a/src/Layers/W1/Tests/Report/RepSelectionsStdStmt.Codeunit.al b/src/Layers/W1/Tests/Report/RepSelectionsStdStmt.Codeunit.al index 90fa3ef3d24..7fb01d6f51b 100644 --- a/src/Layers/W1/Tests/Report/RepSelectionsStdStmt.Codeunit.al +++ b/src/Layers/W1/Tests/Report/RepSelectionsStdStmt.Codeunit.al @@ -1,3 +1,4 @@ +#pragma warning disable AL0432, AS0105 codeunit 134422 "Rep. Selections - Std. Stmt." { EventSubscriberInstance = Manual; @@ -2151,7 +2152,9 @@ codeunit 134422 "Rep. Selections - Std. Stmt." [Scope('OnPrem')] procedure UT_CustomReportSelection_CheckSendToEmail() var +#if not CLEAN29 CustomReportLayout: Record "Custom Report Layout"; +#endif CustomReportSelection: Record "Custom Report Selection"; Customer: Record Customer; DataRecRef: RecordRef; @@ -2162,10 +2165,16 @@ codeunit 134422 "Rep. Selections - Std. Stmt." CreateCustomer(Customer); +#if not CLEAN29 InsertCustomReportSelectionCustomer( CustomReportSelection, Customer."No.", GetStandardStatementReportID(), true, true, CustomReportLayout.InitBuiltInLayout(GetStandardStatementReportID(), CustomReportLayout.Type::Word.AsInteger()), '', CustomReportSelection.Usage::"C.Statement"); +#else + InsertCustomReportSelectionCustomer( + CustomReportSelection, Customer."No.", GetStandardStatementReportID(), true, true, '', + '', CustomReportSelection.Usage::"C.Statement"); +#endif DataRecRef.GETTABLE(Customer); asserterror CustomReportSelection.CheckEmailSendTo(DataRecRef); @@ -2346,7 +2355,9 @@ codeunit 134422 "Rep. Selections - Std. Stmt." var Customer: array[2] of Record Customer; SalesHeader: Record "Sales Header"; +#if not CLEAN29 CustomReportLayout: Record "Custom Report Layout"; +#endif SendingProfileCode: Code[20]; CustomReportLayoutCode: Code[20]; begin @@ -2362,8 +2373,12 @@ codeunit 134422 "Rep. Selections - Std. Stmt." CreateSalesInvoice(SalesHeader, Customer[1]); LibrarySales.PostSalesDocument(SalesHeader, true, true); +#if not CLEAN29 // [GIVEN] Custom Report Layout RL1 with Report ID 1316 and Type RDLC. CustomReportLayoutCode := CustomReportLayout.InitBuiltInLayout(1316, CustomReportLayout.Type::RDLC.AsInteger()); +#else + CustomReportLayoutCode := ''; +#endif // [GIVEN] Customer C2 with Customer Report Selections for Customer Statement with Report ID 1316 and Custom Layout Description RL1. LibrarySales.CreateCustomer(Customer[2]); @@ -2386,7 +2401,9 @@ codeunit 134422 "Rep. Selections - Std. Stmt." var Customer: array[2] of Record Customer; SalesHeader: Record "Sales Header"; +#if not CLEAN29 CustomReportLayout: Record "Custom Report Layout"; +#endif SendingProfileCode: Code[20]; CustomReportLayoutCode: Code[20]; begin @@ -2402,8 +2419,12 @@ codeunit 134422 "Rep. Selections - Std. Stmt." CreateSalesInvoice(SalesHeader, Customer[1]); LibrarySales.PostSalesDocument(SalesHeader, true, true); +#if not CLEAN29 // [GIVEN] Custom Report Layout RL1 with Report ID 1316 and Type RDLC. CustomReportLayoutCode := CustomReportLayout.InitBuiltInLayout(1316, CustomReportLayout.Type::RDLC.AsInteger()); +#else + CustomReportLayoutCode := ''; +#endif // [GIVEN] Customer C2 with Customer Report Selections for Customer Statement with Report ID 1316 and Custom Layout Description RL1. // [GIVEN] Customer C2 has Document Sending Profile P1 and posted Sales Invoice. @@ -2715,7 +2736,9 @@ codeunit 134422 "Rep. Selections - Std. Stmt." SalesHeader: Record "Sales Header"; ReportSelections: Record "Report Selections"; CustomReportSelection: Record "Custom Report Selection"; +#if not CLEAN29 CustomReportLayout: Record "Custom Report Layout"; +#endif CustomReportLayoutCode: Code[20]; begin CreateCustomer(Customer); @@ -2725,12 +2748,16 @@ codeunit 134422 "Rep. Selections - Std. Stmt." InsertReportSelections( ReportSelections, GetStandardStatementReportID(), false, false, '', ReportSelections.Usage::"C.Statement"); +#if not CLEAN29 CustomReportLayout.SetRange("Report ID", ReportId); CustomReportLayout.SetRange(Type, CustomReportLayout.Type::Word); if CustomReportLayout.FindFirst() then CustomReportLayoutCode := CustomReportLayout.Code else CustomReportLayoutCode := CustomReportLayout.InitBuiltInLayout(ReportId, CustomReportLayout.Type::Word.AsInteger()); +#else + CustomReportLayoutCode := ''; +#endif InsertCustomReportSelectionCustomer( CustomReportSelection, Customer."No.", ReportId, true, true, @@ -2741,7 +2768,9 @@ codeunit 134422 "Rep. Selections - Std. Stmt." var ReportSelections: Record "Report Selections"; CustomReportSelection: Record "Custom Report Selection"; +#if not CLEAN29 CustomReportLayout: Record "Custom Report Layout"; +#endif CustomReportLayoutCode: Code[20]; begin CreateCustomer(Customer); @@ -2749,12 +2778,16 @@ codeunit 134422 "Rep. Selections - Std. Stmt." InsertReportSelections( ReportSelections, GetStandardStatementReportID(), false, false, '', ReportSelections.Usage::"C.Statement"); +#if not CLEAN29 CustomReportLayout.SetRange("Report ID", ReportId); CustomReportLayout.SetRange(Type, CustomReportLayout.Type::Word); if CustomReportLayout.FindFirst() then CustomReportLayoutCode := CustomReportLayout.Code else CustomReportLayoutCode := CustomReportLayout.InitBuiltInLayout(ReportId, CustomReportLayout.Type::Word.AsInteger()); +#else + CustomReportLayoutCode := ''; +#endif InsertCustomReportSelectionCustomer( CustomReportSelection, Customer."No.", ReportId, true, true, @@ -2995,3 +3028,4 @@ codeunit 134422 "Rep. Selections - Std. Stmt." StandardStatement.SaveAsPdf(FileManagement.ServerTempFileName('.pdf')); end; } +#pragma warning restore AL0432, AS0105 diff --git a/src/Layers/W1/Tests/Report/ReportLayoutTest.Codeunit.al b/src/Layers/W1/Tests/Report/ReportLayoutTest.Codeunit.al index abe6664b865..44680564498 100644 --- a/src/Layers/W1/Tests/Report/ReportLayoutTest.Codeunit.al +++ b/src/Layers/W1/Tests/Report/ReportLayoutTest.Codeunit.al @@ -1,3 +1,4 @@ +#pragma warning disable AL0432, AS0105 codeunit 134600 "Report Layout Test" { // SaveAsPDF is not tested for Word scenarios as it currently requires Windows client and an installed Word. @@ -22,11 +23,15 @@ codeunit 134600 "Report Layout Test" LibraryUtility: Codeunit "Library - Utility"; LibraryRandom: Codeunit "Library - Random"; LibrarySales: Codeunit "Library - Sales"; +#pragma warning disable AA0137 LibraryTablesUT: Codeunit "Library - Tables UT"; +#pragma warning restore AA0137 LibraryVariableStorage: Codeunit "Library - Variable Storage"; LibraryTestInitialize: Codeunit "Library - Test Initialize"; LibrarySetupStorage: Codeunit "Library - Setup Storage"; +#if not CLEAN29 Usage: Option "Order Confirmation","Work Order","Pick Instruction"; +#endif IsInitialized: Boolean; local procedure Initialize() @@ -92,6 +97,7 @@ codeunit 134600 "Report Layout Test" asserterror ReportLayoutSelection.Validate(Type, ReportLayoutSelection.Type::"External Layout"); end; +#if not CLEAN29 [Test] [Scope('OnPrem')] procedure TestReportLayoutSelectionReportLayoutID() @@ -120,6 +126,7 @@ codeunit 134600 "Report Layout Test" // Verify Assert.IsTrue(ReportLayoutSelection.Type = ReportLayoutSelection.Type::"RDLC (built-in)", ''); end; +#endif [Test] [Scope('OnPrem')] @@ -133,6 +140,7 @@ codeunit 134600 "Report Layout Test" end; +#if not CLEAN29 [Test] [Scope('OnPrem')] procedure TestTableCustomReportLayoutTriggers() @@ -175,6 +183,7 @@ codeunit 134600 "Report Layout Test" CustomReportLayout.ClearLayout(); Assert.IsFalse(CustomReportLayout.ValidateLayout(false, false), ''); end; +#endif #if not CLEAN28 [Test] @@ -203,6 +212,7 @@ codeunit 134600 "Report Layout Test" end; #endif +#if not CLEAN29 [Test] [Scope('OnPrem')] procedure TestCopyRecord() @@ -283,6 +293,7 @@ codeunit 134600 "Report Layout Test" // Validate Assert.IsTrue(StrPos(GetLastErrorText, 'The RDLC layout does not comply with the current report design (for example') = 1, ''); end; +#endif [Test] [Scope('OnPrem')] @@ -555,6 +566,7 @@ codeunit 134600 "Report Layout Test" VerifyRun(REPORT::"Test Report - Processing Only"); end; +#if not CLEAN29 [Test] [HandlerFunctions('ScheduleAReportHandlerCancel')] [Scope('OnPrem')] @@ -648,6 +660,7 @@ codeunit 134600 "Report Layout Test" VerifySchedule(REPORT::"Test Report - Processing Only"); VerifyRun(REPORT::"Test Report - Processing Only"); end; +#endif [Test] [Scope('OnPrem')] @@ -667,6 +680,7 @@ codeunit 134600 "Report Layout Test" CompanyInformation.FieldCaption("Registration No."), CompanyInformation.GetRegistrationNumberLbl(), WrongRegNoLblErr); end; +#if not CLEAN29 [Test] [HandlerFunctions('WorkOrder_RPH')] [Scope('OnPrem')] @@ -753,6 +767,7 @@ codeunit 134600 "Report Layout Test" // [THEN] REP 1305 "Order Confirmation" is shown // OrderConfirmation_RPH end; +#endif [Test] [HandlerFunctions('StandardSalesInvoiceRequestPageHandler')] @@ -795,21 +810,28 @@ codeunit 134600 "Report Layout Test" VerifyJobTaskNo(20000, SalesLine[2]."Job Task No."); end; +#if not CLEAN29 [Test] [Scope('OnPrem')] procedure TestLenghtOfDescriptionCustomReportLayout() var +#pragma warning disable AL0432 CustomReportLayout: Record "Custom Report Layout"; +#pragma warning restore AL0432 CustomReportSelection: Record "Custom Report Selection"; begin // [FEATURE] [UT] // [SCENARIO 252058] Length of "Custom Report Layout"."Description" shoud be equal to length of "Custom Report Selection"."Custom Report Description" +#pragma warning disable AL0432 LibraryTablesUT.CompareFieldTypeAndLength( CustomReportLayout, CustomReportLayout.FieldNo(Description), CustomReportSelection, CustomReportSelection.FieldNo("Custom Report Description")); +#pragma warning restore AL0432 end; +#endif +#if not CLEAN29 [Test] [HandlerFunctions('MessageHandler')] [Scope('OnPrem')] @@ -855,7 +877,9 @@ codeunit 134600 "Report Layout Test" // and getting Sales Header RecordId to be sure it point to correct record "SO" Assert.ExpectedMessage(Format(SalesHeader.RecordId()), LibraryVariableStorage.DequeueText()); // message from MessageHandler end; +#endif +#if not CLEAN29 local procedure InitCustomReportLayout(var CustomReportLayout: Record "Custom Report Layout"; LayoutType: Enum "Custom Report Layout Type"; WithCompanyName: Boolean) var LayoutCode: Code[20]; @@ -868,14 +892,17 @@ codeunit 134600 "Report Layout Test" CustomReportLayout.Modify(true); end; end; +#endif local procedure InitReportSelection(ReportID: Integer; Selection: Option "None","RDLC (Built-in)","Word (Built-in)","Custom RDLC","Custom Word","Excel Layout","External Layout") var ReportLayoutSelection: Record "Report Layout Selection"; TenantReportLayoutSelection: Record "Tenant Report Layout Selection"; ReportLayoutList: Record "Report Layout List"; +#if not CLEAN29 CustomReportLayout: Record "Custom Report Layout"; LayoutCode: Code[20]; +#endif begin if ReportLayoutSelection.Get(ReportID, CompanyName) then ReportLayoutSelection.Delete(); @@ -895,6 +922,7 @@ codeunit 134600 "Report Layout Test" ReportLayoutSelection.Type := ReportLayoutSelection.Type::"RDLC (built-in)"; Selection::"Word (Built-in)": ReportLayoutSelection.Type := ReportLayoutSelection.Type::"Word (built-in)"; +#if not CLEAN29 Selection::"Custom RDLC": begin ReportLayoutSelection.Type := ReportLayoutSelection.Type::"Custom Layout"; @@ -909,6 +937,7 @@ codeunit 134600 "Report Layout Test" CustomReportLayout.Get(LayoutCode); ReportLayoutSelection."Custom Report Layout Code" := CustomReportLayout.Code; end; +#endif Selection::"Excel Layout": begin SetupSelection(ReportLayoutList, TenantReportLayoutSelection, ReportLayoutList."Layout Format"::Excel); @@ -942,6 +971,7 @@ codeunit 134600 "Report Layout Test" TenantReportLayoutSelection.DeleteAll(true); end; +#if not CLEAN29 local procedure AddOrderConfirmationToCustomReportLayout(): Code[20] var CustomReportLayout: Record "Custom Report Layout"; @@ -960,7 +990,9 @@ codeunit 134600 "Report Layout Test" CustomerNo, CustomReportSelection.Usage::"S.Order", REPORT::"Standard Sales - Order Conf.", AddOrderConfirmationToCustomReportLayout()); end; +#endif +#if not CLEAN29 local procedure AddCustomerDocumentLayoutReport(CustomerNo: Code[20]; NewUsage: Enum "Report Selection Usage"; ReportID: Integer; CustomReportLayoutCode: Code[20]) var CustomReportSelection: Record "Custom Report Selection"; @@ -974,6 +1006,7 @@ codeunit 134600 "Report Layout Test" CustomReportSelection."Custom Report Layout Code" := CustomReportLayoutCode; CustomReportSelection.Insert(true); end; +#endif local procedure CreateSalesLineWithJobTaskNo(SalesHeader: Record "Sales Header"; var SalesLine: Record "Sales Line") var @@ -1204,4 +1237,5 @@ codeunit 134600 "Report Layout Test" end; end; -} \ No newline at end of file +} +#pragma warning restore AL0432, AS0105 diff --git a/src/Layers/W1/Tests/Report/TestCustomReports.Codeunit.al b/src/Layers/W1/Tests/Report/TestCustomReports.Codeunit.al index d7b95dcad64..4ffa7722339 100644 --- a/src/Layers/W1/Tests/Report/TestCustomReports.Codeunit.al +++ b/src/Layers/W1/Tests/Report/TestCustomReports.Codeunit.al @@ -1,3 +1,4 @@ +#pragma warning disable AL0432, AS0105 codeunit 134761 "Test Custom Reports" { EventSubscriberInstance = Manual; @@ -13,7 +14,9 @@ codeunit 134761 "Test Custom Reports" CustomerFullMod: Record Customer; CustomerPartialMod: Record Customer; CustomerNoMod: Record Customer; +#if not CLEAN29 CustomReportLayout: Record "Custom Report Layout"; +#endif QuoteSalesHeaderFullMod: Record "Sales Header"; OrderSalesHeaderFullMod: Record "Sales Header"; InvoiceSalesHeaderFullMod: Record "Sales Header"; @@ -37,7 +40,9 @@ codeunit 134761 "Test Custom Reports" Assert: Codeunit Assert; LibrarySales: Codeunit "Library - Sales"; LibraryInventory: Codeunit "Library - Inventory"; +#if not CLEAN29 LibraryPurchase: Codeunit "Library - Purchase"; +#endif LibraryVariableStorage: Codeunit "Library - Variable Storage"; LibraryTestInitialize: Codeunit "Library - Test Initialize"; LibraryUtility: Codeunit "Library - Utility"; @@ -51,9 +56,11 @@ codeunit 134761 "Test Custom Reports" IsInitialized: Boolean; ExpectedFilesErr: Label 'Expected files as report output in temporary directory. None found.', Comment = '%1, filename.'; TempFolderIndex: Integer; +#if not CLEAN29 StandardStatementModTxt: Label 'Standard Statement Mod'; StatementModTxt: Label 'Statement Mod'; StandardStatementFullModTxt: Label 'Standard Statement Full Mod'; +#endif InvoiceDiscountTxt: Label 'Invoice Discount'; SubtotalTxt: Label 'Subtotal'; DescriptionReportTotalsLineTxt: Label 'Description_ReportTotalsLine'; @@ -69,10 +76,15 @@ codeunit 134761 "Test Custom Reports" begin LibrarySales.CreateCustomer(CustomerFullMod); +#if not CLEAN29 CreateCustomReportLayout(REPORT::"Standard Sales - Quote", CustomReportLayout.Type::Word, 'Quote Customer Full Mod'); AssignCustomLayoutToCustomer( DATABASE::Customer, CustomerFullMod."No.", CustomReportSelection.Usage::"S.Quote", REPORT::"Standard Sales - Quote", CustomReportLayout.Code); +#else + AssignCustomLayoutToCustomer( + DATABASE::Customer, CustomerFullMod."No.", CustomReportSelection.Usage::"S.Quote", REPORT::"Standard Sales - Quote", ''); +#endif CustomReportSelection.SetRange("Source Type", DATABASE::Customer); CustomReportSelection.SetRange("Source No.", CustomerFullMod."No."); @@ -87,7 +99,9 @@ codeunit 134761 "Test Custom Reports" Assert.IsFalse(CustomReportSelection.FindFirst(), 'Customer.OnDelete failed to remove CustomReportSelection'); Clear(CustomReportSelection); +#if not CLEAN29 CustomReportLayout.DeleteAll(); +#endif end; [Test] @@ -776,6 +790,7 @@ codeunit 134761 "Test Custom Reports" Assert.ExpectedError(ReportIDMustHaveValueErr); end; +#if not CLEAN29 [Test] [Scope('OnPrem')] procedure UT_CleanEmailBodyLayoutCode_OnReportIdValidate() @@ -810,6 +825,7 @@ codeunit 134761 "Test Custom Reports" CustomReportSelection.TestField("Custom Report Layout Code", ''); CustomReportSelection.TestField("Use for Email Body", true); end; +#endif [Test] [Scope('OnPrem')] @@ -1091,6 +1107,7 @@ codeunit 134761 "Test Custom Reports" Assert.IsTrue(PurchCrMemoLine.HasTypeToFillMandatoryFields(), ''); end; +#if not CLEAN29 [Test] [HandlerFunctions('StandardStatementDefaultLayoutHandler,StatementCancelHandler')] [Scope('OnPrem')] @@ -1201,6 +1218,7 @@ codeunit 134761 "Test Custom Reports" // Tear down InitReportSelections(); end; +#endif [Test] [Scope('OnPrem')] @@ -1360,7 +1378,9 @@ codeunit 134761 "Test Custom Reports" // Clean out existing data and set up new ReportLayoutSelection.DeleteAll(); CustomReportSelection.DeleteAll(); +#if not CLEAN29 CustomReportLayout.DeleteAll(); +#endif InitReportSelections(); @@ -1368,49 +1388,85 @@ codeunit 134761 "Test Custom Reports" LibrarySales.CreateCustomer(CustomerPartialMod); LibrarySales.CreateCustomer(CustomerNoMod); Clear(CustomReportSelection); +#if not CLEAN29 CreateCustomReportLayout(REPORT::"Standard Sales - Quote", CustomReportLayout.Type::Word, 'Quote Customer Full Mod'); AssignCustomLayoutToCustomer( DATABASE::Customer, CustomerFullMod."No.", CustomReportSelection.Usage::"S.Quote", REPORT::"Standard Sales - Quote", CustomReportLayout.Code); +#else + AssignCustomLayoutToCustomer( + DATABASE::Customer, CustomerFullMod."No.", CustomReportSelection.Usage::"S.Quote", REPORT::"Standard Sales - Quote", ''); +#endif Clear(CustomReportSelection); +#if not CLEAN29 CreateCustomReportLayout(REPORT::"Standard Sales - Order Conf.", CustomReportLayout.Type::Word, 'Order Customer Full Mod'); AssignCustomLayoutToCustomer( DATABASE::Customer, CustomerFullMod."No.", CustomReportSelection.Usage::"S.Order", REPORT::"Standard Sales - Order Conf.", CustomReportLayout.Code); +#else + AssignCustomLayoutToCustomer( + DATABASE::Customer, CustomerFullMod."No.", CustomReportSelection.Usage::"S.Order", REPORT::"Standard Sales - Order Conf.", ''); +#endif Clear(CustomReportSelection); +#if not CLEAN29 CreateCustomReportLayout(REPORT::"Standard Sales - Invoice", CustomReportLayout.Type::Word, 'Invoice Customer Full Mod'); AssignCustomLayoutToCustomer( DATABASE::Customer, CustomerFullMod."No.", CustomReportSelection.Usage::"S.Invoice", REPORT::"Standard Sales - Invoice", CustomReportLayout.Code); +#else + AssignCustomLayoutToCustomer( + DATABASE::Customer, CustomerFullMod."No.", CustomReportSelection.Usage::"S.Invoice", REPORT::"Standard Sales - Invoice", ''); +#endif Clear(CustomReportSelection); +#if not CLEAN29 CreateCustomReportLayout(REPORT::"Standard Sales - Credit Memo", CustomReportLayout.Type::Word, 'Credit Memo Customer Full Mod'); AssignCustomLayoutToCustomer( DATABASE::Customer, CustomerFullMod."No.", CustomReportSelection.Usage::"S.Cr.Memo", REPORT::"Standard Sales - Credit Memo", CustomReportLayout.Code); +#else + AssignCustomLayoutToCustomer( + DATABASE::Customer, CustomerFullMod."No.", CustomReportSelection.Usage::"S.Cr.Memo", + REPORT::"Standard Sales - Credit Memo", ''); +#endif Clear(CustomReportSelection); +#if not CLEAN29 CreateCustomReportLayout(REPORT::"Standard Statement", CustomReportLayout.Type::Word, StandardStatementFullModTxt); AssignCustomLayoutToCustomer( DATABASE::Customer, CustomerFullMod."No.", CustomReportSelection.Usage::"C.Statement", REPORT::"Standard Statement", CustomReportLayout.Code); +#else + AssignCustomLayoutToCustomer( + DATABASE::Customer, CustomerFullMod."No.", CustomReportSelection.Usage::"C.Statement", REPORT::"Standard Statement", ''); +#endif CustomReportSelection."Send To Email" := 'test@contoso.com'; CustomReportSelection.Modify(); Clear(CustomReportSelection); +#if not CLEAN29 CreateCustomReportLayout(REPORT::Statement, CustomReportLayout.Type::RDLC, StatementModTxt); AssignCustomLayoutToCustomer( DATABASE::Customer, CustomerFullMod."No.", CustomReportSelection.Usage::"C.Statement", REPORT::Statement, CustomReportLayout.Code); +#else + AssignCustomLayoutToCustomer( + DATABASE::Customer, CustomerFullMod."No.", CustomReportSelection.Usage::"C.Statement", REPORT::Statement, ''); +#endif Clear(CustomReportSelection); +#if not CLEAN29 CreateCustomReportLayout(REPORT::"Standard Statement", CustomReportLayout.Type::Word, StandardStatementModTxt); AssignCustomLayoutToCustomer( DATABASE::Customer, CustomerFullMod."No.", CustomReportSelection.Usage::"C.Statement", REPORT::"Standard Statement", CustomReportLayout.Code); +#else + AssignCustomLayoutToCustomer( + DATABASE::Customer, CustomerFullMod."No.", CustomReportSelection.Usage::"C.Statement", REPORT::"Standard Statement", ''); +#endif CreateSalesRecord(QuoteSalesHeaderFullMod, QuoteSalesHeaderFullMod."Document Type"::Quote, CustomerFullMod); CreateSalesRecord(OrderSalesHeaderFullMod, QuoteSalesHeaderFullMod."Document Type"::Order, CustomerFullMod); @@ -1497,6 +1553,7 @@ codeunit 134761 "Test Custom Reports" CustomerReportSelections.Usage2.SetValue(Usage); end; +#if not CLEAN29 local procedure CreateCustomReportLayout(ReportID: Integer; LayoutType: Enum "Custom Report Layout Type"; Description: Text[80]) begin CustomReportLayout.Init(); @@ -1506,6 +1563,7 @@ codeunit 134761 "Test Custom Reports" CustomReportLayout.Description := Description; CustomReportLayout.Modify(); end; +#endif local procedure CreateSalesRecord(var SalesHeader: Record "Sales Header"; DocType: Enum "Sales Document Type"; Customer: Record Customer) var @@ -2143,6 +2201,7 @@ codeunit 134761 "Test Custom Reports" RequestPage.OK().Invoke(); end; +#if not CLEAN29 [RequestPageHandler] [Scope('OnPrem')] procedure StatementCancelHandler(var RequestPage: TestRequestPage Statement) @@ -2168,6 +2227,7 @@ codeunit 134761 "Test Custom Reports" begin PurchaseInvoice.Cancel().Invoke(); end; +#endif [ReportHandler] [Scope('OnPrem')] @@ -2211,11 +2271,14 @@ codeunit 134761 "Test Custom Reports" AddNewCustomerReportSelection(CustomerReportSelections, Usage::"Credit Memo", REPORT::"G/L Register"); end; +#if not CLEAN29 [ModalPageHandler] [Scope('OnPrem')] procedure CustomerReportSelectionHandler(var CustomerReportSelections: TestPage "Customer Report Selections") var +#pragma warning disable AL0432 ExpectedCustomReportLayout: Record "Custom Report Layout"; +#pragma warning restore AL0432 begin ExpectedCustomReportLayout.Get(LibraryVariableStorage.DequeueText()); @@ -2238,6 +2301,7 @@ codeunit 134761 "Test Custom Reports" ExpectedCustomReportLayout.Code, CustomReportSelection."Custom Report Layout Code", 'Incorrect Value in Customer Report Selections'); end; +#endif [RequestPageHandler] [Scope('OnPrem')] @@ -2259,3 +2323,4 @@ codeunit 134761 "Test Custom Reports" TestMode := true end; } +#pragma warning restore AL0432, AS0105 diff --git a/src/Layers/W1/Tests/SCM-Service/ServiceOrders.Codeunit.al b/src/Layers/W1/Tests/SCM-Service/ServiceOrders.Codeunit.al index 28564846ec7..ecc822533ef 100644 --- a/src/Layers/W1/Tests/SCM-Service/ServiceOrders.Codeunit.al +++ b/src/Layers/W1/Tests/SCM-Service/ServiceOrders.Codeunit.al @@ -17,7 +17,9 @@ using Microsoft.Finance.VAT.Setup; using Microsoft.Foundation.Address; using Microsoft.Foundation.ExtendedText; using Microsoft.Foundation.NoSeries; +#if not CLEAN29 using Microsoft.Foundation.Reporting; +#endif using Microsoft.Foundation.Shipping; using Microsoft.Foundation.UOM; using Microsoft.Inventory.Item; @@ -55,6 +57,7 @@ using System.IO; using System.Security.User; using System.TestLibraries.Utilities; +#pragma warning disable AL0432, AS0105 codeunit 136101 "Service Orders" { EventSubscriberInstance = Manual; @@ -5815,6 +5818,7 @@ codeunit 136101 "Service Orders" Assert.AreEqual(Customer[2]."Country/Region Code", ServiceHeader."VAT Country/Region Code", VATCountryRegionLbl); end; +#if not CLEAN29 [Test] [HandlerFunctions('ServiceOrderReportRequestPageHandler')] procedure PrintServiceOrderWithWorkDescription() @@ -5847,6 +5851,7 @@ codeunit 136101 "Service Orders" // [THEN] Verify no transaction error should occur. end; +#endif [Test] [Scope('OnPrem')] @@ -8244,6 +8249,7 @@ codeunit 136101 "Service Orders" exit(ServiceInvoiceHeader."No."); end; +#if not CLEAN29 local procedure CreateCustomReportSelectionForCustomer(CustomerNo: Code[20]; ReportSelectionUsage: Enum "Report Selection Usage"; ReportID: Integer) var CustomReportSelection: Record "Custom Report Selection"; @@ -8260,6 +8266,7 @@ codeunit 136101 "Service Orders" "Email Body Layout Code", CustomReportLayout.InitBuiltInLayout(CustomReportSelection."Report ID", CustomReportLayout.Type::Word.AsInteger())); CustomReportSelection.Insert(true); end; +#endif local procedure CreateShipmentMethod(var ShipmentMethod: Record "Shipment Method") begin @@ -8608,4 +8615,5 @@ codeunit 136101 "Service Orders" ServiceOrder.Cancel().Invoke(); end; } +#pragma warning restore AL0432, AS0105