Skip to content

Commit

Permalink
[24.x] Update all modules to latest versions from main branch (#1098)
Browse files Browse the repository at this point in the history
Backport of most changes done in the main branch of all modules.

Fixes
[AB#534671](https://dynamicssmb2.visualstudio.com/1fcb79e7-ab07-432a-a3c6-6cf5a88ba4a5/_workitems/edit/534671)
  • Loading branch information
JesperSchulz authored May 14, 2024
1 parent abb4dc5 commit d433556
Show file tree
Hide file tree
Showing 107 changed files with 1,859 additions and 251 deletions.
6 changes: 3 additions & 3 deletions src/Business Foundation/App/NoSeries/readme_refactoring.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ if "No." = '' then begin
GLSetup.TestField("Bank Account Nos.");
"No. Series" := GLSetup."Bank Account Nos.";
if NoSeries.AreRelated(GLSetup."Bank Account Nos.", xRec."No. Series") then
"No. Series" := xRec."No. Series"
"No. Series" := xRec."No. Series";
"No." := NoSeries.GetNextNo("No. Series");
end;
```
Expand All @@ -70,7 +70,7 @@ if "No." = '' then begin
if not IsHandled then begin
"No. Series" := GLSetup."Bank Account Nos.";
if NoSeries.AreRelated(GLSetup."Bank Account Nos.", xRec."No. Series") then
"No. Series" := xRec."No. Series"
"No. Series" := xRec."No. Series";
"No." := NoSeries.GetNextNo("No. Series");
NoSeriesManagement.RaiseObsoleteOnAfterInitSeries("No. Series", GLSetup."Bank Account Nos.", 0D, "No.");
end;
Expand Down Expand Up @@ -132,7 +132,7 @@ end;
```
New:
```
"Document No." := NoSeriesBatch.SimulateGetNextNo(GenJnlBatch."No. Series", Rec."Posting Date", "Document No.")
"Document No." := NoSeriesBatch.SimulateGetNextNo(GenJnlBatch."No. Series", Rec."Posting Date", "Document No.");
```

This new function uses the details of the given number series to increment the document number. If the number series doesn't exist, the document number increases by one.
Original file line number Diff line number Diff line change
Expand Up @@ -673,5 +673,4 @@ codeunit 7772 "Azure OpenAI Impl"
Session.LogMessage('0000MLE', TelemetryTenantAllowlistedMsg, Verbosity::Normal, DataClassification::SystemMetadata, TelemetryScope::ExtensionPublisher, 'Category', CopilotCapabilityImpl.GetAzureOpenAICategory());
exit(true);
end;

}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ codeunit 7774 "Copilot Capability Impl"
NotRegisteredErr: Label 'Copilot capability has not been registered by the module.';
ReviewPrivacyNoticeLbl: Label 'Review the privacy notice';
PrivacyNoticeDisagreedNotificationMessageLbl: Label 'To enable Copilot, please review and accept the privacy notice.';
CapabilitiesNotAvailableOnPremNotificationMessageLbl: Label 'Note that copilot and AI capabilities published by Microsoft are not available on-premises.';
CapabilitiesNotAvailableOnPremNotificationMessageLbl: Label 'Copilot capabilities published by Microsoft are not available on-premises. You can extend Copilot with custom capabilities and use them on-premises for development purposes only.';
TelemetryRegisteredNewCopilotCapabilityLbl: Label 'New copilot capability has been registered.', Locked = true;
TelemetryModifiedCopilotCapabilityLbl: Label 'Copilot capability has been modified.', Locked = true;
TelemetryUnregisteredCopilotCapabilityLbl: Label 'Copilot capability has been unregistered.', Locked = true;
Expand Down Expand Up @@ -239,7 +239,7 @@ codeunit 7774 "Copilot Capability Impl"
IsAdmin := AzureADGraphUser.IsUserDelegatedAdmin() or AzureADPlan.IsPlanAssignedToUser(PlanIds.GetGlobalAdminPlanId()) or AzureADPlan.IsPlanAssignedToUser(PlanIds.GetBCAdminPlanId()) or AzureADPlan.IsPlanAssignedToUser(PlanIds.GetD365AdminPlanId()) or AzureADGraphUser.IsUserDelegatedHelpdesk() or UserPermissions.IsSuper(UserSecurityId());
end;

[Tryfunction]
[TryFunction]
procedure CheckGeo(var WithinGeo: Boolean; var WithinEuropeGeo: Boolean)
var
ALCopilotFunctions: DotNet ALCopilotFunctions;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,19 +123,19 @@ page 2516 "AppSource Product Details"
{
Caption = 'Legal Terms Uri';
ToolTip = 'Specifies the legal terms of the offer.';
ExtendedDatatype = Url;
ExtendedDatatype = URL;
}
field(Links_PrivacyPolicyUri; AppSourceJsonUtilities.GetStringValue(ProductObject, 'privacyPolicyUri'))
{
Caption = 'Privacy Policy Uri';
ToolTip = 'Specifies the privacy policy of the offer.';
ExtendedDatatype = Url;
ExtendedDatatype = URL;
}
field(Links_SupportUri; AppSourceJsonUtilities.GetStringValue(ProductObject, 'supportUri'))
{
Caption = 'Support Uri';
ToolTip = 'Specifies the support Uri of the offer.';
ExtendedDatatype = Url;
ExtendedDatatype = URL;
}
}
}
Expand Down Expand Up @@ -208,7 +208,7 @@ page 2516 "AppSource Product Details"
Enabled = CurrentRecordCanBeUninstalled;
Image = Delete;
ToolTip = 'Uninstalls the app.';
AccessByPermission = TableData "Installed Application" = d;
AccessByPermission = tabledata "Installed Application" = d;

