-
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 8 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
+73.7 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 added
BIN
+58.6 KB
src/Layers/W1/BaseApp/.resources/ReportParts/ReportTheme/Default.dotx
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
199 changes: 199 additions & 0 deletions
199
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,199 @@ | ||
| // ------------------------------------------------------------------------------------------------ | ||
| // 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 into the shared pool under Tenant Report Defaults, | ||
| /// on install and upgrade, and is safe to call repeatedly. A part is removed and inserted again rather than modified, | ||
| /// because the platform does not allow the type and content of an existing report layout to be modified; the same | ||
| /// removal takes out the copy an earlier version seeded with no App ID. Parts are stored under the platform System | ||
| /// application's App ID, which an assignment encodes into its reference. The layout file is read in a try function and | ||
| /// written outside it, because the platform rejects a database write inside a try function while install or upgrade | ||
| /// holds a write transaction open. | ||
| /// </summary> | ||
| codeunit 9667 "Composite Report Parts Mgt." | ||
| { | ||
| Access = Internal; | ||
|
|
||
| procedure SeedDefaultParts() AllPartsSeeded: Boolean | ||
|
MSlenejennum marked this conversation as resolved.
Outdated
|
||
| var | ||
| FailedCount: Integer; | ||
| begin | ||
| FailedCount += CountFailure(SeedPart(ExternalDefaultTxt, 'ReportParts/HeaderFooterDesign/ExternalDefault.docx', Enum::"Report Layout Subtype"::HeaderFooter, ExternalDefaultDescTxt)); | ||
| FailedCount += CountFailure(SeedPart(ExternalDefaultDetailedTxt, 'ReportParts/HeaderFooterDesign/ExternalDefaultDetailed.docx', Enum::"Report Layout Subtype"::HeaderFooter, ExternalDefaultDetailedDescTxt)); | ||
| FailedCount += CountFailure(SeedPart(ExternalMinimalisticTxt, 'ReportParts/HeaderFooterDesign/ExternalMinimalistic.docx', Enum::"Report Layout Subtype"::HeaderFooter, ExternalMinimalisticDescTxt)); | ||
| FailedCount += CountFailure(SeedPart(ExternalMinimalisticDetailedTxt, 'ReportParts/HeaderFooterDesign/ExternalMinimalisticDetailed.docx', Enum::"Report Layout Subtype"::HeaderFooter, ExternalMinimalisticDetailedDescTxt)); | ||
| FailedCount += CountFailure(SeedPart(ExternalModernTxt, 'ReportParts/HeaderFooterDesign/ExternalModern.docx', Enum::"Report Layout Subtype"::HeaderFooter, ExternalModernDescTxt)); | ||
| FailedCount += CountFailure(SeedPart(ExternalModernLogoTxt, 'ReportParts/HeaderFooterDesign/ExternalModernLogo.docx', Enum::"Report Layout Subtype"::HeaderFooter, ExternalModernLogoDescTxt)); | ||
|
|
||
| FailedCount += CountFailure(SeedPart(InternalDefaultTxt, 'ReportParts/HeaderFooterDesign/InternalDefault.docx', Enum::"Report Layout Subtype"::HeaderFooter, InternalDefaultDescTxt)); | ||
| FailedCount += CountFailure(SeedPart(InternalMinimalisticCenteredTxt, 'ReportParts/HeaderFooterDesign/InternalMinimalisticCentered.docx', Enum::"Report Layout Subtype"::HeaderFooter, InternalMinimalisticCenteredDescTxt)); | ||
| FailedCount += CountFailure(SeedPart(InternalMinimalisticTxt, 'ReportParts/HeaderFooterDesign/InternalMinimalistic.docx', Enum::"Report Layout Subtype"::HeaderFooter, InternalMinimalisticDescTxt)); | ||
| FailedCount += CountFailure(SeedPart(InternalModernTxt, 'ReportParts/HeaderFooterDesign/InternalModern.docx', Enum::"Report Layout Subtype"::HeaderFooter, InternalModernDescTxt)); | ||
| FailedCount += CountFailure(SeedPart(InternalModernMaxiTxt, 'ReportParts/HeaderFooterDesign/InternalModernMaxi.docx', Enum::"Report Layout Subtype"::HeaderFooter, InternalModernMaxiDescTxt)); | ||
|
|
||
| FailedCount += CountFailure(SeedPart(DefaultThemeTxt, 'ReportParts/ReportTheme/Default.dotx', Enum::"Report Layout Subtype"::Theme, DefaultThemeDescTxt)); | ||
| FailedCount += CountFailure(SeedPart(CalmThemeTxt, 'ReportParts/ReportTheme/Calm.dotx', Enum::"Report Layout Subtype"::Theme, CalmThemeDescTxt)); | ||
| FailedCount += CountFailure(SeedPart(PlayfulThemeTxt, 'ReportParts/ReportTheme/Playful.dotx', Enum::"Report Layout Subtype"::Theme, PlayfulThemeDescTxt)); | ||
|
|
||
| exit(FailedCount = 0); | ||
| end; | ||
|
|
||
| local procedure CountFailure(PartSeeded: Boolean): Integer | ||
| begin | ||
| if PartSeeded then | ||
| exit(0); | ||
| exit(1); | ||
| end; | ||
|
|
||
| internal procedure GetShippedPartAppId() AppId: Guid | ||
| begin | ||
| Evaluate(AppId, SystemAppIdTxt); | ||
| 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; | ||
|
|
||
| internal procedure SeedPart(PartName: Text[250]; ResourceFile: Text; Subtype: Enum "Report Layout Subtype"; Description: Text): Boolean | ||
|
MSlenejennum marked this conversation as resolved.
Outdated
|
||
| var | ||
| PartLayout: Codeunit "Temp Blob"; | ||
| begin | ||
| ClearLastError(); | ||
| if not TryGetPartLayout(ResourceFile, PartLayout) then begin | ||
| LogPartNotSeeded(PartName, ResourceFile, Subtype, GetLastErrorCode(), GetLastErrorText(true)); | ||
| exit(false); | ||
| end; | ||
|
|
||
| UpsertPart(PartName, PartLayout, Subtype, Description); | ||
| exit(true); | ||
| end; | ||
|
|
||
| local procedure LogPartNotSeeded(PartName: Text; ResourceFile: Text; Subtype: Enum "Report Layout Subtype"; ErrorCode: Text; ErrorText: Text) | ||
| var | ||
| TelemetryDimensions: Dictionary of [Text, Text]; | ||
| begin | ||
| TelemetryDimensions.Add('PartName', PartName); | ||
| TelemetryDimensions.Add('ResourceFile', ResourceFile); | ||
| TelemetryDimensions.Add('LayoutSubtype', Format(Subtype, 0, 9)); | ||
| TelemetryDimensions.Add('ErrorCode', ErrorCode); | ||
| Session.LogMessage( | ||
| '0000V42', PartNotSeededTxt, Verbosity::Warning, DataClassification::SystemMetadata, | ||
| TelemetryScope::All, TelemetryDimensions); | ||
|
|
||
| Clear(TelemetryDimensions); | ||
| TelemetryDimensions.Add('PartName', PartName); | ||
| TelemetryDimensions.Add('ResourceFile', ResourceFile); | ||
| TelemetryDimensions.Add('ErrorCode', ErrorCode); | ||
| TelemetryDimensions.Add('Error', ErrorText); | ||
| Session.LogMessage( | ||
| '0000V43', PartNotSeededDetailTxt, Verbosity::Warning, DataClassification::SystemMetadata, | ||
| TelemetryScope::ExtensionPublisher, TelemetryDimensions); | ||
| 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 UpsertPart(PartName: Text[250]; var PartLayout: Codeunit "Temp Blob"; Subtype: Enum "Report Layout Subtype"; Description: Text) | ||
|
MSlenejennum marked this conversation as resolved.
Outdated
|
||
| var | ||
| TenantReportLayout: Record "Tenant Report Layout"; | ||
| CompositeLayoutLookupHelper: Codeunit "Composite Layout Lookup Helper"; | ||
| LayoutInStream: InStream; | ||
| EmptyAppId: Guid; | ||
| begin | ||
| RemovePart(PartName, GetShippedPartAppId()); | ||
|
MSlenejennum marked this conversation as resolved.
Outdated
MSlenejennum marked this conversation as resolved.
Outdated
|
||
| RemovePart(PartName, EmptyAppId); | ||
|
|
||
| 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); | ||
|
MSlenejennum marked this conversation as resolved.
Outdated
|
||
| TenantReportLayout.Layout.ImportStream(LayoutInStream, PartName); | ||
| TenantReportLayout.Insert(true); | ||
| 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.'; | ||
|
|
||
| PartNotSeededTxt: Label 'Composite layout parts: a shipped theme or header/footer part could not be written to the shared pool and was skipped. The remaining parts were seeded.', Locked = true; | ||
| PartNotSeededDetailTxt: Label 'Composite layout parts: the reason a shipped theme or header/footer part could not be written. Publisher-scoped because the platform error text can echo customer content.', Locked = true; | ||
|
|
||
| SystemAppIdTxt: Label '8874ed3a-0643-4247-9ced-7a7002f7135d', Locked = true; | ||
|
|
||
| ThemeMimeTypeTxt: Label 'application/vnd.openxmlformats-officedocument.wordprocessingml.template', Locked = true; | ||
| HeaderFooterMimeTypeTxt: Label 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', Locked = true; | ||
| } | ||
47 changes: 47 additions & 0 deletions
47
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,47 @@ | ||
| // ------------------------------------------------------------------------------------------------ | ||
| // 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, once per database. The tag is recorded only when | ||
| /// every part was seeded, so a pass that skipped one is retried by the next upgrade instead of being gated out. | ||
| /// </summary> | ||
| codeunit 104064 "Upgrade Composite Report Parts" | ||
| { | ||
| 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 | ||
| CompositeReportPartsMgt: Codeunit "Composite Report Parts Mgt."; | ||
| UpgradeTag: Codeunit "Upgrade Tag"; | ||
| UpgradeTagDefinitions: Codeunit "Upgrade Tag Definitions"; | ||
| begin | ||
| if UpgradeTag.HasDatabaseUpgradeTag(UpgradeTagDefinitions.GetCompositeReportPartsUpgradeTag()) then | ||
| exit; | ||
|
|
||
| RecordSeedOutcome(CompositeReportPartsMgt.SeedDefaultParts()); | ||
| end; | ||
|
|
||
| internal procedure RecordSeedOutcome(AllPartsSeeded: Boolean) | ||
| var | ||
| UpgradeTag: Codeunit "Upgrade Tag"; | ||
| UpgradeTagDefinitions: Codeunit "Upgrade Tag Definitions"; | ||
| begin | ||
| if not AllPartsSeeded then | ||
| exit; | ||
|
|
||
| UpgradeTag.SetDatabaseUpgradeTag(UpgradeTagDefinitions.GetCompositeReportPartsUpgradeTag()); | ||
| end; | ||
| } | ||
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.