-
Notifications
You must be signed in to change notification settings - Fork 444
MSlenejennum/647452/new header and footer layouts and report themes #10489
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
MSlenejennum
wants to merge
37
commits into
main
Choose a base branch
from
MSlenejennum/647452/New-Header-and-Footer-Layouts-and-Report-Themes
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 32 commits
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
02c3a97
Seed the shipped header/footer and report theme parts on install and …
MSlenejennum e5fa8ba
edit the insert function
MSlenejennum 118ecc1
Removed comments
MSlenejennum e088a18
Merge branch 'main' of https://github.com/microsoft/BCApps into MSlen…
MSlenejennum 147fb2b
Update Tag
MSlenejennum f985ce9
Merge branch 'main' of https://github.com/microsoft/BCApps into MSlen…
MSlenejennum 5884962
Merge branch 'main' of https://github.com/microsoft/BCApps into MSlen…
MSlenejennum aa288fe
New testscript
MSlenejennum 120315e
Changed the dotx to use size from each style instead of documentdef
MSlenejennum c1128df
tested with full flow
MSlenejennum 2852ae1
Apply suggestions from code review
MSlenejennum 2132e36
Fixed Coments
MSlenejennum 60da11e
Merge branch 'MSlenejennum/647452/New-Header-and-Footer-Layouts-and-R…
MSlenejennum 6836adb
Remove temp
MSlenejennum ef7c841
Edited the install and upgrade codeunit
MSlenejennum 552eaa4
fixed tags
MSlenejennum 5ab4dab
fixes
MSlenejennum 0dab2fe
fix
MSlenejennum 50ed203
corrected error
MSlenejennum e739b49
Simplify
MSlenejennum 7c67514
Changes
MSlenejennum 6c49157
commit
MSlenejennum 9a01616
rettet kommentarer
MSlenejennum ed55413
commit
MSlenejennum 8a61d5c
Remove unused using directive in BaseAppInstall to fix AL0792
Copilot d435aa2
Fix unused using and clean the tenant part clone in test setup
MSlenejennum c3402a3
LOCAL PROCEDURE
MSlenejennum 884bad5
LOCALA
MSlenejennum 610ba64
changed sorting order on variable
MSlenejennum e8db8a3
Merge branch 'MSlenejennum/647452/New-Header-and-Footer-Layouts-and-R…
MSlenejennum 3cc0cc4
edit 3 comments
MSlenejennum f2ee3ac
Changes test
MSlenejennum 5a431d2
Fix FI legacy composite layout test expectations
Copilot 3b9cd6f
fjernet dobbelt funktion
MSlenejennum b4ab214
Merge branch 'MSlenejennum/647452/New-Header-and-Footer-Layouts-and-R…
MSlenejennum cef1145
Fix seeding assignment cleanup and the unreadable-resource path
v-mortenr cc5e4e4
Separate the detail text for a resource that is not packaged
v-mortenr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+57.9 KB
src/Layers/W1/BaseApp/.resources/ReportParts/HeaderFooterDesign/ExternalDefault.docx
Binary file not shown.
Binary file added
BIN
+60.2 KB
src/Layers/W1/BaseApp/.resources/ReportParts/HeaderFooterDesign/ExternalDefaultDetailed.docx
Binary file not shown.
Binary file added
BIN
+57.2 KB
src/Layers/W1/BaseApp/.resources/ReportParts/HeaderFooterDesign/ExternalMinimalistic.docx
Binary file not shown.
Binary file added
BIN
+58.7 KB
...rs/W1/BaseApp/.resources/ReportParts/HeaderFooterDesign/ExternalMinimalisticDetailed.docx
Binary file not shown.
Binary file added
BIN
+56.2 KB
src/Layers/W1/BaseApp/.resources/ReportParts/HeaderFooterDesign/ExternalModern.docx
Binary file not shown.
Binary file added
BIN
+56.1 KB
src/Layers/W1/BaseApp/.resources/ReportParts/HeaderFooterDesign/ExternalModernLogo.docx
Binary file not shown.
Binary file added
BIN
+86.6 KB
src/Layers/W1/BaseApp/.resources/ReportParts/HeaderFooterDesign/InternalDefault.docx
Binary file not shown.
Binary file added
BIN
+50.7 KB
src/Layers/W1/BaseApp/.resources/ReportParts/HeaderFooterDesign/InternalMinimalistic.docx
Binary file not shown.
Binary file added
BIN
+53 KB
...rs/W1/BaseApp/.resources/ReportParts/HeaderFooterDesign/InternalMinimalisticCentered.docx
Binary file not shown.
Binary file added
BIN
+52.5 KB
src/Layers/W1/BaseApp/.resources/ReportParts/HeaderFooterDesign/InternalModern.docx
Binary file not shown.
Binary file added
BIN
+53.6 KB
src/Layers/W1/BaseApp/.resources/ReportParts/HeaderFooterDesign/InternalModernMaxi.docx
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+5.21 MB
src/Layers/W1/BaseApp/.resources/ReportParts/ReportTheme/Playful.dotx
Binary file not shown.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
210 changes: 210 additions & 0 deletions
210
src/Layers/W1/BaseApp/Foundation/Reporting/CompositeReportPartsMgt.Codeunit.al
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,210 @@ | ||
| // ------------------------------------------------------------------------------------------------ | ||
| // Copyright (c) Microsoft Corporation. All rights reserved. | ||
| // Licensed under the MIT License. See License.txt in the project root for license information. | ||
| // ------------------------------------------------------------------------------------------------ | ||
| namespace Microsoft.Foundation.Reporting; | ||
|
|
||
| using System.Environment.Configuration; | ||
| using System.Reflection; | ||
| using System.Utilities; | ||
|
|
||
| /// <summary> | ||
|
MSlenejennum marked this conversation as resolved.
|
||
| /// Seeds the shipped Composite Layout theme and header/footer parts under Tenant Report Defaults on install and | ||
| /// upgrade, stored under this app's own App ID, and removes the parts this version no longer ships. Every part is a | ||
| /// resource of this app, so one that cannot be read or written is a build defect and is raised rather than skipped. | ||
| /// </summary> | ||
| codeunit 9667 "Composite Report Parts Mgt." | ||
| { | ||
| Access = Internal; | ||
|
|
||
| internal procedure SeedDefaultParts() | ||
|
v-mortenr marked this conversation as resolved.
|
||
| begin | ||
| SeedPart(ExternalDefaultTxt, 'ReportParts/HeaderFooterDesign/ExternalDefault.docx', Enum::"Report Layout Subtype"::HeaderFooter, ExternalDefaultDescTxt); | ||
| SeedPart(ExternalDefaultDetailedTxt, 'ReportParts/HeaderFooterDesign/ExternalDefaultDetailed.docx', Enum::"Report Layout Subtype"::HeaderFooter, ExternalDefaultDetailedDescTxt); | ||
| SeedPart(ExternalMinimalisticTxt, 'ReportParts/HeaderFooterDesign/ExternalMinimalistic.docx', Enum::"Report Layout Subtype"::HeaderFooter, ExternalMinimalisticDescTxt); | ||
| SeedPart(ExternalMinimalisticDetailedTxt, 'ReportParts/HeaderFooterDesign/ExternalMinimalisticDetailed.docx', Enum::"Report Layout Subtype"::HeaderFooter, ExternalMinimalisticDetailedDescTxt); | ||
| SeedPart(ExternalModernTxt, 'ReportParts/HeaderFooterDesign/ExternalModern.docx', Enum::"Report Layout Subtype"::HeaderFooter, ExternalModernDescTxt); | ||
| SeedPart(ExternalModernLogoTxt, 'ReportParts/HeaderFooterDesign/ExternalModernLogo.docx', Enum::"Report Layout Subtype"::HeaderFooter, ExternalModernLogoDescTxt); | ||
|
|
||
| SeedPart(InternalDefaultTxt, 'ReportParts/HeaderFooterDesign/InternalDefault.docx', Enum::"Report Layout Subtype"::HeaderFooter, InternalDefaultDescTxt); | ||
| SeedPart(InternalMinimalisticCenteredTxt, 'ReportParts/HeaderFooterDesign/InternalMinimalisticCentered.docx', Enum::"Report Layout Subtype"::HeaderFooter, InternalMinimalisticCenteredDescTxt); | ||
| SeedPart(InternalMinimalisticTxt, 'ReportParts/HeaderFooterDesign/InternalMinimalistic.docx', Enum::"Report Layout Subtype"::HeaderFooter, InternalMinimalisticDescTxt); | ||
| SeedPart(InternalModernTxt, 'ReportParts/HeaderFooterDesign/InternalModern.docx', Enum::"Report Layout Subtype"::HeaderFooter, InternalModernDescTxt); | ||
| SeedPart(InternalModernMaxiTxt, 'ReportParts/HeaderFooterDesign/InternalModernMaxi.docx', Enum::"Report Layout Subtype"::HeaderFooter, InternalModernMaxiDescTxt); | ||
|
|
||
| SeedPart(DefaultThemeTxt, 'ReportParts/ReportTheme/Default.dotx', Enum::"Report Layout Subtype"::Theme, DefaultThemeDescTxt); | ||
| SeedPart(CalmThemeTxt, 'ReportParts/ReportTheme/Calm.dotx', Enum::"Report Layout Subtype"::Theme, CalmThemeDescTxt); | ||
| SeedPart(PlayfulThemeTxt, 'ReportParts/ReportTheme/Playful.dotx', Enum::"Report Layout Subtype"::Theme, PlayfulThemeDescTxt); | ||
|
|
||
| PruneRetiredParts(); | ||
| end; | ||
|
|
||
| internal procedure SeedPart(PartName: Text[250]; ResourceFile: Text; Subtype: Enum "Report Layout Subtype"; Description: Text) | ||
| var | ||
| TenantReportLayout: Record "Tenant Report Layout"; | ||
| CompositeLayoutLookupHelper: Codeunit "Composite Layout Lookup Helper"; | ||
| PartLayout: Codeunit "Temp Blob"; | ||
| LayoutInStream: InStream; | ||
| begin | ||
| ClearLastError(); | ||
| if not TryGetPartLayout(ResourceFile, PartLayout) then | ||
| Error(ResourceNotReadableError(PartName, ResourceFile)); | ||
|
|
||
| RemovePart(PartName, GetShippedPartAppId()); | ||
|
|
||
| TenantReportLayout.Init(); | ||
| TenantReportLayout."Report ID" := CompositeLayoutLookupHelper.GetTenantReportDefaultsReportID(); | ||
| TenantReportLayout.Name := PartName; | ||
| TenantReportLayout."App ID" := GetShippedPartAppId(); | ||
| TenantReportLayout."Company Name" := ''; | ||
| TenantReportLayout."Layout Format" := TenantReportLayout."Layout Format"::Word; | ||
| TenantReportLayout."Layout Subtype" := Subtype; | ||
| TenantReportLayout.Description := CopyStr(Description, 1, MaxStrLen(TenantReportLayout.Description)); | ||
| TenantReportLayout."Layout Status" := TenantReportLayout."Layout Status"::Approved; | ||
| TenantReportLayout."MIME Type" := PartMimeType(Subtype); | ||
| PartLayout.CreateInStream(LayoutInStream); | ||
| TenantReportLayout.Layout.ImportStream(LayoutInStream, PartName); | ||
| TenantReportLayout.Insert(true); | ||
| end; | ||
|
|
||
| [TryFunction] | ||
| local procedure TryGetPartLayout(ResourceFile: Text; var PartLayout: Codeunit "Temp Blob") | ||
| var | ||
| ResourceInStream: InStream; | ||
| PartLayoutOutStream: OutStream; | ||
| begin | ||
| NavApp.GetResource(ResourceFile, ResourceInStream); | ||
|
|
||
| PartLayout.CreateOutStream(PartLayoutOutStream); | ||
| CopyStream(PartLayoutOutStream, ResourceInStream); | ||
| end; | ||
|
|
||
| local procedure ResourceNotReadableError(PartName: Text; ResourceFile: Text) LayoutErrorInfo: ErrorInfo | ||
| begin | ||
| LayoutErrorInfo.ErrorType := LayoutErrorInfo.ErrorType::Internal; | ||
| LayoutErrorInfo.Verbosity := LayoutErrorInfo.Verbosity::Error; | ||
| LayoutErrorInfo.DataClassification := LayoutErrorInfo.DataClassification::SystemMetadata; | ||
| LayoutErrorInfo.Message := StrSubstNo(ResourceNotReadableErr, PartName); | ||
| LayoutErrorInfo.DetailedMessage := StrSubstNo(ResourceNotReadableDetailTxt, ResourceFile, GetLastErrorText(true)); | ||
| end; | ||
|
|
||
| local procedure PruneRetiredParts() | ||
| var | ||
| TenantReportLayout: Record "Tenant Report Layout"; | ||
| TempPartsToDelete: Record "Tenant Report Layout" temporary; | ||
| CompositeLayoutLookupHelper: Codeunit "Composite Layout Lookup Helper"; | ||
| begin | ||
| TenantReportLayout.SetRange("Report ID", CompositeLayoutLookupHelper.GetTenantReportDefaultsReportID()); | ||
| TenantReportLayout.SetRange("App ID", GetShippedPartAppId()); | ||
| TenantReportLayout.SetLoadFields(Name, "Layout Subtype"); | ||
| if TenantReportLayout.FindSet() then | ||
| repeat | ||
| if not IsShippedPart(TenantReportLayout.Name) then begin | ||
| ClearAssignments(TenantReportLayout.Name, TenantReportLayout."Layout Subtype"); | ||
| TempPartsToDelete.Init(); | ||
| TempPartsToDelete."Report ID" := TenantReportLayout."Report ID"; | ||
| TempPartsToDelete.Name := TenantReportLayout.Name; | ||
| TempPartsToDelete.Insert(); | ||
| end; | ||
| until TenantReportLayout.Next() = 0; | ||
|
|
||
| if TempPartsToDelete.FindSet() then | ||
| repeat | ||
| RemovePart(TempPartsToDelete.Name, GetShippedPartAppId()); | ||
| until TempPartsToDelete.Next() = 0; | ||
| end; | ||
|
|
||
| local procedure ClearAssignments(PartName: Text[250]; Subtype: Enum "Report Layout Subtype") | ||
|
MSlenejennum marked this conversation as resolved.
|
||
| var | ||
| TenantReportLayoutCfg: Record "Tenant Report Layout Cfg"; | ||
| CompositeLayoutLookupHelper: Codeunit "Composite Layout Lookup Helper"; | ||
| Composite: Text; | ||
| begin | ||
| Composite := CompositeLayoutLookupHelper.EncodeCompositeName(GetShippedPartAppId(), PartName); | ||
| case Subtype of | ||
| Subtype::HeaderFooter: | ||
| begin | ||
| TenantReportLayoutCfg.SetRange("Header Part Name", CopyStr(Composite, 1, MaxStrLen(TenantReportLayoutCfg."Header Part Name"))); | ||
| TenantReportLayoutCfg.ModifyAll("Header Part Name", ''); | ||
| end; | ||
| Subtype::Theme: | ||
| begin | ||
| TenantReportLayoutCfg.SetRange("Theme Part Name", CopyStr(Composite, 1, MaxStrLen(TenantReportLayoutCfg."Theme Part Name"))); | ||
| TenantReportLayoutCfg.ModifyAll("Theme Part Name", ''); | ||
| end; | ||
| end; | ||
| end; | ||
|
|
||
| internal procedure GetShippedPartAppId() AppId: Guid | ||
| var | ||
| CurrentModuleInfo: ModuleInfo; | ||
|
MSlenejennum marked this conversation as resolved.
|
||
| begin | ||
| NavApp.GetCurrentModuleInfo(CurrentModuleInfo); | ||
| AppId := CurrentModuleInfo.Id; | ||
| end; | ||
|
|
||
| internal procedure IsShippedPart(PartName: Text): Boolean | ||
| begin | ||
| exit( | ||
| PartName in | ||
| [ExternalDefaultTxt, ExternalDefaultDetailedTxt, ExternalMinimalisticTxt, ExternalMinimalisticDetailedTxt, | ||
| ExternalModernTxt, ExternalModernLogoTxt, | ||
| InternalDefaultTxt, InternalMinimalisticCenteredTxt, InternalMinimalisticTxt, InternalModernTxt, InternalModernMaxiTxt, | ||
| DefaultThemeTxt, CalmThemeTxt, PlayfulThemeTxt]); | ||
| end; | ||
|
|
||
| local procedure RemovePart(PartName: Text[250]; AppId: Guid) | ||
| var | ||
| TenantReportLayout: Record "Tenant Report Layout"; | ||
| CompositeLayoutLookupHelper: Codeunit "Composite Layout Lookup Helper"; | ||
| begin | ||
| if TenantReportLayout.Get(CompositeLayoutLookupHelper.GetTenantReportDefaultsReportID(), PartName, AppId) then | ||
| TenantReportLayout.Delete(true); | ||
| end; | ||
|
|
||
| local procedure PartMimeType(Subtype: Enum "Report Layout Subtype"): Text[255] | ||
| begin | ||
| if Subtype = Subtype::Theme then | ||
| exit(ThemeMimeTypeTxt); | ||
|
|
||
| exit(HeaderFooterMimeTypeTxt); | ||
| end; | ||
|
|
||
| var | ||
| ExternalDefaultTxt: Label 'External Default', Locked = true; | ||
|
MSlenejennum marked this conversation as resolved.
|
||
| ExternalDefaultDetailedTxt: Label 'External Default Detailed', Locked = true; | ||
| ExternalMinimalisticTxt: Label 'External Minimalistic', Locked = true; | ||
| ExternalMinimalisticDetailedTxt: Label 'External Minimalistic Detailed', Locked = true; | ||
| ExternalModernTxt: Label 'External Modern', Locked = true; | ||
| ExternalModernLogoTxt: Label 'External Modern Logo', Locked = true; | ||
| InternalDefaultTxt: Label 'Internal Default', Locked = true; | ||
| InternalMinimalisticCenteredTxt: Label 'Internal Minimalistic Centered', Locked = true; | ||
| InternalMinimalisticTxt: Label 'Internal Minimalistic', Locked = true; | ||
| InternalModernTxt: Label 'Internal Modern', Locked = true; | ||
| InternalModernMaxiTxt: Label 'Internal Modern Maxi', Locked = true; | ||
| DefaultThemeTxt: Label 'Default', Locked = true; | ||
| CalmThemeTxt: Label 'Calm', Locked = true; | ||
| PlayfulThemeTxt: Label 'Playful', Locked = true; | ||
|
|
||
| ExternalDefaultDescTxt: Label 'Header/footer design for portrait or landscape. Header with company logo, report name, document date and page number; footer with homepage, phone, email and fax number. Standard external layout for customer-facing documents.'; | ||
| ExternalDefaultDetailedDescTxt: Label 'Header/footer design for portrait or landscape. Header with company logo, report name, document date and page number; footer with homepage, phone, email, fax plus bank, bank account, VAT reg. no. and giro no. Detailed external layout.'; | ||
| ExternalMinimalisticDescTxt: Label 'Header/footer design for portrait or landscape, minimalistic. Header with company logo and report name only; footer with page number, company name, homepage, phone, email and fax. A clean, light external layout.'; | ||
| ExternalMinimalisticDetailedDescTxt: Label 'Header/footer design for portrait or landscape, minimalistic. Header with company logo and report name; footer with page number, company name, homepage, phone, email, fax plus bank, bank account, VAT reg. no. and giro no.'; | ||
| ExternalModernDescTxt: Label 'Header/footer design for portrait or landscape, modern style without logo. Header with report name, document date and company name in uppercase; footer with page number and full contact details (homepage, phone, email, fax, VAT, giro, bank).'; | ||
| ExternalModernLogoDescTxt: Label 'Header/footer design for portrait or landscape. Header with company logo, report name, document date and page number; footer with homepage, phone, email, fax plus bank, bank account, VAT reg. no. and giro no. Modern external layout.'; | ||
| InternalDefaultDescTxt: Label 'Header/footer design for portrait or landscape, for internal documents. Header with company logo, report name and document date; footer with page number.'; | ||
| InternalMinimalisticCenteredDescTxt: Label 'Header/footer design for portrait or landscape, minimalist and centred, for internal documents. Header with centred logo, report name and document date; footer with page number.'; | ||
| InternalMinimalisticDescTxt: Label 'Header/footer design for portrait or landscape, minimalistic, for internal documents. Header with report name and document date; footer with page number.'; | ||
| InternalModernDescTxt: Label 'Header/footer design for portrait or landscape, modern style, for internal documents. Header with company logo, report name and document date; footer with page number.'; | ||
| InternalModernMaxiDescTxt: Label 'Header/footer design for portrait or landscape, modern style with a large header, for internal documents. Header with company logo, report name and document date; footer with page number.'; | ||
|
|
||
| DefaultThemeDescTxt: Label 'Simple and clear, so the details that matter stand out. Styling-only theme: neutral Segoe UI in semibold and regular for hierarchy, dark-grey text on white, calm accent colours, and softly banded table rows. Works for most reports out of the box.'; | ||
| CalmThemeDescTxt: Label 'Classic and calm, and easy to read. Styling-only theme: Sitka serif in semibold and regular for hierarchy, with dark-green text on a soft beige background. A timeless look that gives your reports a quieter, more classic feel.'; | ||
| PlayfulThemeDescTxt: Label 'Dynamic and lively, a fresh take on a professional report. Styling-only theme: geometric Bahnschrift in semibold and regular for hierarchy, with backgrounds alternating between green and pink for an energetic, modern feel.'; | ||
|
|
||
| ResourceNotReadableErr: Label 'The layout file for the report part %1 could not be read. The part was not seeded.', Comment = '%1 = the name of the shipped theme or header/footer part'; | ||
| ResourceNotReadableDetailTxt: Label 'Resource: %1. Platform error: %2', Locked = true; | ||
|
|
||
| ThemeMimeTypeTxt: Label 'reportlayout/dotx', Locked = true; | ||
| HeaderFooterMimeTypeTxt: Label 'reportlayout/docx', Locked = true; | ||
| } | ||
51 changes: 51 additions & 0 deletions
51
src/Layers/W1/BaseApp/OtherCapabilities/Upgrade/UpgradeCompositeReportParts.Codeunit.al
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| // ------------------------------------------------------------------------------------------------ | ||
| // Copyright (c) Microsoft Corporation. All rights reserved. | ||
| // Licensed under the MIT License. See License.txt in the project root for license information. | ||
| // ------------------------------------------------------------------------------------------------ | ||
| namespace Microsoft.Upgrade; | ||
|
|
||
| using Microsoft.Foundation.Reporting; | ||
| using System.Upgrade; | ||
|
|
||
| /// <summary> | ||
| /// Seeds the shipped Composite Layout theme and header/footer parts and records the upgrade tag. SeedShippedParts is | ||
| /// the single entry point that does both; RunUpgrade wraps it in the tag guard so an upgrade runs it once, while | ||
| /// install calls it unguarded. Add a new dated tag whenever the shipped layout files change. | ||
| /// </summary> | ||
| codeunit 104064 "Upgrade Composite Report Parts" | ||
| { | ||
| Access = Internal; | ||
|
MSlenejennum marked this conversation as resolved.
|
||
| Subtype = Upgrade; | ||
| InherentEntitlements = X; | ||
| InherentPermissions = X; | ||
|
MSlenejennum marked this conversation as resolved.
|
||
|
|
||
| trigger OnUpgradePerDatabase() | ||
| begin | ||
| RunUpgrade(); | ||
| end; | ||
|
|
||
| internal procedure RunUpgrade() | ||
|
MSlenejennum marked this conversation as resolved.
|
||
| var | ||
| UpgradeTag: Codeunit "Upgrade Tag"; | ||
| UpgradeTagDefinitions: Codeunit "Upgrade Tag Definitions"; | ||
| begin | ||
| if UpgradeTag.HasDatabaseUpgradeTag(UpgradeTagDefinitions.GetCompositeReportPartsUpgradeTag()) then | ||
| exit; | ||
|
|
||
| SeedShippedParts(); | ||
| end; | ||
|
|
||
| internal procedure SeedShippedParts() | ||
| var | ||
| CompositeReportPartsMgt: Codeunit "Composite Report Parts Mgt."; | ||
| UpgradeTag: Codeunit "Upgrade Tag"; | ||
| UpgradeTagDefinitions: Codeunit "Upgrade Tag Definitions"; | ||
| begin | ||
| CompositeReportPartsMgt.SeedDefaultParts(); | ||
|
|
||
| if UpgradeTag.HasDatabaseUpgradeTag(UpgradeTagDefinitions.GetCompositeReportPartsUpgradeTag()) then | ||
| exit; | ||
|
|
||
| UpgradeTag.SetDatabaseUpgradeTag(UpgradeTagDefinitions.GetCompositeReportPartsUpgradeTag()); | ||
| end; | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.