trigger OnAction()
begin
Expand Down Expand Up @@ -313,9 +313,9 @@ page 2516 "AppSource Product Details"
AvailabilityObject: JsonObject;
TermItem: JsonToken;
ArrayItem: JsonArray;
i: integer;
Currency: text;
Monthly, Yearly : decimal;
i: Integer;
Currency: Text;
Monthly, Yearly : Decimal;
FreeTrial: Boolean;
PriceText: Text;
begin
Expand Down Expand Up @@ -363,13 +363,13 @@ page 2516 "AppSource Product Details"
exit(true);
end;

local procedure GetTerms(Terms: JsonArray; var Monthly: decimal; var Yearly: decimal; var Currency: Text)
local procedure GetTerms(Terms: JsonArray; var Monthly: Decimal; var Yearly: Decimal; var Currency: Text)
var
Item: JsonToken;
PriceToken: JsonToken;
Price: JsonObject;
PriceValue: Decimal;
i: integer;
i: Integer;
begin
for i := 0 to Terms.Count() do
if (Terms.Get(i, Item)) then begin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ page 2515 "AppSource Product List"
action(ShowSettings)
{
Caption = 'Edit User Settings';
RunObject = Page "User Settings";
RunObject = page "User Settings";
Image = UserSetup;
ToolTip = 'Locale will be used to determine the market and language will be used to determine the language of the app details listed here.';
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ codeunit 2515 "AppSource Product Manager"
var
AppSourceJsonUtilities: Codeunit "AppSource Json Utilities";
AppSourceProductManagerDependencies: Interface "AppSource Product Manager Dependencies";
IsDependenciesInterfaceSet: boolean;
CatalogProductsUriLbl: label 'https://catalogapi.azure.com/products', Locked = true;
CatalogApiVersionQueryParamNameLbl: label 'api-version', Locked = true;
CatalogApiVersionQueryParamValueLbl: label '2023-05-01-preview', Locked = true;
CatalogApiOrderByQueryParamNameLbl: label '$orderby', Locked = true;
CatalogMarketQueryParamNameLbl: label 'market', Locked = true;
CatalogLanguageQueryParamNameLbl: label 'language', Locked = true;
IsDependenciesInterfaceSet: Boolean;
CatalogProductsUriLbl: Label 'https://catalogapi.azure.com/products', Locked = true;
CatalogApiVersionQueryParamNameLbl: Label 'api-version', Locked = true;
CatalogApiVersionQueryParamValueLbl: Label '2023-05-01-preview', Locked = true;
CatalogApiOrderByQueryParamNameLbl: Label '$orderby', Locked = true;
CatalogMarketQueryParamNameLbl: Label 'market', Locked = true;
CatalogLanguageQueryParamNameLbl: Label 'language', Locked = true;
CatalogApiFilterQueryParamNameLbl: Label '$filter', Locked = true;
CatalogApiSelectQueryParamNameLbl: Label '$select', Locked = true;
AppSourceListingUriLbl: Label 'https://appsource.microsoft.com/%1/product/dynamics-365-business-central/%2', Comment = '%1=Language ID, such as en-US, %2=Url Query Content', Locked = true;
Expand Down Expand Up @@ -137,7 +137,7 @@ codeunit 2515 "AppSource Product Manager"
procedure ResolveMarketAndLanguage(var Market: Code[2]; var LanguageName: Text)
var
Language: Codeunit Language;
LanguageID, LocalID : integer;
LanguageID, LocalID : Integer;
begin
GetCurrentUserLanguageAndLocaleID(LanguageID, LocalID);

Expand Down Expand Up @@ -264,10 +264,10 @@ codeunit 2515 "AppSource Product Manager"
/// <summary>
/// Get all products from a remote server and adds them to the AppSource Product table.
/// </summary>
internal procedure GetProductsAndPopulateRecord(var AppSourceProductRec: record "AppSource Product"): Text
internal procedure GetProductsAndPopulateRecord(var AppSourceProductRec: Record "AppSource Product"): Text
var
RestClient: Codeunit "Rest Client";
NextPageLink: text;
NextPageLink: Text;
begin
Init();
NextPageLink := ConstructProductListUri();
Expand Down Expand Up @@ -313,7 +313,7 @@ codeunit 2515 "AppSource Product Manager"
exit(AppSourceProductManagerDependencies.GetAsJSon(RestClient, RequestUri).AsObject());
end;

local procedure DownloadAndAddNextPageProducts(NextPageLink: Text; var AppSourceProductRec: record "AppSource Product"; var RestClient: Codeunit "Rest Client"): Text
local procedure DownloadAndAddNextPageProducts(NextPageLink: Text; var AppSourceProductRec: Record "AppSource Product"; var RestClient: Codeunit "Rest Client"): Text
var
ResponseObject: JsonObject;
ProductArray: JsonArray;
Expand Down Expand Up @@ -392,7 +392,7 @@ codeunit 2515 "AppSource Product Manager"
end;

#region Telemetry helpers
local procedure PopulateTelemetryDictionary(RequestID: Text; UniqueIdentifier: text; Uri: Text; var TelemetryDictionary: Dictionary of [Text, Text])
local procedure PopulateTelemetryDictionary(RequestID: Text; UniqueIdentifier: Text; Uri: Text; var TelemetryDictionary: Dictionary of [Text, Text])
begin
PopulateTelemetryDictionary(RequestID, telemetryDictionary);
TelemetryDictionary.Add('UniqueIdentifier', UniqueIdentifier);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ codeunit 2518 "AppSrc Product Deps. Provider" implements "AppSource Product Mana
exit(EnvironmentInformation.GetApplicationFamily());
end;

procedure IsSaas(): boolean
procedure IsSaas(): Boolean
var
EnvironmentInformation: Codeunit "Environment Information";
begin
Expand All @@ -59,7 +59,7 @@ codeunit 2518 "AppSrc Product Deps. Provider" implements "AppSource Product Mana
exit(RestClient.GetAsJSon(RequestUri));
end;

procedure GetUserSettings(UserSecurityId: Guid; var TempUserSettingsRecord: record "User Settings" temporary)
procedure GetUserSettings(UserSecurityId: Guid; var TempUserSettingsRecord: Record "User Settings" temporary)
var
UserSettings: Codeunit "User Settings";
begin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ codeunit 433 "Azure AD Tenant"
/// <summary>
/// Gets the Microsoft Entra tenant ID.
/// </summary>
/// <returns>If it cannot be found, an empty string is returned.</returns>
/// <returns>If the Entra tenant ID is a valid GUID, it will be returned in lowercase format and without brackets or parentheses (as per RFC4122 section 3), such as "f81d4fae-7dec-11d0-a765-00a0c91e6bf6". If it cannot be found, an empty string is returned.</returns>
procedure GetAadTenantId(): Text
begin
exit(AzureADTenantImpl.GetAadTenantId());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,17 @@ codeunit 3705 "Azure AD Tenant Impl."
CountryLetterCodeErr: Label 'Failed to retrieve the Microsoft Entra tenant country letter code.';
PreferredLanguageErr: Label 'Failed to retrieve the Microsoft Entra tenant preferred language code.';

procedure GetAadTenantId() TenantIdValue: Text
procedure GetAadTenantId(): Text
var
TenantIdValue: Text;
EntraTenantIdAsGuid: Guid;
begin
NavTenantSettingsHelper.TryGetStringTenantSetting('AADTENANTID', TenantIdValue);

if Evaluate(EntraTenantIdAsGuid, TenantIdValue) then
exit(LowerCase(Format(EntraTenantIdAsGuid, 0, 4)));

exit(TenantIdValue);
end;

procedure GetAadTenantDomainName(): Text;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ page 9515 "Azure AD User Update Wizard"
var
UserPermissions: Codeunit "User Permissions";
begin
if not UserPermissions.CanManageUsersOnTenant(UserSecurityId()) then
if not (UserPermissions.CanManageUsersOnTenant(UserSecurityId()) and UserPermissions.IsSuper(UserSecurityId())) then
Error(CannotUpdateUsersFromOfficeErr);

MakeAllGroupsInvisible();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -577,8 +577,23 @@ codeunit 9053 "ABS Blob Client"
/// <param name="FoundBlobs">An XmlDocument containing the results of the identified blobs.</param>
/// <returns>An operation response object</returns>
procedure FindBlobsByTags(SearchTags: Dictionary of [Text, Text]; var FoundBlobs: XmlDocument): Codeunit "ABS Operation Response"
var
OptionalParameters: Codeunit "ABS Optional Parameters";
begin
exit(ABSClientImpl.FindBlobsByTags(SearchTags, FoundBlobs, OptionalParameters));
end;

/// <summary>
/// The Find Blobs By Tags operation retrieves blobs based on user-defined tags for the specified blob, represented as one or more key-value pairs.
/// see: https://learn.microsoft.com/rest/api/storageservices/find-blobs-by-tags?tabs=azure-ad
/// </summary>
/// <param name="SearchTags">A Dictionary of [Text, Text] with tags to search on.</param>
/// <param name="FoundBlobs">An XmlDocument containing the results of the identified blobs.</param>
/// <param name="OptionalParameters">Optional parameters to pass.</param>
/// <returns>An operation response object</returns>
procedure FindBlobsByTags(SearchTags: Dictionary of [Text, Text]; var FoundBlobs: XmlDocument; OptionalParameters: Codeunit "ABS Optional Parameters"): Codeunit "ABS Operation Response"
begin
exit(ABSClientImpl.FindBlobsByTags(SearchTags, FoundBlobs));
exit(ABSClientImpl.FindBlobsByTags(SearchTags, FoundBlobs, OptionalParameters));
end;

/// <summary>
Expand Down Expand Up @@ -771,7 +786,70 @@ codeunit 9053 "ABS Blob Client"
/// <returns>An operation response object</returns>
procedure PutBlockList(CommitedBlocks: Dictionary of [Text, Integer]; UncommitedBlocks: Dictionary of [Text, Integer]): Codeunit "ABS Operation Response"
begin
exit(ABSClientImpl.PutBlockList(CommitedBlocks, UncommitedBlocks));
exit(ABSClientImpl.PutBlockList('', CommitedBlocks, UncommitedBlocks));
end;

/// <summary>
/// The Put Block List operation writes a blob by specifying the list of block IDs that make up the blob.
/// see: https://go.microsoft.com/fwlink/?linkid=2210392
/// </summary>
/// <param name="BlobName">The name of the blob.</param>
/// <param name="CommitedBlocks">Dictionary of [Text, Integer] containing the list of commited blocks that should be put to the Blob</param>
/// <param name="UncommitedBlocks">Dictionary of [Text, Integer] containing the list of uncommited blocks that should be put to the Blob</param>
/// <returns>An operation response object</returns>
procedure PutBlockList(BlobName: Text; CommitedBlocks: Dictionary of [Text, Integer]; UncommitedBlocks: Dictionary of [Text, Integer]): Codeunit "ABS Operation Response"
begin
exit(ABSClientImpl.PutBlockList(BlobName, CommitedBlocks, UncommitedBlocks));
end;

/// <summary>
/// The Put Block operation creates a new block to be committed as part of a blob.
/// see: https://learn.microsoft.com/en-us/rest/api/storageservices/put-block
/// </summary>
/// <param name="BlobName">The name of the blob.</param>
/// <param name="SourceText">The Content of the Block as Text.</param>
/// <param name="BlockId">Specifies the BlockId that should be put.</param>
/// <returns>An operation response object</returns>
procedure PutBlockText(BlobName: Text; SourceText: Text; BlockId: Text): Codeunit "ABS Operation Response"
begin
exit(ABSClientImpl.PutBlock(BlobName, SourceText, BlockId));
end;

/// <summary>
/// The Put Block operation creates a new block to be committed as part of a blob.
/// see: https://learn.microsoft.com/en-us/rest/api/storageservices/put-block
/// </summary>
/// <param name="BlobName">The name of the blob.</param>
/// <param name="SourceText">The Content of the Block as Text.</param>
/// <returns>An operation response object</returns>
procedure PutBlockText(BlobName: Text; SourceText: Text): Codeunit "ABS Operation Response"
begin
exit(ABSClientImpl.PutBlock(BlobName, SourceText));
end;

/// <summary>
/// The Put Block operation creates a new block to be committed as part of a blob.
/// see: https://learn.microsoft.com/en-us/rest/api/storageservices/put-block
/// </summary>
/// <param name="BlobName">The name of the blob.</param>
/// <param name="SourceInStream">The Content of the Block as InStream.</param>
/// <returns>An operation response object</returns>
procedure PutBlockStream(BlobName: Text; SourceInStream: InStream): Codeunit "ABS Operation Response"
begin
exit(ABSClientImpl.PutBlock(BlobName, SourceInStream));
end;

/// <summary>
/// The Put Block operation creates a new block to be committed as part of a blob.
/// see: https://learn.microsoft.com/en-us/rest/api/storageservices/put-block
/// </summary>
/// <param name="BlobName">The name of the blob.</param>
/// <param name="SourceInStream">The Content of the Block as InStream.</param>
/// <param name="BlockId">Specifies the BlockId that should be put.</param>
/// <returns>An operation response object</returns>
procedure PutBlockStream(BlobName: Text; SourceInStream: InStream; BlockId: Text): Codeunit "ABS Operation Response"
begin
exit(ABSClientImpl.PutBlock(BlobName, SourceInStream, BlockId));
end;

/// <summary>
Expand Down
Loading

0 comments on commit d433556

Please sign in to comment.