diff --git a/Apps/W1/EDocumentsConnector/app/src/Continia/API Requests/APIRequests.Codeunit.al b/Apps/W1/EDocumentsConnector/app/src/Continia/API Requests/APIRequests.Codeunit.al index 56e60a86c7..1b1b689f35 100644 --- a/Apps/W1/EDocumentsConnector/app/src/Continia/API Requests/APIRequests.Codeunit.al +++ b/Apps/W1/EDocumentsConnector/app/src/Continia/API Requests/APIRequests.Codeunit.al @@ -9,7 +9,7 @@ using System.Text; using Microsoft.Foundation.Address; using Microsoft.Foundation.Company; -codeunit 6393 "API Requests" +codeunit 6393 "Api Requests" { Access = Internal; @@ -18,12 +18,11 @@ codeunit 6393 "API Requests" tabledata "Participation" = rimd, tabledata "Activated Net. Prof." = rimd; - #region Get Network Profiles from Continia Delivery Network API + #region Get Network Profiles from Continia Delivery Network Api - [InherentPermissions(PermissionObjectType::TableData, Database::"Network Profile", 'rimd', InherentPermissionsScope::Both)] - internal procedure GetNetworkProfiles(Network: Enum "Network") + internal procedure GetNetworkProfiles(Network: Enum "E-Delivery Network") var - APIUrlMgt: Codeunit "API URL Mgt."; + ApiUrlMgt: Codeunit "Api Url Mgt."; IsLastPage: Boolean; HttpResponseMessage: HttpResponseMessage; CurrPage: Integer; @@ -34,17 +33,16 @@ codeunit 6393 "API Requests" IsLastPage := false; repeat CurrPage += 1; - if ExecuteRequest('GET', APIUrlMgt.NetworkProfilesURL(Network, CurrPage, PageSize), HttpResponseMessage) then + if ExecuteRequest('GET', ApiUrlMgt.NetworkProfilesUrl(Network, CurrPage, PageSize), HttpResponseMessage) then IsLastPage := HandleNetworkProfileResponse(HttpResponseMessage, Network, PageSize); until IsLastPage; end; - [InherentPermissions(PermissionObjectType::TableData, Database::"Network Profile", 'rimd', InherentPermissionsScope::Both)] - local procedure HandleNetworkProfileResponse(var HttpResponseMessage: HttpResponseMessage; NetworkName: Enum "Network"; PageSize: Integer) IsLastPage: Boolean + local procedure HandleNetworkProfileResponse(var HttpResponseMessage: HttpResponseMessage; NetworkName: Enum "E-Delivery Network"; PageSize: Integer) IsLastPage: Boolean var NetworkProfile: Record "Network Profile"; Insert: Boolean; - CDNGUID: Guid; + NetworkProfileId: Guid; i: Integer; ResponseBody: Text; ResponseXmlDoc: XmlDocument; @@ -63,13 +61,13 @@ codeunit 6393 "API Requests" TempXMLNode.SelectSingleNode('network_profile_id', TempXMLNode2); - CDNGUID := StrSubstNo('{%1}', TempXMLNode2.AsXmlElement().InnerText); + NetworkProfileId := StrSubstNo('{%1}', TempXMLNode2.AsXmlElement().InnerText); - if NetworkProfile.Get(CDNGUID) then + if NetworkProfile.Get(NetworkProfileId) then Insert := false else begin NetworkProfile.Init(); - NetworkProfile."CDN GUID" := CDNGUID; + NetworkProfile.Id := NetworkProfileId; Insert := true; end; @@ -105,12 +103,11 @@ codeunit 6393 "API Requests" #endregion - #region Get Network ID Types from Continia Delivery Network API + #region Get Network Id Types from Continia Delivery Network Api - [InherentPermissions(PermissionObjectType::TableData, Database::"Network Profile", 'rimd', InherentPermissionsScope::Both)] - internal procedure GetNetworkIDTypes(Network: Enum "Network") + internal procedure GetNetworkIdTypes(Network: Enum "E-Delivery Network") var - APIUrlMgt: Codeunit "API URL Mgt."; + ApiUrlMgt: Codeunit "Api Url Mgt."; IsLastPage: Boolean; HttpResponseMessage: HttpResponseMessage; CurrPage: Integer; @@ -121,17 +118,16 @@ codeunit 6393 "API Requests" IsLastPage := false; repeat CurrPage += 1; - if ExecuteRequest('GET', APIUrlMgt.NetworkIdentifiersURL(Network, CurrPage, PageSize), HttpResponseMessage) then - IsLastPage := HandleNetworkIDTypeResponse(HttpResponseMessage, Network, PageSize); + if ExecuteRequest('GET', ApiUrlMgt.NetworkIdentifiersUrl(Network, CurrPage, PageSize), HttpResponseMessage) then + IsLastPage := HandleNetworkIdTypeResponse(HttpResponseMessage, Network, PageSize); until IsLastPage; end; - [InherentPermissions(PermissionObjectType::TableData, Database::"Network Identifier", 'rimd', InherentPermissionsScope::Both)] - local procedure HandleNetworkIDTypeResponse(var HttpResponseMessage: HttpResponseMessage; NetworkName: Enum "Network"; PageSize: Integer) IsLastPage: Boolean + local procedure HandleNetworkIdTypeResponse(var HttpResponseMessage: HttpResponseMessage; NetworkName: Enum "E-Delivery Network"; PageSize: Integer) IsLastPage: Boolean var NetworkIdentifier: Record "Network Identifier"; Insert: Boolean; - CDNGUID: Guid; + NetworkIdentifierId: Guid; i: Integer; ResponseBody: Text; ResponseXmlDoc: XmlDocument; @@ -150,20 +146,20 @@ codeunit 6393 "API Requests" TempXMLNode.SelectSingleNode('network_id_type_id', TempXMLNode2); - CDNGUID := StrSubstNo('{%1}', TempXMLNode2.AsXmlElement().InnerText); + NetworkIdentifierId := StrSubstNo('{%1}', TempXMLNode2.AsXmlElement().InnerText); - if NetworkIdentifier.Get(CDNGUID) then + if NetworkIdentifier.Get(NetworkIdentifierId) then Insert := false else begin NetworkIdentifier.Init(); - NetworkIdentifier."CDN GUID" := CDNGUID; + NetworkIdentifier.Id := NetworkIdentifierId; Insert := true; end; NetworkIdentifier.Network := NetworkName; if TempXMLNode.SelectSingleNode('code_iso6523-1', TempXMLNode2) then - NetworkIdentifier."Identifier Type ID" := CopyStr(TempXMLNode2.AsXmlElement().InnerText, 1, MaxStrLen(NetworkIdentifier."Identifier Type ID")); + NetworkIdentifier."Identifier Type Id" := CopyStr(TempXMLNode2.AsXmlElement().InnerText, 1, MaxStrLen(NetworkIdentifier."Identifier Type Id")); if TempXMLNode.SelectSingleNode('default_in_country_iso3166', TempXMLNode2) then NetworkIdentifier."Default in Country" := CopyStr(TempXMLNode2.AsXmlElement().InnerText, 1, MaxStrLen(NetworkIdentifier."Default in Country")); @@ -175,10 +171,10 @@ codeunit 6393 "API Requests" NetworkIdentifier."ICD Code" := TempXMLNode2.AsXmlElement().InnerText = 'true'; if TempXMLNode.SelectSingleNode('network_id_type_id', TempXMLNode2) then - NetworkIdentifier."CDN GUID" := TempXMLNode2.AsXmlElement().InnerText; + NetworkIdentifier.Id := TempXMLNode2.AsXmlElement().InnerText; if TempXMLNode.SelectSingleNode('scheme_id', TempXMLNode2) then - NetworkIdentifier."Scheme ID" := CopyStr(TempXMLNode2.AsXmlElement().InnerText, 1, MaxStrLen(NetworkIdentifier."Scheme ID")); + NetworkIdentifier."Scheme Id" := CopyStr(TempXMLNode2.AsXmlElement().InnerText, 1, MaxStrLen(NetworkIdentifier."Scheme Id")); if TempXMLNode.SelectSingleNode('vat_in_country_iso3166', TempXMLNode2) then NetworkIdentifier."VAT in Country" := CopyStr(TempXMLNode2.AsXmlElement().InnerText, 1, MaxStrLen(NetworkIdentifier."VAT in Country")); @@ -203,43 +199,42 @@ codeunit 6393 "API Requests" #endregion #region Participation endpoints in Continia Delivery Network - [InherentPermissions(PermissionObjectType::TableData, Database::"Participation", 'rm', InherentPermissionsScope::Both)] internal procedure GetParticipation(var Participation: Record "Participation") var - APIUrlMgt: Codeunit "API URL Mgt."; + ApiUrlMgt: Codeunit "Api Url Mgt."; HttpResponseMessage: HttpResponseMessage; begin - if ExecuteRequest('GET', APIUrlMgt.SingleParticipationURL(Participation.Network, Participation."CDN GUID"), HttpResponseMessage) then + if ExecuteRequest('GET', ApiUrlMgt.SingleParticipationUrl(Participation.Network, Participation.Id), HttpResponseMessage) then HandleParticipationResponse(HttpResponseMessage, Participation); end; - internal procedure PostParticipation(var TempParticipation: Record "Participation" temporary) ParticipationGUID: Guid; + internal procedure PostParticipation(var TempParticipation: Record "Participation" temporary) ParticipationGuid: Guid; var Participation: Record "Participation"; - APIUrlMgt: Codeunit "API URL Mgt."; + ApiUrlMgt: Codeunit "Api Url Mgt."; HttpResponseMessage: HttpResponseMessage; HttpContentData: Text; begin HttpContentData := GetParticipationRequest(TempParticipation, false); - if ExecuteRequest('POST', APIUrlMgt.ParticipationURL(TempParticipation.Network), HttpContentData, HttpResponseMessage) then begin + if ExecuteRequest('POST', ApiUrlMgt.ParticipationUrl(TempParticipation.Network), HttpContentData, HttpResponseMessage) then begin Participation := TempParticipation; Participation.Insert(); HandleParticipationResponse(HttpResponseMessage, Participation); - exit(Participation."CDN GUID"); + exit(Participation.Id); end; end; internal procedure PatchParticipation(var TempParticipation: Record "Participation" temporary) var Participation: Record "Participation"; - APIUrlMgt: Codeunit "API URL Mgt."; + ApiUrlMgt: Codeunit "Api Url Mgt."; HttpResponseMessage: HttpResponseMessage; HttpContentData: Text; begin HttpContentData := GetParticipationRequest(TempParticipation, true); - if ExecuteRequest('PATCH', APIUrlMgt.SingleParticipationURL(TempParticipation.Network, TempParticipation."CDN GUID"), HttpContentData, HttpResponseMessage) then begin + if ExecuteRequest('PATCH', ApiUrlMgt.SingleParticipationUrl(TempParticipation.Network, TempParticipation.Id), HttpContentData, HttpResponseMessage) then begin Participation.Get(TempParticipation.RecordId); HandleParticipationResponse(HttpResponseMessage, Participation); end; @@ -247,10 +242,10 @@ codeunit 6393 "API Requests" internal procedure DeleteParticipation(var Participation: Record "Participation") var - APIUrlMgt: Codeunit "API URL Mgt."; + ApiUrlMgt: Codeunit "Api Url Mgt."; HttpResponseMessage: HttpResponseMessage; begin - if ExecuteRequest('DELETE', APIUrlMgt.SingleParticipationURL(Participation.Network, Participation."CDN GUID"), HttpResponseMessage) then + if ExecuteRequest('DELETE', ApiUrlMgt.SingleParticipationUrl(Participation.Network, Participation.Id), HttpResponseMessage) then case HttpResponseMessage.HttpStatusCode of 200: Participation.Delete(true); @@ -266,7 +261,7 @@ codeunit 6393 "API Requests" var CredentialManagement: Codeunit "Credential Management"; AddressNode: XmlElement; - CompanyIDNode: XmlElement; + CompanyIdNode: XmlElement; CompanyNameNode: XmlElement; ContactEmailNode: XmlElement; ContactNameNode: XmlElement; @@ -290,9 +285,9 @@ codeunit 6393 "API Requests" AddressNode.Add(XmlText.Create(Participation.Address)); RootNode.Add(AddressNode); - CompanyIDNode := XmlElement.Create('business_central_company_code'); - CompanyIDNode.Add(XmlText.Create(GetGUIDAsText(CredentialManagement.GetCompanyId()))); - RootNode.Add(CompanyIDNode); + CompanyIdNode := XmlElement.Create('business_central_company_code'); + CompanyIdNode.Add(XmlText.Create(GetGuidAsText(CredentialManagement.GetCompanyId()))); + RootNode.Add(CompanyIdNode); CompanyNameNode := XmlElement.Create('company_name'); CompanyNameNode.Add(XmlText.Create(Participation."Company Name")); @@ -315,16 +310,16 @@ codeunit 6393 "API Requests" RootNode.Add(CountryCodeNode); NetworkIdTypeNode := XmlElement.Create('network_id_type_id'); - NetworkIdTypeNode.Add(XmlText.Create(Participation."Identifier Type ID")); + NetworkIdTypeNode.Add(XmlText.Create(Participation."Identifier Type Id")); RootNode.Add(NetworkIdTypeNode); NetworkIdValueNode := XmlElement.Create('network_id_value'); NetworkIdValueNode.Add(XmlText.Create(Participation."Identifier Value")); RootNode.Add(NetworkIdValueNode); - if not IsNullGuid(Participation."CDN GUID") then begin + if not IsNullGuid(Participation.Id) then begin NetworkIdTypeNode := XmlElement.Create('participation_id'); - NetworkIdTypeNode.Add(XmlText.Create(GetGUIDAsText(Participation."CDN GUID"))); + NetworkIdTypeNode.Add(XmlText.Create(GetGuidAsText(Participation.Id))); RootNode.Add(NetworkIdTypeNode); end; @@ -354,7 +349,7 @@ codeunit 6393 "API Requests" if IncludeTimestamp then begin TimestampNode := XmlElement.Create('timestamp'); - TimestampNode.Add(XmlText.Create(Participation."CDN Timestamp")); + TimestampNode.Add(XmlText.Create(Participation."Cdn Timestamp")); RootNode.Add(TimestampNode); end; @@ -376,7 +371,7 @@ codeunit 6393 "API Requests" ContactPhoneNode: XmlNode; CountryCodeNode: XmlNode; CreatedNode: XmlNode; - ParicipationIDNode: XmlNode; + ParicipationIdNode: XmlNode; PostCodeNode: XmlNode; PublishInRegistryNode: XmlNode; RegistrantNameNode: XmlNode; @@ -430,11 +425,11 @@ codeunit 6393 "API Requests" else Participation."Publish in Registry" := false; - ResponseXmlDoc.SelectSingleNode('/participation/participation_id', ParicipationIDNode); - Evaluate(Participation."CDN GUID", ParicipationIDNode.AsXmlElement().InnerText); + ResponseXmlDoc.SelectSingleNode('/participation/participation_id', ParicipationIdNode); + Evaluate(Participation.Id, ParicipationIdNode.AsXmlElement().InnerText); ResponseXmlDoc.SelectSingleNode('/participation/status', StatusNode); - Participation.ValidateCDNStatus(StatusNode.AsXmlElement().InnerText); + Participation.ValidateCdnStatus(StatusNode.AsXmlElement().InnerText); ResponseXmlDoc.SelectSingleNode('/participation/created_utc', CreatedNode); Evaluate(Participation.Created, CreatedNode.AsXmlElement().InnerText, 9); @@ -443,7 +438,7 @@ codeunit 6393 "API Requests" Evaluate(Participation.Updated, UpdatedNode.AsXmlElement().InnerText, 9); ResponseXmlDoc.SelectSingleNode('/participation/timestamp', TimestampNode); - Participation."CDN Timestamp" := CopyStr(TimestampNode.AsXmlElement().InnerText, 1, MaxStrLen(Participation."CDN Timestamp")); + Participation."Cdn Timestamp" := CopyStr(TimestampNode.AsXmlElement().InnerText, 1, MaxStrLen(Participation."Cdn Timestamp")); Participation.Modify(); end; @@ -451,55 +446,53 @@ codeunit 6393 "API Requests" #region Participation Profiles endpoints in Continia Delivery Network - internal procedure GetParticipationProfile(var ActivatedNetworkProfile: Record "Activated Net. Prof."; ParticipationGUID: Guid) + internal procedure GetParticipationProfile(var ActivatedNetworkProfile: Record "Activated Net. Prof."; ParticipationGuid: Guid) var - APIUrlMgt: Codeunit "API URL Mgt."; + ApiUrlMgt: Codeunit "Api Url Mgt."; HttpResponseMessage: HttpResponseMessage; begin - if ExecuteRequest('GET', APIUrlMgt.SingleParticipationProfileURL(ActivatedNetworkProfile.Network, ParticipationGUID, ActivatedNetworkProfile."CDN GUID"), HttpResponseMessage) then + if ExecuteRequest('GET', ApiUrlMgt.SingleParticipationProfileUrl(ActivatedNetworkProfile.Network, ParticipationGuid, ActivatedNetworkProfile.Id), HttpResponseMessage) then UpdateParticipationProfile(HttpResponseMessage, ActivatedNetworkProfile); end; - internal procedure PostParticipationProfile(TempActivatedNetworkProfile: Record "Activated Net. Prof." temporary; ParticipationGUID: Guid) + internal procedure PostParticipationProfile(TempActivatedNetworkProfile: Record "Activated Net. Prof." temporary; ParticipationGuid: Guid) var - APIUrlMgt: Codeunit "API URL Mgt."; + ApiUrlMgt: Codeunit "Api Url Mgt."; HttpResponseMessage: HttpResponseMessage; HttpContentData: Text; begin HttpContentData := GetParticipationProfilesRequest(TempActivatedNetworkProfile); - if ExecuteRequest('POST', APIUrlMgt.ParticipationProfilesURL(TempActivatedNetworkProfile.Network, ParticipationGUID), HttpContentData, HttpResponseMessage) then + if ExecuteRequest('POST', ApiUrlMgt.ParticipationProfilesUrl(TempActivatedNetworkProfile.Network, ParticipationGuid), HttpContentData, HttpResponseMessage) then UpdateParticipationProfile(HttpResponseMessage, TempActivatedNetworkProfile); end; - internal procedure PatchParticipationProfiles(var ActivatedNetworkProfile: Record "Activated Net. Prof."; ParticipationGUID: Guid) + internal procedure PatchParticipationProfiles(var ActivatedNetworkProfile: Record "Activated Net. Prof."; ParticipationGuid: Guid) var - APIUrlMgt: Codeunit "API URL Mgt."; + ApiUrlMgt: Codeunit "Api Url Mgt."; HttpResponseMessage: HttpResponseMessage; HttpContentData: Text; begin HttpContentData := GetParticipationProfilesRequest(ActivatedNetworkProfile); - if ExecuteRequest('PATCH', APIUrlMgt.SingleParticipationProfileURL(ActivatedNetworkProfile.Network, ParticipationGUID, ActivatedNetworkProfile."CDN GUID"), HttpContentData, HttpResponseMessage) then + if ExecuteRequest('PATCH', ApiUrlMgt.SingleParticipationProfileUrl(ActivatedNetworkProfile.Network, ParticipationGuid, ActivatedNetworkProfile.Id), HttpContentData, HttpResponseMessage) then UpdateParticipationProfile(HttpResponseMessage, ActivatedNetworkProfile); end; - internal procedure DeleteParticipationProfiles(var ActivatedNetworkProfile: Record "Activated Net. Prof."; ParticipationGUID: Guid) + internal procedure DeleteParticipationProfiles(var ActivatedNetworkProfile: Record "Activated Net. Prof."; ParticipationGuid: Guid) var - APIUrlMgt: Codeunit "API URL Mgt."; + ApiUrlMgt: Codeunit "Api Url Mgt."; HttpResponseMessage: HttpResponseMessage; begin - if ExecuteRequest('DELETE', APIUrlMgt.SingleParticipationProfileURL(ActivatedNetworkProfile.Network, ParticipationGUID, ActivatedNetworkProfile."Network Profile ID"), HttpResponseMessage) then begin + if ExecuteRequest('DELETE', ApiUrlMgt.SingleParticipationProfileUrl(ActivatedNetworkProfile.Network, ParticipationGuid, ActivatedNetworkProfile."Network Profile Id"), HttpResponseMessage) then begin ActivatedNetworkProfile.Validate(Disabled, CreateDateTime(Today, Time)); ActivatedNetworkProfile.Modify(); end; end; - [InherentPermissions(PermissionObjectType::TableData, Database::"Participation", 'r', InherentPermissionsScope::Both)] - [InherentPermissions(PermissionObjectType::TableData, Database::"Activated Net. Prof.", 'rm', InherentPermissionsScope::Both)] internal procedure GetAllParticipationProfiles(Participation: Record "Participation") var - APIUrlMgt: Codeunit "API URL Mgt."; + ApiUrlMgt: Codeunit "Api Url Mgt."; IsLastPage: Boolean; HttpResponseMessage: HttpResponseMessage; CurrPage: Integer; @@ -510,8 +503,8 @@ codeunit 6393 "API Requests" IsLastPage := false; repeat CurrPage += 1; - if ExecuteRequest('GET', APIUrlMgt.ParticipationProfilesURL(Participation.Network, Participation."CDN GUID", CurrPage, PageSize), HttpResponseMessage) then begin - HandleAPIError(HttpResponseMessage); + if ExecuteRequest('GET', ApiUrlMgt.ParticipationProfilesUrl(Participation.Network, Participation.Id, CurrPage, PageSize), HttpResponseMessage) then begin + HandleApiError(HttpResponseMessage); IsLastPage := ReadParticipationProfilesResponse(HttpResponseMessage, Participation, PageSize); end; until IsLastPage; @@ -549,17 +542,17 @@ codeunit 6393 "API Requests" var ParticipationProfileNode: XmlElement; ProfileDirectionNode: XmlElement; - ProfileIDNode: XmlElement; + ProfileIdNode: XmlElement; begin ParticipationProfileNode := XmlElement.Create('participation_profile'); ProfileDirectionNode := XmlElement.Create('direction'); - ProfileDirectionNode.Add(XmlText.Create(ActivatedNetworkProfile.GetParticipAPIDirectionEnum())); + ProfileDirectionNode.Add(XmlText.Create(ActivatedNetworkProfile.GetParticipApiDirectionEnum())); ParticipationProfileNode.Add(ProfileDirectionNode); - ProfileIDNode := XmlElement.Create('network_profile_id'); - ProfileIDNode.Add(XmlText.Create(GetGUIDAsText(ActivatedNetworkProfile."Network Profile ID"))); - ParticipationProfileNode.Add(ProfileIDNode); + ProfileIdNode := XmlElement.Create('network_profile_id'); + ProfileIdNode.Add(XmlText.Create(GetGuidAsText(ActivatedNetworkProfile."Network Profile Id"))); + ParticipationProfileNode.Add(ProfileIdNode); ParticipationProfileNode.WriteTo(RequestBody); end; @@ -567,30 +560,30 @@ codeunit 6393 "API Requests" local procedure CreateOrUpdateParticipProfiles(Participation: Record "Participation"; ProfilesNode: XmlNode) var ActivatedNetworkProfile: Record "Activated Net. Prof."; - ProfileGUID: Guid; + ProfileGuid: Guid; CreatedNode: XmlNode; DirectionNode: XmlNode; DisabledNode: XmlNode; - ParticipationProfileIDNode: XmlNode; - ProfileIDNode: XmlNode; + ParticipationProfileIdNode: XmlNode; + ProfileIdNode: XmlNode; UpdatedNode: XmlNode; begin - ProfilesNode.SelectSingleNode('network_profile_id', ProfileIDNode); - Evaluate(ProfileGUID, ProfileIDNode.AsXmlElement().InnerText); - if not ActivatedNetworkProfile.Get(Participation.Network, Participation."Identifier Type ID", Participation."Identifier Value", ProfileGUID) then begin + ProfilesNode.SelectSingleNode('network_profile_id', ProfileIdNode); + Evaluate(ProfileGuid, ProfileIdNode.AsXmlElement().InnerText); + if not ActivatedNetworkProfile.Get(Participation.Network, Participation."Identifier Type Id", Participation."Identifier Value", ProfileGuid) then begin ActivatedNetworkProfile.Init(); ActivatedNetworkProfile.Network := Participation.Network; - ActivatedNetworkProfile."Identifier Type ID" := Participation."Identifier Type ID"; + ActivatedNetworkProfile."Identifier Type Id" := Participation."Identifier Type Id"; ActivatedNetworkProfile."Identifier Value" := Participation."Identifier Value"; - ActivatedNetworkProfile."Network Profile ID" := ProfileGUID; + ActivatedNetworkProfile."Network Profile Id" := ProfileGuid; ActivatedNetworkProfile.Insert(); end; - ProfilesNode.SelectSingleNode('participation_profile_id', ParticipationProfileIDNode); - Evaluate(ActivatedNetworkProfile."CDN GUID", ParticipationProfileIDNode.AsXmlElement().InnerText); + ProfilesNode.SelectSingleNode('participation_profile_id', ParticipationProfileIdNode); + Evaluate(ActivatedNetworkProfile.Id, ParticipationProfileIdNode.AsXmlElement().InnerText); ProfilesNode.SelectSingleNode('direction', DirectionNode); - ActivatedNetworkProfile.ValidateAPIDirection(DirectionNode.AsXmlElement().InnerText); + ActivatedNetworkProfile.ValidateApiDirection(DirectionNode.AsXmlElement().InnerText); ProfilesNode.SelectSingleNode('created_utc', CreatedNode); Evaluate(ActivatedNetworkProfile.Created, CreatedNode.AsXmlElement().InnerText, 9); @@ -613,7 +606,7 @@ codeunit 6393 "API Requests" CreatedNode: XmlNode; DirectionNode: XmlNode; DisabledNode: XmlNode; - ProfileIDNode: XmlNode; + ProfileIdNode: XmlNode; UpdatedNode: XmlNode; begin HttpResponseMessage.Content.ReadAs(ResponseBody); @@ -621,11 +614,11 @@ codeunit 6393 "API Requests" exit; XmlDocument.ReadFrom(ResponseBody, ResponseXmlDoc); - ResponseXmlDoc.SelectSingleNode('/participation_profile/participation_profile_id', ProfileIDNode); - Evaluate(ActivatedNetworkProfile."CDN GUID", ProfileIDNode.AsXmlElement().InnerText); + ResponseXmlDoc.SelectSingleNode('/participation_profile/participation_profile_id', ProfileIdNode); + Evaluate(ActivatedNetworkProfile.Id, ProfileIdNode.AsXmlElement().InnerText); ResponseXmlDoc.SelectSingleNode('/participation_profile/direction', DirectionNode); - ActivatedNetworkProfile.ValidateAPIDirection(DirectionNode.AsXmlElement().InnerText); + ActivatedNetworkProfile.ValidateApiDirection(DirectionNode.AsXmlElement().InnerText); ResponseXmlDoc.SelectSingleNode('/participation_profile/created_utc', CreatedNode); Evaluate(ActivatedNetworkProfile.Created, CreatedNode.AsXmlElement().InnerText, 9); @@ -649,19 +642,19 @@ codeunit 6393 "API Requests" internal procedure CheckProfilesNotRegistered(TempActivatedNetworkProfile: Record "Activated Net. Prof." temporary; TempParticipation: Record "Participation" temporary) var NetworkIdentifier: Record "Network Identifier"; - APIUrlMgt: Codeunit "API URL Mgt."; + ApiUrlMgt: Codeunit "Api Url Mgt."; HttpResponseMessage: HttpResponseMessage; begin NetworkIdentifier := TempParticipation.GetNetworkIdentifier(); - if ExecuteRequest('GET', APIUrlMgt.ParticipationLookupURL(TempParticipation.Network, NetworkIdentifier."Identifier Type ID", TempParticipation."Identifier Value"), HttpResponseMessage) then + if ExecuteRequest('GET', ApiUrlMgt.ParticipationLookupUrl(TempParticipation.Network, NetworkIdentifier."Identifier Type Id", TempParticipation."Identifier Value"), HttpResponseMessage) then HandleProfilesLookupResponse(HttpResponseMessage, TempActivatedNetworkProfile, TempParticipation); end; local procedure HandleProfilesLookupResponse(var HttpResponseMessage: HttpResponseMessage; var TempActivatedNetworkProfile: Record "Activated Net. Prof." temporary; var TempParticipation: Record "Participation" temporary) var ErrorInfo: ErrorInfo; - ProfileGUID: Guid; + ProfileGuid: Guid; i: Integer; j: Integer; AccessPointEmail: Text; @@ -674,7 +667,7 @@ codeunit 6393 "API Requests" AccessPointNode: XmlNode; APEmailNode: XmlNode; APNameNode: XmlNode; - ProfileID: XmlNode; + ProfileId: XmlNode; ProfileNode: XmlNode; AccessPointNodeList: XmlNodeList; ProfilesNodeList: XmlNodeList; @@ -690,9 +683,9 @@ codeunit 6393 "API Requests" AccessPointNode.SelectNodes('supported_profiles', ProfilesNodeList); for j := 1 to ProfilesNodeList.Count do begin ProfilesNodeList.Get(j, ProfileNode); - if ProfileNode.SelectSingleNode('network_profile_id', ProfileID) then begin - Evaluate(ProfileGUID, ProfileID.AsXmlElement().InnerText); - if TempActivatedNetworkProfile.Get(TempParticipation.Network, TempParticipation."Identifier Type ID", TempParticipation."Identifier Value", ProfileGUID) then begin + if ProfileNode.SelectSingleNode('network_profile_id', ProfileId) then begin + Evaluate(ProfileGuid, ProfileId.AsXmlElement().InnerText); + if TempActivatedNetworkProfile.Get(TempParticipation.Network, TempParticipation."Identifier Type Id", TempParticipation."Identifier Value", ProfileGuid) then begin AccessPointNode.SelectSingleNode('name', APNameNode); AccessPointNode.SelectSingleNode('email', APEmailNode); AccessPointName := APNameNode.AsXmlElement().InnerText; @@ -712,7 +705,7 @@ codeunit 6393 "API Requests" if RegisteredProfilesErrText <> '' then begin ErrorInfo.Title := ParticipationAlreadyRegisteredTitleErr; - ErrorInfo.Message := StrSubstNo(ParticipationAlreadyRegisteredErr, TempParticipation.Network, TempParticipation."Identifier Type ID", TempParticipation."Identifier Value"); + ErrorInfo.Message := StrSubstNo(ParticipationAlreadyRegisteredErr, TempParticipation.Network, TempParticipation."Identifier Type Id", TempParticipation."Identifier Value"); ErrorInfo.DetailedMessage(DetailedErrText); Error(ErrorInfo); end @@ -724,7 +717,7 @@ codeunit 6393 "API Requests" internal procedure GetDocumentsForCompany(var HttpRequest: HttpRequestMessage; var HttpResponse: HttpResponseMessage): Boolean var - APIUrlMgt: Codeunit "API URL Mgt."; + ApiUrlMgt: Codeunit "Api Url Mgt."; CredentialManagement: Codeunit "Credential Management"; CurrPage: Integer; PageSize: Integer; @@ -732,7 +725,7 @@ codeunit 6393 "API Requests" CurrPage := 1; PageSize := 100; // only get 100 documents at a time. - if ExecuteRequest('GET', APIUrlMgt.DocumentsForCompanyURL(CredentialManagement.GetCompanyId(), CurrPage, PageSize, true), HttpRequest, HttpResponse) then + if ExecuteRequest('GET', ApiUrlMgt.DocumentsForCompanyUrl(CredentialManagement.GetCompanyId(), CurrPage, PageSize, true), HttpRequest, HttpResponse) then exit(true); end; @@ -746,7 +739,7 @@ codeunit 6393 "API Requests" ConnectionSetup: Record "Connection Setup"; CredentialManagement: Codeunit "Credential Management"; Base64Convert: Codeunit "Base64 Convert"; - APIUrlMgt: Codeunit "API URL Mgt."; + ApiUrlMgt: Codeunit "Api Url Mgt."; HttpResponseMessage: HttpResponseMessage; ReadStream: InStream; HttpContentData: Text; @@ -764,61 +757,61 @@ codeunit 6393 "API Requests" RootNode.WriteTo(HttpContentData); - if ExecuteRequest('POST', APIUrlMgt.PostDocumentsUrl(CredentialManagement.GetCompanyId()), HttpContentData, HttpResponseMessage) then begin - SetEDocumentGUID(EDocument."Entry No", GetDocumentGUID(HttpResponseMessage)); + if ExecuteRequest('POST', ApiUrlMgt.PostDocumentsUrl(CredentialManagement.GetCompanyId()), HttpContentData, HttpResponseMessage) then begin + SetEDocumentGuid(EDocument."Entry No", GetDocumentGuid(HttpResponseMessage)); exit(true); end; end; - local procedure SetEDocumentGUID(EDocEntryNo: Integer; DocumentID: Guid) + local procedure SetEDocumentGuid(EDocEntryNo: Integer; DocumentId: Guid) var EDocument: Record "E-Document"; begin - if IsNullGuid(DocumentID) then + if IsNullGuid(DocumentId) then exit; if not EDocument.Get(EDocEntryNo) then exit; - EDocument."Document Id" := DocumentID; + EDocument."Document Id" := DocumentId; EDocument.Modify(); end; - local procedure GetDocumentGUID(var HttpResponseMessage: HttpResponseMessage) DocumentGUID: Guid + local procedure GetDocumentGuid(var HttpResponseMessage: HttpResponseMessage) DocumentGuid: Guid var ResponseBody: Text; ResponseXmlDoc: XmlDocument; - DocumentGUIDNode: XmlNode; + DocumentGuidNode: XmlNode; begin HttpResponseMessage.Content.ReadAs(ResponseBody); if ResponseBody = '' then exit; XmlDocument.ReadFrom(ResponseBody, ResponseXmlDoc); - ResponseXmlDoc.SelectSingleNode('/id_result/id', DocumentGUIDNode); - Evaluate(DocumentGUID, DocumentGUIDNode.AsXmlElement().InnerText); - exit(DocumentGUID); + ResponseXmlDoc.SelectSingleNode('/id_result/id', DocumentGuidNode); + Evaluate(DocumentGuid, DocumentGuidNode.AsXmlElement().InnerText); + exit(DocumentGuid); end; #endregion #region Get Technical response internal procedure GetTechnicalResponse(var EDocument: Record "E-Document"; var HttpRequest: HttpRequestMessage; var HttpResponse: HttpResponseMessage): Boolean var - APIUrlMgt: Codeunit "API URL Mgt."; + ApiUrlMgt: Codeunit "Api Url Mgt."; EDocumentErrorHelper: Codeunit "E-Document Error Helper"; - DocumentGUID: Guid; + DocumentGuid: Guid; SuccessfullStatusLbl: Label 'SuccessEnum'; ErrorfullStatusLbl: Label 'ErrorEnum'; DocumentStatus: Text; EDocumentDescription: Text; ResponseBody: Text; ResponseXmlDoc: XmlDocument; - DocumentReceiptIDNode: XmlNode; + DocumentReceiptIdNode: XmlNode; DocumentStatusNode: XmlNode; ErrorCodeNode: XmlNode; ErrorMessageNode: XmlNode; TechnicalResponseNode: XmlNode; begin - Evaluate(DocumentGUID, EDocument."Document Id"); - if ExecuteRequest('GET', APIUrlMgt.TechnicalResponseURL(DocumentGUID), HttpRequest, HttpResponse) then begin + Evaluate(DocumentGuid, EDocument."Document Id"); + if ExecuteRequest('GET', ApiUrlMgt.TechnicalResponseUrl(DocumentGuid), HttpRequest, HttpResponse) then begin HttpResponse.Content.ReadAs(ResponseBody); if ResponseBody = '' then exit(false); @@ -826,8 +819,8 @@ codeunit 6393 "API Requests" XmlDocument.ReadFrom(ResponseBody, ResponseXmlDoc); ResponseXmlDoc.SelectSingleNode('/technical_response', TechnicalResponseNode); - if TechnicalResponseNode.SelectSingleNode('document_receipt_id', DocumentReceiptIDNode) then begin - Evaluate(EDocument."Filepart Id", DocumentReceiptIDNode.AsXmlElement().InnerText); + if TechnicalResponseNode.SelectSingleNode('document_receipt_id', DocumentReceiptIdNode) then begin + Evaluate(EDocument."Filepart Id", DocumentReceiptIdNode.AsXmlElement().InnerText); EDocument.Modify(); end; @@ -836,7 +829,7 @@ codeunit 6393 "API Requests" case DocumentStatus of SuccessfullStatusLbl: begin - MarkDocumentAsProcessed(DocumentGUID); + MarkDocumentAsProcessed(DocumentGuid); exit(true); end; ErrorfullStatusLbl: @@ -844,7 +837,7 @@ codeunit 6393 "API Requests" if TechnicalResponseNode.SelectSingleNode('error_code', ErrorCodeNode) and TechnicalResponseNode.SelectSingleNode('error_message', ErrorMessageNode) then EDocumentDescription := StrSubstNo('%1 - %2', ErrorCodeNode.AsXmlElement().InnerText, ErrorMessageNode.AsXmlElement().InnerText); EDocumentErrorHelper.LogSimpleErrorMessage(EDocument, EDocumentDescription); - MarkDocumentAsProcessed(DocumentGUID); + MarkDocumentAsProcessed(DocumentGuid); exit(false); end; end; @@ -855,11 +848,11 @@ codeunit 6393 "API Requests" #endregion; #region Get Document Business Responses - internal procedure GetBusinessResponses(DocumentGUID: Guid; var HttpRequest: HttpRequestMessage; var HttpResponse: HttpResponseMessage): Boolean + internal procedure GetBusinessResponses(DocumentGuid: Guid; var HttpRequest: HttpRequestMessage; var HttpResponse: HttpResponseMessage): Boolean var - APIUrlMgt: Codeunit "API URL Mgt."; + ApiUrlMgt: Codeunit "Api Url Mgt."; begin - exit(ExecuteRequest('GET', APIUrlMgt.BusinessResponseURL(DocumentGUID), HttpRequest, HttpResponse)) + exit(ExecuteRequest('GET', ApiUrlMgt.BusinessResponseUrl(DocumentGuid), HttpRequest, HttpResponse)) end; #endregion @@ -867,39 +860,39 @@ codeunit 6393 "API Requests" #region Perform actions on document // Cancel document - internal procedure CancelDocument(DocumentGUID: Guid; var HttpRequest: HttpRequestMessage; var HttpResponse: HttpResponseMessage): Boolean + internal procedure CancelDocument(DocumentGuid: Guid; var HttpRequest: HttpRequestMessage; var HttpResponse: HttpResponseMessage): Boolean begin - exit(PerformActionOnDocument(DocumentGUID, 'CancelEnum', HttpRequest, HttpResponse)); + exit(PerformActionOnDocument(DocumentGuid, 'CancelEnum', HttpRequest, HttpResponse)); end; // Mark document as processed - internal procedure MarkDocumentAsProcessed(DocumentGUID: Guid): Boolean + internal procedure MarkDocumentAsProcessed(DocumentGuid: Guid): Boolean var HttpRequest: HttpRequestMessage; HttpResponse: HttpResponseMessage; begin - exit(PerformActionOnDocument(DocumentGUID, 'MarkAsProcessedEnum', HttpRequest, HttpResponse)); + exit(PerformActionOnDocument(DocumentGuid, 'MarkAsProcessedEnum', HttpRequest, HttpResponse)); end; - internal procedure ApproveDocument(DocumentGUID: Guid): Boolean + internal procedure ApproveDocument(DocumentGuid: Guid): Boolean var HttpRequest: HttpRequestMessage; HttpResponse: HttpResponseMessage; begin - exit(PerformActionOnDocument(DocumentGUID, 'ApproveEnum', HttpRequest, HttpResponse)); + exit(PerformActionOnDocument(DocumentGuid, 'ApproveEnum', HttpRequest, HttpResponse)); end; - internal procedure RejectDocument(DocumentGUID: Guid): Boolean + internal procedure RejectDocument(DocumentGuid: Guid): Boolean var HttpRequest: HttpRequestMessage; HttpResponse: HttpResponseMessage; begin - exit(PerformActionOnDocument(DocumentGUID, 'RejectEnum', HttpRequest, HttpResponse)); + exit(PerformActionOnDocument(DocumentGuid, 'RejectEnum', HttpRequest, HttpResponse)); end; - internal procedure PerformActionOnDocument(DocumentGUID: Guid; Action: Text; var HttpRequest: HttpRequestMessage; var HttpResponse: HttpResponseMessage): Boolean + internal procedure PerformActionOnDocument(DocumentGuid: Guid; Action: Text; var HttpRequest: HttpRequestMessage; var HttpResponse: HttpResponseMessage): Boolean var - APIUrlMgt: Codeunit "API URL Mgt."; + ApiUrlMgt: Codeunit "Api Url Mgt."; HttpContentData: Text; ActionNode: XmlElement; RootNode: XmlElement; @@ -912,19 +905,19 @@ codeunit 6393 "API Requests" RootNode.WriteTo(HttpContentData); - exit(ExecuteRequest('POST', APIUrlMgt.DocumentActionUrl(DocumentGUID), HttpContentData, HttpRequest, HttpResponse)); + exit(ExecuteRequest('POST', ApiUrlMgt.DocumentActionUrl(DocumentGuid), HttpContentData, HttpRequest, HttpResponse)); end; #endregion #region Helper functions - internal procedure DownloadFileFromURL(URL: Text; var TempBlob: Codeunit "Temp Blob") + internal procedure DownloadFileFromUrl(Url: Text; var TempBlob: Codeunit "Temp Blob") var HttpClient: HttpClient; HttpResponseMessage: HttpResponseMessage; ReadStream: InStream; WriteStream: OutStream; begin - HttpClient.Get(URL, HttpResponseMessage); + HttpClient.Get(Url, HttpResponseMessage); TempBlob.CreateOutStream(WriteStream); HttpResponseMessage.Content.ReadAs(ReadStream); CopyStream(WriteStream, ReadStream); @@ -980,10 +973,10 @@ codeunit 6393 "API Requests" end; if HttpClient.Send(HttpRequestMessage, HttpResponseMessage) then - exit(HandleAPIError(HttpResponseMessage)); + exit(HandleApiError(HttpResponseMessage)); end; - internal procedure HandleAPIError(var HttpResponseMessage: HttpResponseMessage): Boolean + internal procedure HandleApiError(var HttpResponseMessage: HttpResponseMessage): Boolean var HttpStatusCode: Integer; ResponseBody: Text; @@ -996,33 +989,33 @@ codeunit 6393 "API Requests" HttpResponseMessage.Content().ReadAs(ResponseBody); if ResponseBody <> '' then if not XmlDocument.ReadFrom(ResponseBody, ResponseBodyXML) then - exit(ThrowError(UnexpectedAPIErr)); + exit(ThrowError(UnexpectedApiErr)); ReadErrorResponse(ResponseBodyXML, HttpStatusCode); end; internal procedure ReadErrorResponse(var ResponseXML: XmlDocument; HttpStatusCode: Integer): Boolean var - APIErrorCode: Text; - APIErrorMessage: Text; + ApiErrorCode: Text; + ApiErrorMessage: Text; ErrorCodeNode: XmlNode; ErrorMessageNode: XmlNode; begin if not ResponseXML.SelectSingleNode('/error/code', ErrorCodeNode) then - exit(ThrowError(UnexpectedAPIErr)); + exit(ThrowError(UnexpectedApiErr)); if not ResponseXML.SelectSingleNode('/error/message', ErrorMessageNode) then - exit(ThrowError(UnexpectedAPIErr)); + exit(ThrowError(UnexpectedApiErr)); - APIErrorCode := ErrorCodeNode.AsXmlElement().InnerText; - APIErrorMessage := ErrorMessageNode.AsXmlElement().InnerText; + ApiErrorCode := ErrorCodeNode.AsXmlElement().InnerText; + ApiErrorMessage := ErrorMessageNode.AsXmlElement().InnerText; case HttpStatusCode of 500, 501: - exit(ThrowError(StrSubstNo(Error500Err, APIErrorCode, APIErrorMessage))); + exit(ThrowError(StrSubstNo(Error500Err, ApiErrorCode, ApiErrorMessage))); 400, 401, 402, 404: - exit(ThrowError(StrSubstNo(APIErr, APIErrorCode, APIErrorMessage))); + exit(ThrowError(StrSubstNo(ApiErr, ApiErrorCode, ApiErrorMessage))); else - exit(ThrowError(UnexpectedAPIErr)); + exit(ThrowError(UnexpectedApiErr)); end; end; @@ -1046,7 +1039,7 @@ codeunit 6393 "API Requests" exit(CountryRegion."ISO Code"); end; - internal procedure GetGUIDAsText(Value: Guid): Text[36] + internal procedure GetGuidAsText(Value: Guid): Text[36] begin exit(CopyStr(DelChr(Value, '<>', '{}'), 1, 36)) end; @@ -1061,12 +1054,12 @@ codeunit 6393 "API Requests" var SupressError: Boolean; AccessPointDetailedErr: Label 'Access Point: %1// Contact Email: %2// Registered Profiles://%3', Comment = '%1 = Access Point Name, %2 = Access Point Email, %3 = Registered Profiles'; - APIErr: Label 'The Continia Delivery Network API returned the following error: Error Code %1 - %2', Comment = '%1 = Continia Delivery Network Error Code, %2 = Error Message'; + ApiErr: Label 'The Continia Delivery Network API returned the following error: Error Code %1 - %2', Comment = '%1 = Continia Delivery Network Error Code, %2 = Error Message'; Error500Err: Label 'The Continia Delivery Network API returned the following system error: Error Code %1 - %2', Comment = '%1 = Continia Delivery Network Error Code, %2 = Error Message'; ParticipationAlreadyRegisteredErr: Label 'There is already a registration in %1 network with the identifier type %2 and value %3.', Comment = '%1 = Network Name, %2 = Identifier Type, %3 = Identifier Value'; ParticipationAlreadyRegisteredTitleErr: Label 'Registration Already Exists'; - UnexpectedAPIErr: Label 'There was an unexpected error while communicating with the Continia Delivery Network API.'; + UnexpectedApiErr: Label 'There was an unexpected error while communicating with the Continia Delivery Network API.'; } \ No newline at end of file diff --git a/Apps/W1/EDocumentsConnector/app/src/Continia/API Requests/APIURLMgt.Codeunit.al b/Apps/W1/EDocumentsConnector/app/src/Continia/API Requests/APIURLMgt.Codeunit.al index cf4a0565ad..25d501d2b7 100644 --- a/Apps/W1/EDocumentsConnector/app/src/Continia/API Requests/APIURLMgt.Codeunit.al +++ b/Apps/W1/EDocumentsConnector/app/src/Continia/API Requests/APIURLMgt.Codeunit.al @@ -5,66 +5,66 @@ namespace Microsoft.EServices.EDocumentConnector.Continia; using System.Environment; -codeunit 6392 "API URL Mgt." +codeunit 6392 "Api Url Mgt." { Access = Internal; - internal procedure NetworkProfilesURL(Network: Enum "Network"; Page: Integer; PageSize: Integer): Text + internal procedure NetworkProfilesUrl(Network: Enum "E-Delivery Network"; Page: Integer; PageSize: Integer): Text var ProfilesUrlLbl: Label '%1/networks/%2/profiles.xml?page=%3&page_size=%4', Locked = true; begin - exit(StrSubstNo(ProfilesUrlLbl, CDNBaseURL(), GetNetworkNameAsText(Network), Page, PageSize)); + exit(StrSubstNo(ProfilesUrlLbl, CdnBaseUrl(), GetNetworkNameAsText(Network), Page, PageSize)); end; - internal procedure NetworkIdentifiersURL(Network: Enum "Network"; Page: Integer; PageSize: Integer): Text + internal procedure NetworkIdentifiersUrl(Network: Enum "E-Delivery Network"; Page: Integer; PageSize: Integer): Text var IdentifiersUrlLbl: Label '%1/networks/%2/id_types.xml?page=%3&page_size=%4', Locked = true; begin - exit(StrSubstNo(IdentifiersUrlLbl, CDNBaseURL(), GetNetworkNameAsText(Network), Page, PageSize)); + exit(StrSubstNo(IdentifiersUrlLbl, CdnBaseUrl(), GetNetworkNameAsText(Network), Page, PageSize)); end; - internal procedure ParticipationURL(Network: Enum "Network"): Text + internal procedure ParticipationUrl(Network: Enum "E-Delivery Network"): Text var ParticipationUrlLbl: Label '%1/networks/%2/participations.xml', Locked = true; begin - exit(StrSubstNo(ParticipationUrlLbl, CDNBaseURL(), GetNetworkNameAsText(Network))) + exit(StrSubstNo(ParticipationUrlLbl, CdnBaseUrl(), GetNetworkNameAsText(Network))) end; - internal procedure SingleParticipationURL(Network: Enum "Network"; ParticipationGUID: Guid): Text + internal procedure SingleParticipationUrl(Network: Enum "E-Delivery Network"; ParticipationGuid: Guid): Text var SingleParticipationUrlLbl: Label '%1/networks/%2/participations/%3.xml', Locked = true; begin - exit(StrSubstNo(SingleParticipationUrlLbl, CDNBaseURL(), GetNetworkNameAsText(Network), GetGUIDAsText(ParticipationGUID))) + exit(StrSubstNo(SingleParticipationUrlLbl, CdnBaseUrl(), GetNetworkNameAsText(Network), GetGuidAsText(ParticipationGuid))) end; - internal procedure ParticipationProfilesURL(Network: Enum "Network"; ParticipationGUID: Guid): Text + internal procedure ParticipationProfilesUrl(Network: Enum "E-Delivery Network"; ParticipationGuid: Guid): Text var ParticipationProfilesUrlLbl: Label '%1/networks/%2/participations/%3/profiles.xml', Locked = true; begin - exit(StrSubstNo(ParticipationProfilesUrlLbl, CDNBaseURL(), GetNetworkNameAsText(Network), GetGUIDAsText(ParticipationGUID))) + exit(StrSubstNo(ParticipationProfilesUrlLbl, CdnBaseUrl(), GetNetworkNameAsText(Network), GetGuidAsText(ParticipationGuid))) end; - internal procedure ParticipationProfilesURL(Network: Enum "Network"; ParticipationGUID: Guid; Page: Integer; PageSize: Integer): Text + internal procedure ParticipationProfilesUrl(Network: Enum "E-Delivery Network"; ParticipationGuid: Guid; Page: Integer; PageSize: Integer): Text var ParticipationProfilesUrlPagesLbl: Label '%1/networks/%2/participations/%3/profiles.xml?page=%4&page_size=%5', Locked = true; begin - exit(StrSubstNo(ParticipationProfilesUrlPagesLbl, CDNBaseURL(), GetNetworkNameAsText(Network), GetGUIDAsText(ParticipationGUID), Page, PageSize)) + exit(StrSubstNo(ParticipationProfilesUrlPagesLbl, CdnBaseUrl(), GetNetworkNameAsText(Network), GetGuidAsText(ParticipationGuid), Page, PageSize)) end; - internal procedure SingleParticipationProfileURL(Network: Enum "Network"; ParticipationGUID: Guid; ProfileGUID: Guid): Text + internal procedure SingleParticipationProfileUrl(Network: Enum "E-Delivery Network"; ParticipationGuid: Guid; ProfileGuid: Guid): Text var SingleParticipationProfileUrlLbl: Label '%1/networks/%2/participations/%3/profiles/%4.xml', Locked = true; begin - exit(StrSubstNo(SingleParticipationProfileUrlLbl, CDNBaseURL(), GetNetworkNameAsText(Network), GetGUIDAsText(ParticipationGUID), GetGUIDAsText(ProfileGUID))) + exit(StrSubstNo(SingleParticipationProfileUrlLbl, CdnBaseUrl(), GetNetworkNameAsText(Network), GetGuidAsText(ParticipationGuid), GetGuidAsText(ProfileGuid))) end; - internal procedure ParticipationLookupURL(Network: Enum "Network"; IdType: Text[4]; IdValue: Text[50]): Text + internal procedure ParticipationLookupUrl(Network: Enum "E-Delivery Network"; IdType: Text[4]; IdValue: Text[50]): Text var ParticipationLookupUrlLbl: Label '%1/networks/%2/participation_lookups.xml?id_type=%3&id_value=%4', Locked = true; begin - exit(StrSubstNo(ParticipationLookupUrlLbl, CDNBaseURL(), GetNetworkNameAsText(Network), IdType, IdValue)) + exit(StrSubstNo(ParticipationLookupUrlLbl, CdnBaseUrl(), GetNetworkNameAsText(Network), IdType, IdValue)) end; - internal procedure DocumentsForCompanyURL(CompanyGUID: Guid; Page: Integer; PageSize: Integer; Incoming: Boolean): Text + internal procedure DocumentsForCompanyUrl(CompanyGuid: Guid; Page: Integer; PageSize: Integer; Incoming: Boolean): Text var DirectionQueryTxt: Text; DocumentsForCompanyUrlLbl: Label '%1/documents.xml?business_central_company_code=%2&page=%3&page_size=%4&direction=%5', Locked = true; @@ -73,35 +73,35 @@ codeunit 6392 "API URL Mgt." DirectionQueryTxt := 'IncomingEnum' else DirectionQueryTxt := 'OutgoingEnum'; - exit(StrSubstNo(DocumentsForCompanyUrlLbl, CDNBaseURL(), GetGUIDAsText(CompanyGUID), Page, PageSize, DirectionQueryTxt)) + exit(StrSubstNo(DocumentsForCompanyUrlLbl, CdnBaseUrl(), GetGuidAsText(CompanyGuid), Page, PageSize, DirectionQueryTxt)) end; - internal procedure DocumentActionUrl(DocumentGUID: Guid): Text + internal procedure DocumentActionUrl(DocumentGuid: Guid): Text var DocumentActionUrlLbl: Label '%1/documents/%2/action.xml', Locked = true; begin - exit(StrSubstNo(DocumentActionUrlLbl, CDNBaseURL(), GetGUIDAsText(DocumentGUID))) + exit(StrSubstNo(DocumentActionUrlLbl, CdnBaseUrl(), GetGuidAsText(DocumentGuid))) end; - internal procedure PostDocumentsUrl(CompanyGUID: Guid): Text + internal procedure PostDocumentsUrl(CompanyGuid: Guid): Text var PostDocumentsUrlLbl: Label '%1/documents.xml?business_central_company_code=%2', Locked = true; begin - exit(StrSubstNo(PostDocumentsUrlLbl, CDNBaseURL(), GetGUIDAsText(CompanyGUID))) + exit(StrSubstNo(PostDocumentsUrlLbl, CdnBaseUrl(), GetGuidAsText(CompanyGuid))) end; - internal procedure TechnicalResponseURL(DocumentGUID: Guid): Text + internal procedure TechnicalResponseUrl(DocumentGuid: Guid): Text var TechnicalResponseUrlLbl: Label '%1/documents/%2/technical_response.xml', Locked = true; begin - exit(StrSubstNo(TechnicalResponseUrlLbl, CDNBaseURL(), GetGUIDAsText(DocumentGUID))) + exit(StrSubstNo(TechnicalResponseUrlLbl, CdnBaseUrl(), GetGuidAsText(DocumentGuid))) end; - internal procedure BusinessResponseURL(DocumentGUID: Guid): Text + internal procedure BusinessResponseUrl(DocumentGuid: Guid): Text var BusinessResponseUrlLbl: Label '%1/documents/%2/business_responses.xml', Locked = true; begin - exit(StrSubstNo(BusinessResponseUrlLbl, CDNBaseURL(), GetGUIDAsText(DocumentGUID))) + exit(StrSubstNo(BusinessResponseUrlLbl, CdnBaseUrl(), GetGuidAsText(DocumentGuid))) end; internal procedure PartnerAccessTokenUrl(): Text @@ -160,27 +160,27 @@ codeunit 6392 "API URL Mgt." exit(StrSubstNo(GetUpdateCompanyInfoUrlLbl, COBaseUrl())); end; - local procedure COBaseUrl() URL: Text + local procedure COBaseUrl() Url: Text var Handled: Boolean; begin - OnGetCOBaseUrl(URL, Handled); + OnGetCOBaseUrl(Url, Handled); if Handled then - exit(URL); + exit(Url); exit('https://auth.continiaonline.com/api/v1'); end; - internal procedure CDNBaseURL() URL: Text + internal procedure CdnBaseUrl() Url: Text var EnvironmentInformation: Codeunit "Environment Information"; Handled: Boolean; LocalizedBaseUrl: Text; begin - OnGetCDNBaseUrl(URL, Handled); + OnGetCdnBaseUrl(Url, Handled); if Handled then - exit(URL); + exit(Url); LocalizedBaseUrl := GetBaseUrlForLocalization(EnvironmentInformation.GetApplicationFamily()); if LocalizedBaseUrl <> '' then @@ -202,12 +202,12 @@ codeunit 6392 "API URL Mgt." end; end; - internal procedure GetNetworkNameAsText(NetworkName: Enum "Network"): Text + internal procedure GetNetworkNameAsText(NetworkName: Enum "E-Delivery Network"): Text begin exit(NetworkName.Names.Get(NetworkName.Ordinals.IndexOf(NetworkName.AsInteger()))); end; - internal procedure GetGUIDAsText(Value: Guid): Text[36] + internal procedure GetGuidAsText(Value: Guid): Text[36] begin exit(CopyStr(DelChr(Value, '<>', '{}'), 1, 36)) end; @@ -219,7 +219,7 @@ codeunit 6392 "API URL Mgt." end; [IntegrationEvent(false, false)] - local procedure OnGetCDNBaseUrl(var ReturnUrl: Text; var Handled: Boolean) + local procedure OnGetCdnBaseUrl(var ReturnUrl: Text; var Handled: Boolean) begin end; diff --git a/Apps/W1/EDocumentsConnector/app/src/Continia/Implementation/ConnectionSetup.Table.al b/Apps/W1/EDocumentsConnector/app/src/Continia/Implementation/ConnectionSetup.Table.al index a750fe4bb1..fda39586ed 100644 --- a/Apps/W1/EDocumentsConnector/app/src/Continia/Implementation/ConnectionSetup.Table.al +++ b/Apps/W1/EDocumentsConnector/app/src/Continia/Implementation/ConnectionSetup.Table.al @@ -13,9 +13,9 @@ table 6390 "Connection Setup" { DataClassification = CustomerContent; } - field(3; "Client ID"; Guid) + field(3; "Client Id"; Guid) { - Caption = 'Client ID'; + Caption = 'Client Id'; DataClassification = EndUserIdentifiableInformation; } field(4; "Client Secret"; Guid) @@ -70,7 +70,7 @@ table 6390 "Connection Setup" var CredentialManagement: Codeunit "Credential Management"; begin - exit(CredentialManagement.GetIsolatedStorageValue("Client ID", DataScope::Module)); + exit(CredentialManagement.GetIsolatedStorageValue("Client Id", DataScope::Module)); end; internal procedure GetClientSecret(): SecretText @@ -84,7 +84,7 @@ table 6390 "Connection Setup" var CredentialManagement: Codeunit "Credential Management"; begin - exit(CredentialManagement.SetIsolatedStorageValue("Client ID", Value, DataScope::Module)); + exit(CredentialManagement.SetIsolatedStorageValue("Client Id", Value, DataScope::Module)); end; internal procedure SetClientSecret(Value: SecretText) UsedNewKey: Boolean diff --git a/Apps/W1/EDocumentsConnector/app/src/Continia/Implementation/EDocumentProcessing.Codeunit.al b/Apps/W1/EDocumentsConnector/app/src/Continia/Implementation/EDocumentProcessing.Codeunit.al index 14d11924c7..3a58b1fe59 100644 --- a/Apps/W1/EDocumentsConnector/app/src/Continia/Implementation/EDocumentProcessing.Codeunit.al +++ b/Apps/W1/EDocumentsConnector/app/src/Continia/Implementation/EDocumentProcessing.Codeunit.al @@ -4,7 +4,6 @@ // ------------------------------------------------------------------------------------------------ namespace Microsoft.EServices.EDocumentConnector.Continia; using Microsoft.eServices.EDocument; -using Microsoft.EServices.EDocumentConnector; using System.Utilities; using System.Telemetry; @@ -15,7 +14,7 @@ codeunit 6391 "EDocument Processing" var EdocumentService: Record "E-Document Service"; EDocumentServiceStatus: Record "E-Document Service Status"; - APIRequests: Codeunit "API Requests"; + ApiRequests: Codeunit "Api Requests"; EDocumentHelper: Codeunit "E-Document Helper"; FeatureTelemetry: Codeunit "Feature Telemetry"; begin @@ -25,10 +24,10 @@ codeunit 6391 "EDocument Processing" case EDocumentServiceStatus.Status of EDocumentServiceStatus.Status::Exported: - APIRequests.SendDocument(EDocument, TempBlob, HttpRequest, HttpResponse); + ApiRequests.SendDocument(EDocument, TempBlob, HttpRequest, HttpResponse); EDocumentServiceStatus.Status::"Sending Error": if EDocument."Document Id" = '' then - APIRequests.SendDocument(EDocument, TempBlob, HttpRequest, HttpResponse); + ApiRequests.SendDocument(EDocument, TempBlob, HttpRequest, HttpResponse); end; FeatureTelemetry.LogUptake('', ExternalServiceTok, Enum::"Feature Uptake Status"::Used); @@ -36,22 +35,22 @@ codeunit 6391 "EDocument Processing" internal procedure GetTechnicalResponse(var EDocument: Record "E-Document"; var HttpRequest: HttpRequestMessage; var HttpResponse: HttpResponseMessage): Boolean var - APIRequests: Codeunit "API Requests"; + ApiRequests: Codeunit "Api Requests"; begin - APIRequests.SetSupressError(true); + ApiRequests.SetSupressError(true); - exit(APIRequests.GetTechnicalResponse(EDocument, HttpRequest, HttpResponse)); + exit(ApiRequests.GetTechnicalResponse(EDocument, HttpRequest, HttpResponse)); end; internal procedure GetLastDocumentBusinessResponses(var EDocument: Record "E-Document"; var HttpRequest: HttpRequestMessage; var HttpResponse: HttpResponseMessage): Boolean var - APIRequests: Codeunit "API Requests"; - DocumentGUID: Guid; + ApiRequests: Codeunit "Api Requests"; + DocumentGuid: Guid; begin - Evaluate(DocumentGUID, EDocument."Document Id"); + Evaluate(DocumentGuid, EDocument."Document Id"); - APIRequests.SetSupressError(true); - if not APIRequests.GetBusinessResponses(DocumentGUID, HttpRequest, HttpResponse) then + ApiRequests.SetSupressError(true); + if not ApiRequests.GetBusinessResponses(DocumentGuid, HttpRequest, HttpResponse) then exit(false); exit(IsDocumentApproved(HttpResponse)); @@ -168,7 +167,7 @@ codeunit 6391 "EDocument Processing" [EventSubscriber(ObjectType::Codeunit, Codeunit::"E-Doc. Import", 'OnAfterInsertImportedEdocument', '', false, false)] local procedure OnAfterInsertImportedEdocument(var EDocument: Record "E-Document"; EDocumentService: Record "E-Document Service"; var TempBlob: Codeunit "Temp Blob"; EDocCount: Integer; HttpRequest: HttpRequestMessage; HttpResponse: HttpResponseMessage) var - APIRequests: Codeunit "API Requests"; + ApiRequests: Codeunit "Api Requests"; EDocumentLogHelper: Codeunit "E-Document Log Helper"; ContentData: Text; XMLFileToken: Text; @@ -200,13 +199,13 @@ codeunit 6391 "EDocument Processing" XMLFileToken := XMLFileTokenNode.AsXmlElement().InnerText; // Download XML file from XMLFileToken and save to TempBlob - APIRequests.DownloadFileFromURL(XMLFileToken, TempBlob); + ApiRequests.DownloadFileFromUrl(XMLFileToken, TempBlob); EDocumentLogHelper.InsertLog(EDocument, EDocumentService, TempBlob, "E-Document Service Status"::Imported); // Mark document as processed in Continia Online Evaluate(DocumentId, EDocument."Document Id"); - APIRequests.MarkDocumentAsProcessed(DocumentId); + ApiRequests.MarkDocumentAsProcessed(DocumentId); end; [EventSubscriber(ObjectType::Codeunit, Codeunit::"E-Doc. Import", 'OnBeforeInsertImportedEdocument', '', false, false)] @@ -232,7 +231,7 @@ codeunit 6391 "EDocument Processing" DocumentXMLPathLbl: Label '/documents/document[%1]', Locked = true; CurrentEDocumentNode: XmlNode; ParticipationProfileIdNode: XmlNode; - ParticipationNetworkProfileID: Guid; + ParticipationNetworkProfileId: Guid; begin HttpResponse.Content.ReadAs(ContentData); @@ -243,14 +242,14 @@ codeunit 6391 "EDocument Processing" DocumentResponse.SelectSingleNode(StrSubstNo(DocumentXMLPathLbl, EDocument."Index In Batch"), CurrentEDocumentNode); CurrentEDocumentNode.SelectSingleNode('participation_profile_id', ParticipationProfileIdNode); - Evaluate(ParticipationNetworkProfileID, ParticipationProfileIdNode.AsXmlElement().InnerText); + Evaluate(ParticipationNetworkProfileId, ParticipationProfileIdNode.AsXmlElement().InnerText); - ParticipationNetworkProfile.SetCurrentKey("CDN GUID"); - ParticipationNetworkProfile.SetRange("CDN GUID", ParticipationNetworkProfileID); + ParticipationNetworkProfile.SetCurrentKey(Id); + ParticipationNetworkProfile.SetRange(Id, ParticipationNetworkProfileId); if not ParticipationNetworkProfile.FindFirst() then exit(false); - NetworkProfile.Get(ParticipationNetworkProfile."Network Profile ID"); + NetworkProfile.Get(ParticipationNetworkProfile."Network Profile Id"); if not ProfileSupportedByEDocumentService(EDocumentService, NetworkProfile) then exit(false); exit(true); diff --git a/Apps/W1/EDocumentsConnector/app/src/Continia/Implementation/ExtConnectionSetup.Page.al b/Apps/W1/EDocumentsConnector/app/src/Continia/Implementation/ExtConnectionSetup.Page.al index 3954ec5c93..dabe8da5b8 100644 --- a/Apps/W1/EDocumentsConnector/app/src/Continia/Implementation/ExtConnectionSetup.Page.al +++ b/Apps/W1/EDocumentsConnector/app/src/Continia/Implementation/ExtConnectionSetup.Page.al @@ -43,15 +43,15 @@ page 6390 "Ext. Connection Setup" trigger OnDrillDown() var Participation: Record "Participation"; - APIRequests: Codeunit "API Requests"; + ApiRequests: Codeunit "Api Requests"; Participations: Page "Participations"; ProgressWindow: Dialog; begin ProgressWindow.Open(ProcessingWindowMsg); if Participation.FindSet() then repeat - APIRequests.GetParticipation(Participation); - APIRequests.GetAllParticipationProfiles(Participation); + ApiRequests.GetParticipation(Participation); + ApiRequests.GetAllParticipationProfiles(Participation); until Participation.Next() = 0; ProgressWindow.Close(); @@ -132,13 +132,13 @@ page 6390 "Ext. Connection Setup" trigger OnAction() var Participation: Record "Participation"; - APIRequests: Codeunit "API Requests"; + ApiRequests: Codeunit "Api Requests"; ActivationMgt: Codeunit "Subscription Mgt."; begin if Confirm(UnsubscribeQst) then begin if Participation.FindSet() then repeat - APIRequests.DeleteParticipation(Participation); + ApiRequests.DeleteParticipation(Participation); until Participation.Next() = 0; ActivationMgt.Unsubscribe(true); CurrPage.Update(false); diff --git a/Apps/W1/EDocumentsConnector/app/src/Continia/Implementation/IntegrationImpl.Codeunit.al b/Apps/W1/EDocumentsConnector/app/src/Continia/Implementation/IntegrationImpl.Codeunit.al index 41cc1167ce..b7c05b8a8b 100644 --- a/Apps/W1/EDocumentsConnector/app/src/Continia/Implementation/IntegrationImpl.Codeunit.al +++ b/Apps/W1/EDocumentsConnector/app/src/Continia/Implementation/IntegrationImpl.Codeunit.al @@ -41,20 +41,20 @@ codeunit 6390 "Integration Impl." implements "E-Document Integration" procedure Cancel(var EDocument: Record "E-Document"; var HttpRequest: HttpRequestMessage; var HttpResponse: HttpResponseMessage): Boolean var - APIRequests: Codeunit "API Requests"; - DocumentCDNGUID: Guid; + ApiRequests: Codeunit "Api Requests"; + DocumentId: Guid; begin - Evaluate(DocumentCDNGUID, EDocument."Document Id"); - APIRequests.CancelDocument(DocumentCDNGUID, HttpRequest, HttpResponse); + Evaluate(DocumentId, EDocument."Document Id"); + ApiRequests.CancelDocument(DocumentId, HttpRequest, HttpResponse); end; procedure ReceiveDocument(var TempBlob: Codeunit "Temp Blob"; var HttpRequest: HttpRequestMessage; var HttpResponse: HttpResponseMessage) var - APIRequests: Codeunit "API Requests"; + ApiRequests: Codeunit "Api Requests"; OutStream: OutStream; ContentData: Text; begin - if not APIRequests.GetDocumentsForCompany(HttpRequest, HttpResponse) then + if not ApiRequests.GetDocumentsForCompany(HttpRequest, HttpResponse) then exit; HttpResponse.Content.ReadAs(ContentData); diff --git a/Apps/W1/EDocumentsConnector/app/src/Continia/Metadata/Network.Enum.al b/Apps/W1/EDocumentsConnector/app/src/Continia/Metadata/EDeliveryNetwork.Enum.al similarity index 94% rename from Apps/W1/EDocumentsConnector/app/src/Continia/Metadata/Network.Enum.al rename to Apps/W1/EDocumentsConnector/app/src/Continia/Metadata/EDeliveryNetwork.Enum.al index 2509cb9501..71d9f0e8bc 100644 --- a/Apps/W1/EDocumentsConnector/app/src/Continia/Metadata/Network.Enum.al +++ b/Apps/W1/EDocumentsConnector/app/src/Continia/Metadata/EDeliveryNetwork.Enum.al @@ -4,7 +4,7 @@ // ------------------------------------------------------------------------------------------------ namespace Microsoft.EServices.EDocumentConnector.Continia; -enum 6390 "Network" +enum 6390 "E-Delivery Network" { Extensible = false; diff --git a/Apps/W1/EDocumentsConnector/app/src/Continia/Metadata/NetworkIdList.Page.al b/Apps/W1/EDocumentsConnector/app/src/Continia/Metadata/NetworkIdList.Page.al index dde2b98131..271ca7b610 100644 --- a/Apps/W1/EDocumentsConnector/app/src/Continia/Metadata/NetworkIdList.Page.al +++ b/Apps/W1/EDocumentsConnector/app/src/Continia/Metadata/NetworkIdList.Page.al @@ -17,7 +17,7 @@ page 6395 "Network Id. List" UsageCategory = None; ShowFilter = false; SourceTable = "Network Identifier"; - SourceTableView = sorting("Scheme ID") order(ascending); + SourceTableView = sorting("Scheme Id") order(ascending); layout { @@ -30,17 +30,17 @@ page 6395 "Network Id. List" ApplicationArea = All; ToolTip = 'The Network Name of the Network Identifier'; } - field("Scheme ID"; "Scheme ID") + field("Scheme Id"; "Scheme Id") { ApplicationArea = All; - ToolTip = 'The scheme ID of the identifier type.'; + ToolTip = 'The scheme Id of the identifier type.'; } field(Description; Description) { ApplicationArea = All; ToolTip = 'The description of the identifier type.'; } - field("Identifier Type ID"; "Identifier Type ID") + field("Identifier Type Id"; "Identifier Type Id") { ApplicationArea = All; ToolTip = 'The EAS code of the identifier type.'; @@ -53,7 +53,7 @@ page 6395 "Network Id. List" { area(Processing) { - action(GetContiniaNetworkIDTypes) + action(GetContiniaNetworkIdTypes) { ApplicationArea = All; Caption = 'Import Network ID Types'; @@ -61,10 +61,10 @@ page 6395 "Network Id. List" Image = Import; trigger OnAction() var - APIRequests: Codeunit "API Requests"; + ApiRequests: Codeunit "Api Requests"; begin - APIRequests.GetNetworkIDTypes(Enum::"Network"::peppol); - APIRequests.GetNetworkIDTypes(Enum::"Network"::nemhandel); + ApiRequests.GetNetworkIdTypes(Enum::"E-Delivery Network"::peppol); + ApiRequests.GetNetworkIdTypes(Enum::"E-Delivery Network"::nemhandel); end; } } diff --git a/Apps/W1/EDocumentsConnector/app/src/Continia/Metadata/NetworkIdentifier.Table.al b/Apps/W1/EDocumentsConnector/app/src/Continia/Metadata/NetworkIdentifier.Table.al index 37a9f6913b..a081b44e7f 100644 --- a/Apps/W1/EDocumentsConnector/app/src/Continia/Metadata/NetworkIdentifier.Table.al +++ b/Apps/W1/EDocumentsConnector/app/src/Continia/Metadata/NetworkIdentifier.Table.al @@ -13,19 +13,19 @@ table 6393 "Network Identifier" fields { - field(1; "CDN GUID"; Guid) + field(1; Id; Guid) { - Caption = 'CDN GUID'; + Caption = 'ID'; DataClassification = SystemMetadata; } - field(2; Network; Enum "Network") + field(2; Network; Enum "E-Delivery Network") { Caption = 'Network'; DataClassification = SystemMetadata; } - field(3; "Identifier Type ID"; Text[4]) + field(3; "Identifier Type Id"; Text[4]) { - Caption = 'Identifier Type ID'; + Caption = 'Identifier Type Id'; DataClassification = SystemMetadata; } field(4; Description; Text[250]) @@ -33,9 +33,9 @@ table 6393 "Network Identifier" Caption = 'Description'; DataClassification = SystemMetadata; } - field(5; "Scheme ID"; Text[50]) + field(5; "Scheme Id"; Text[50]) { - Caption = 'Scheme ID'; + Caption = 'Scheme Id'; DataClassification = SystemMetadata; } field(10; Default; Boolean) @@ -72,11 +72,11 @@ table 6393 "Network Identifier" keys { - key(Key1; "CDN GUID") + key(Key1; Id) { Clustered = true; } - key(Key2; "Scheme ID") + key(Key2; "Scheme Id") { } } diff --git a/Apps/W1/EDocumentsConnector/app/src/Continia/Metadata/NetworkProfile.Table.al b/Apps/W1/EDocumentsConnector/app/src/Continia/Metadata/NetworkProfile.Table.al index 0d535c1326..c0f75bb851 100644 --- a/Apps/W1/EDocumentsConnector/app/src/Continia/Metadata/NetworkProfile.Table.al +++ b/Apps/W1/EDocumentsConnector/app/src/Continia/Metadata/NetworkProfile.Table.al @@ -12,12 +12,12 @@ table 6394 "Network Profile" fields { - field(1; "CDN GUID"; Guid) + field(1; Id; Guid) { - Caption = 'CDN GUID'; + Caption = 'ID'; DataClassification = SystemMetadata; } - field(2; Network; Enum "Network") + field(2; Network; Enum "E-Delivery Network") { Caption = 'Network Name'; DataClassification = SystemMetadata; @@ -37,9 +37,9 @@ table 6394 "Network Profile" Caption = 'Description'; DataClassification = SystemMetadata; } - field(6; "Customization ID"; Text[250]) + field(6; "Customization Id"; Text[250]) { - Caption = 'Customization ID'; + Caption = 'Customization Id'; DataClassification = SystemMetadata; } field(10; Enabled; Boolean) @@ -62,12 +62,9 @@ table 6394 "Network Profile" keys { - key(Key1; "CDN GUID") + key(Key1; Id) { Clustered = true; } - key(Key2; Description) - { - } } } \ No newline at end of file diff --git a/Apps/W1/EDocumentsConnector/app/src/Continia/Metadata/NetworkProfileList.Page.al b/Apps/W1/EDocumentsConnector/app/src/Continia/Metadata/NetworkProfileList.Page.al index fb168df55d..a65d6fd2c6 100644 --- a/Apps/W1/EDocumentsConnector/app/src/Continia/Metadata/NetworkProfileList.Page.al +++ b/Apps/W1/EDocumentsConnector/app/src/Continia/Metadata/NetworkProfileList.Page.al @@ -16,7 +16,6 @@ page 6396 "Network Profile List" PageType = List; UsageCategory = None; SourceTable = "Network Profile"; - SourceTableView = sorting(Description) order(ascending); layout { @@ -60,10 +59,10 @@ page 6396 "Network Profile List" Image = Import; trigger OnAction() var - APIRequests: Codeunit "API Requests"; + ApiRequests: Codeunit "Api Requests"; begin - APIRequests.GetNetworkProfiles(Enum::"Network"::peppol); - APIRequests.GetNetworkProfiles(Enum::"Network"::nemhandel); + ApiRequests.GetNetworkProfiles(Enum::"E-Delivery Network"::peppol); + ApiRequests.GetNetworkProfiles(Enum::"E-Delivery Network"::nemhandel); end; } } diff --git a/Apps/W1/EDocumentsConnector/app/src/Continia/Onboarding/OnboardingHelper.Codeunit.al b/Apps/W1/EDocumentsConnector/app/src/Continia/Onboarding/OnboardingHelper.Codeunit.al index f451e624b6..94562a4edf 100644 --- a/Apps/W1/EDocumentsConnector/app/src/Continia/Onboarding/OnboardingHelper.Codeunit.al +++ b/Apps/W1/EDocumentsConnector/app/src/Continia/Onboarding/OnboardingHelper.Codeunit.al @@ -59,30 +59,30 @@ codeunit 6394 "Onboarding Helper" exit(CredentialManagement.IsClientCredentialsValid()); end; - internal procedure InitializeClient(PartnerUserName: Text; PartnerPassword: SecretText) PartnerID: Code[20] + internal procedure InitializeClient(PartnerUserName: Text; PartnerPassword: SecretText) PartnerId: Code[20] var ActivationMgt: Codeunit "Subscription Mgt."; begin ShowProgressWindow(SendingDataProgressMsg); - ActivationMgt.InitializeContiniaClient(PartnerUserName, PartnerPassword, PartnerID); + ActivationMgt.InitializeContiniaClient(PartnerUserName, PartnerPassword, PartnerId); AreClientCredentialsValid(); CloseProgressWindow(); end; internal procedure GetNetworkMetadata(ShowProgress: Boolean) var - APIRequests: Codeunit "API Requests"; + ApiRequests: Codeunit "Api Requests"; begin if MetaDataLoaded then exit; if ShowProgress then ShowProgressWindow(UpdatingDataProgressMsg); - APIRequests.GetNetworkIDTypes(Enum::"Network"::peppol); - APIRequests.GetNetworkIDTypes(Enum::"Network"::nemhandel); + ApiRequests.GetNetworkIdTypes(Enum::"E-Delivery Network"::peppol); + ApiRequests.GetNetworkIdTypes(Enum::"E-Delivery Network"::nemhandel); - APIRequests.GetNetworkProfiles(Enum::"Network"::peppol); - APIRequests.GetNetworkProfiles(Enum::"Network"::nemhandel); + ApiRequests.GetNetworkProfiles(Enum::"E-Delivery Network"::peppol); + ApiRequests.GetNetworkProfiles(Enum::"E-Delivery Network"::nemhandel); if ShowProgress then CloseProgressWindow(); @@ -118,7 +118,7 @@ codeunit 6394 "Onboarding Helper" var CompanyInformation: Record "Company Information"; NetworkIdentifier: Record "Network Identifier"; - EmptyGUID: Guid; + EmptyGuid: Guid; begin CompanyInformation.Get(); @@ -130,11 +130,11 @@ codeunit 6394 "Onboarding Helper" NetworkIdentifier.SetRange(Default, true); if NetworkIdentifier.FindFirst() then begin - TempParticipation."Identifier Type ID" := NetworkIdentifier."CDN GUID"; + TempParticipation."Identifier Type Id" := NetworkIdentifier.Id; TempParticipation."Identifier Value" := CompanyInformation."VAT Registration No."; - IdentifierTypeDesc := NetworkIdentifier."Scheme ID"; + IdentifierTypeDesc := NetworkIdentifier."Scheme Id"; end else begin - TempParticipation."Identifier Type ID" := EmptyGUID; + TempParticipation."Identifier Type Id" := EmptyGuid; TempParticipation."Identifier Value" := ''; IdentifierTypeDesc := ''; end; @@ -147,10 +147,10 @@ codeunit 6394 "Onboarding Helper" if IdentifierTypeDesc <> '' then begin NetworkIdentifier.SetRange(Network, TempParticipation.Network); NetworkIdentifier.SetRange(Enabled, true); - NetworkIdentifier.SetRange("Scheme ID", IdentifierTypeDesc); + NetworkIdentifier.SetRange("Scheme Id", IdentifierTypeDesc); NetworkIdentifier.FindFirst(); - TempParticipation."Identifier Type ID" := NetworkIdentifier."CDN GUID"; - IdentifierTypeDesc := NetworkIdentifier."Scheme ID"; + TempParticipation."Identifier Type Id" := NetworkIdentifier.Id; + IdentifierTypeDesc := NetworkIdentifier."Scheme Id"; end; end; @@ -167,8 +167,8 @@ codeunit 6394 "Onboarding Helper" if NetworkIdentifierList.RunModal() = Action::LookupOK then begin NetworkIdentifierList.GetRecord(NetworkIdentifier); - IdentifierTypeDesc := NetworkIdentifier."Scheme ID"; - TempParticipation."Identifier Type ID" := NetworkIdentifier."CDN GUID"; + IdentifierTypeDesc := NetworkIdentifier."Scheme Id"; + TempParticipation."Identifier Type Id" := NetworkIdentifier.Id; exit(true); end; end; @@ -178,7 +178,7 @@ codeunit 6394 "Onboarding Helper" NetworkIdentifier: Record "Network Identifier"; RegEx: Codeunit Regex; begin - if NetworkIdentifier.Get(TempParticipation."Identifier Type ID") then + if NetworkIdentifier.Get(TempParticipation."Identifier Type Id") then if not RegEx.IsMatch(TempParticipation."Identifier Value", NetworkIdentifier."Validation Rule") then Error(InvalidIdentifierValueErr, TempParticipation."Identifier Value", NetworkIdentifier."Validation Rule"); end; @@ -188,7 +188,7 @@ codeunit 6394 "Onboarding Helper" ActivatedProfiles: Record "Activated Net. Prof."; begin ActivatedProfiles.SetRange(Network, TempParticipation.Network); - ActivatedProfiles.SetRange("Identifier Type ID", TempParticipation."Identifier Type ID"); + ActivatedProfiles.SetRange("Identifier Type Id", TempParticipation."Identifier Type Id"); ActivatedProfiles.SetRange("Identifier Value", TempParticipation."Identifier Value"); if ActivatedProfiles.FindSet() then repeat @@ -209,7 +209,7 @@ codeunit 6394 "Onboarding Helper" if NetworkProfile.FindSet() then repeat TempActivatedProfiles.Init(); - TempActivatedProfiles."Network Profile ID" := NetworkProfile."CDN GUID"; + TempActivatedProfiles."Network Profile Id" := NetworkProfile.Id; TempActivatedProfiles.Insert(); until NetworkProfile.Next() = 0; end; @@ -271,11 +271,11 @@ codeunit 6394 "Onboarding Helper" internal procedure UpdateParticipation(var TempParticipation: Record "Participation" temporary) var - APIRequests: Codeunit "API Requests"; + ApiRequests: Codeunit "Api Requests"; begin if IsParticipationChanged(TempParticipation) then begin ShowProgressWindow(SendingDataProgressMsg); - APIRequests.PatchParticipation(TempParticipation); + ApiRequests.PatchParticipation(TempParticipation); CloseProgressWindow(); end; end; @@ -283,34 +283,34 @@ codeunit 6394 "Onboarding Helper" internal procedure UpdateProfiles(var TempParticipation: Record "Participation" temporary; var TempActivatedProfiles: Record "Activated Net. Prof." temporary) var ActivatedProfiles: Record "Activated Net. Prof."; - APIRequests: Codeunit "API Requests"; + ApiRequests: Codeunit "Api Requests"; begin ShowProgressWindow(SendingDataProgressMsg); if TempActivatedProfiles.FindSet() then repeat - if IsNullGuid(TempActivatedProfiles."Identifier Type ID") and (TempActivatedProfiles."Identifier Value" = '') then - TempActivatedProfiles.Rename(TempParticipation.Network, TempParticipation."Identifier Type ID", TempParticipation."Identifier Value", TempActivatedProfiles."Network Profile ID"); + if IsNullGuid(TempActivatedProfiles."Identifier Type Id") and (TempActivatedProfiles."Identifier Value" = '') then + TempActivatedProfiles.Rename(TempParticipation.Network, TempParticipation."Identifier Type Id", TempParticipation."Identifier Value", TempActivatedProfiles."Network Profile Id"); if ActivatedProfiles.Get(TempActivatedProfiles.RecordId) then begin if (TempActivatedProfiles."Profile Direction" <> ActivatedProfiles."Profile Direction") or (TempActivatedProfiles.Disabled <> ActivatedProfiles.Disabled) then begin - APIRequests.PatchParticipationProfiles(TempActivatedProfiles, TempParticipation."CDN GUID"); + ApiRequests.PatchParticipationProfiles(TempActivatedProfiles, TempParticipation.Id); ActivatedProfiles.TransferFields(TempActivatedProfiles, false); ActivatedProfiles.Modify(); end; end else begin - APIRequests.PostParticipationProfile(TempActivatedProfiles, TempParticipation."CDN GUID"); + ApiRequests.PostParticipationProfile(TempActivatedProfiles, TempParticipation.Id); ActivatedProfiles.TransferFields(TempActivatedProfiles, true); ActivatedProfiles.Insert(); end; until TempActivatedProfiles.Next() = 0; - ActivatedProfiles.SetRange("Identifier Type ID", TempParticipation."Identifier Type ID"); + ActivatedProfiles.SetRange("Identifier Type Id", TempParticipation."Identifier Type Id"); ActivatedProfiles.SetRange("Identifier Value", TempParticipation."Identifier Value"); ActivatedProfiles.SetRange(Network, TempParticipation.Network); if ActivatedProfiles.FindSet() then repeat if not TempActivatedProfiles.Get(ActivatedProfiles.RecordId) then - APIRequests.DeleteParticipationProfiles(ActivatedProfiles, TempParticipation."CDN GUID"); + ApiRequests.DeleteParticipationProfiles(ActivatedProfiles, TempParticipation.Id); until ActivatedProfiles.Next() = 0; CloseProgressWindow(); end; @@ -319,23 +319,23 @@ codeunit 6394 "Onboarding Helper" var CompanyInfo: Record "Company Information"; Participation: Record "Participation"; - APIRequests: Codeunit "API Requests"; - ParticipationGUID: Guid; + ApiRequests: Codeunit "Api Requests"; + ParticipationGuid: Guid; begin ShowProgressWindow(SendingDataProgressMsg); - ParticipationGUID := APIRequests.PostParticipation(TempParticipation); - Participation.SetRange("CDN GUID", ParticipationGUID); + ParticipationGuid := ApiRequests.PostParticipation(TempParticipation); + Participation.SetRange(Id, ParticipationGuid); Participation.FindFirst(); TempActivatedProfiles.FindSet(); repeat - APIRequests.PostParticipationProfile(TempActivatedProfiles, ParticipationGUID); + ApiRequests.PostParticipationProfile(TempActivatedProfiles, ParticipationGuid); until TempActivatedProfiles.Next() = 0; Participation.Validate("Registration Status", Participation."Registration Status"::InProcess); Participation.Modify(); - APIRequests.PatchParticipation(Participation); + ApiRequests.PatchParticipation(Participation); if Participation.Network = Participation.Network::nemhandel then begin CompanyInfo.Get(); @@ -351,7 +351,7 @@ codeunit 6394 "Onboarding Helper" var Participation: Record "Participation"; begin - if not Participation.Get(TempParticipation.Network, TempParticipation."Identifier Type ID", TempParticipation."Identifier Value") then + if not Participation.Get(TempParticipation.Network, TempParticipation."Identifier Type Id", TempParticipation."Identifier Value") then exit(true); if TempParticipation.Address <> Participation.Address then exit(true); @@ -414,10 +414,10 @@ codeunit 6394 "Onboarding Helper" internal procedure AddInvoiceCreditMemoProfiles(var TempParticipation: Record "Participation" temporary; ProfileDirection: Enum "Profile Direction"; var ActivatedProfiles: Record "Activated Net. Prof." temporary) begin case TempParticipation.Network of - "Network"::peppol: + "E-Delivery Network"::peppol: AddPeppolInvoiceCreditMemoProfiles(TempParticipation."Country/Region Code", ActivatedProfiles, ProfileDirection); - "Network"::nemhandel: - AddNetworkProfileByIdentifiers("Network"::nemhandel, ActivatedProfiles, ProfileDirection, + "E-Delivery Network"::nemhandel: + AddNetworkProfileByIdentifiers("E-Delivery Network"::nemhandel, ActivatedProfiles, ProfileDirection, 'urn:www.nesubl.eu:profiles:profile5:ver2.0', ''); end; end; @@ -426,26 +426,26 @@ codeunit 6394 "Onboarding Helper" begin case ForCountry of 'DE': - PopulateDEInvoiceCreditMemoProfiles("Network"::peppol, ActivatedProfiles, ProfileDirection); + PopulateDEInvoiceCreditMemoProfiles("E-Delivery Network"::peppol, ActivatedProfiles, ProfileDirection); 'NL': - PopulateNLInvoiceCreditMemoProfiles("Network"::peppol, ActivatedProfiles, ProfileDirection); + PopulateNLInvoiceCreditMemoProfiles("E-Delivery Network"::peppol, ActivatedProfiles, ProfileDirection); end; //PEPPOL Credit Note (BIS 3.0) - AddNetworkProfileByIdentifiers("Network"::peppol, ActivatedProfiles, ProfileDirection, + AddNetworkProfileByIdentifiers("E-Delivery Network"::peppol, ActivatedProfiles, ProfileDirection, 'urn:fdc:peppol.eu:2017:poacc:billing:01:1.0', 'urn:oasis:names:specification:ubl:schema:xsd:CreditNote-2::CreditNote##urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0::2.1'); //PEPPOL Cross Industry Invoice (BIS 3.0) - AddNetworkProfileByIdentifiers("Network"::peppol, ActivatedProfiles, ProfileDirection, + AddNetworkProfileByIdentifiers("E-Delivery Network"::peppol, ActivatedProfiles, ProfileDirection, 'urn:fdc:peppol.eu:2017:poacc:billing:01:1.0', 'urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100::CrossIndustryInvoice##urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0::D16B'); //PEPPOL Invoice (BIS 3.0) - AddNetworkProfileByIdentifiers("Network"::peppol, ActivatedProfiles, ProfileDirection, + AddNetworkProfileByIdentifiers("E-Delivery Network"::peppol, ActivatedProfiles, ProfileDirection, 'urn:fdc:peppol.eu:2017:poacc:billing:01:1.0', 'urn:oasis:names:specification:ubl:schema:xsd:Invoice-2::Invoice##urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0::2.1'); end; - local procedure PopulateDEInvoiceCreditMemoProfiles(ForNetwork: Enum "Network"; var ActivatedProfiles: Record "Activated Net. Prof."; ProfileDirection: Enum "Profile Direction") + local procedure PopulateDEInvoiceCreditMemoProfiles(ForNetwork: Enum "E-Delivery Network"; var ActivatedProfiles: Record "Activated Net. Prof."; ProfileDirection: Enum "Profile Direction") var NetworkProfile: Record "Network Profile"; begin @@ -457,7 +457,7 @@ codeunit 6394 "Onboarding Helper" until NetworkProfile.Next() = 0; end; - local procedure PopulateNLInvoiceCreditMemoProfiles(ForNetwork: Enum "Network"; var ActivatedProfiles: Record "Activated Net. Prof."; ProfileDirection: Enum "Profile Direction") + local procedure PopulateNLInvoiceCreditMemoProfiles(ForNetwork: Enum "E-Delivery Network"; var ActivatedProfiles: Record "Activated Net. Prof."; ProfileDirection: Enum "Profile Direction") begin //SI-UBL 2.0 Credit Note AddNetworkProfileByIdentifiers(ForNetwork, ActivatedProfiles, ProfileDirection, @@ -472,10 +472,10 @@ codeunit 6394 "Onboarding Helper" internal procedure AddInvoiceResponseProfiles(var TempParticipation: Record "Participation" temporary; ProfileDirection: Enum "Profile Direction"; var ActivatedProfiles: Record "Activated Net. Prof.") begin case TempParticipation.Network of - "Network"::peppol: + "E-Delivery Network"::peppol: PopulatePeppolInvoiceResponseProfiles(ActivatedProfiles, ProfileDirection); - "Network"::nemhandel: - AddNetworkProfileByIdentifiers("Network"::nemhandel, ActivatedProfiles, ProfileDirection, + "E-Delivery Network"::nemhandel: + AddNetworkProfileByIdentifiers("E-Delivery Network"::nemhandel, ActivatedProfiles, ProfileDirection, 'Procurement-BilSim-1.0', ''); end; end; @@ -483,7 +483,7 @@ codeunit 6394 "Onboarding Helper" local procedure PopulatePeppolInvoiceResponseProfiles(var ActivatedProfiles: Record "Activated Net. Prof."; ProfileDirection: Enum "Profile Direction") begin //PEPPOL Invoice Response (BIS 3.0) - AddNetworkProfileByIdentifiers("Network"::peppol, ActivatedProfiles, ProfileDirection, + AddNetworkProfileByIdentifiers("E-Delivery Network"::peppol, ActivatedProfiles, ProfileDirection, 'urn:fdc:peppol.eu:poacc:bis:invoice_response:3', 'urn:oasis:names:specification:ubl:schema:xsd:ApplicationResponse-2::ApplicationResponse##urn:fdc:peppol.eu:poacc:trns:invoice_response:3::2.1'); end; @@ -491,10 +491,10 @@ codeunit 6394 "Onboarding Helper" internal procedure AddOrderOnlyProfiles(var TempParticipation: Record "Participation" temporary; ProfileDirection: Enum "Profile Direction"; var ActivatedProfiles: Record "Activated Net. Prof.") begin case TempParticipation.Network of - "Network"::peppol: + "E-Delivery Network"::peppol: PopulatePeppolOrderOnlyProfiles(TempParticipation."Country/Region Code", ActivatedProfiles, ProfileDirection); - "Network"::nemhandel: - AddNetworkProfileByIdentifiers("Network"::nemhandel, ActivatedProfiles, ProfileDirection, + "E-Delivery Network"::nemhandel: + AddNetworkProfileByIdentifiers("E-Delivery Network"::nemhandel, ActivatedProfiles, ProfileDirection, 'urn:www.nesubl.eu:profiles:profile3:ver2.0', ''); end; end; @@ -504,13 +504,13 @@ codeunit 6394 "Onboarding Helper" case ForCountry of 'NO': //EHF Advanced Order Initiation 3.0 - AddNetworkProfileByIdentifiers("Network"::peppol, ActivatedProfiles, ProfileDirection, + AddNetworkProfileByIdentifiers("E-Delivery Network"::peppol, ActivatedProfiles, ProfileDirection, 'urn:fdc:anskaffelser.no:2019:ehf:postaward:g3:02:1.0', 'urn:oasis:names:specification:ubl:schema:xsd:Order-2::Order##urn:fdc:peppol.eu:poacc:trns:order:3:extended:urn:fdc:anskaffelser.no:2019:ehf:spec:3.0::2.2'); end; //PEPPOL Order Only (BIS 3.0) - AddNetworkProfileByIdentifiers("Network"::peppol, ActivatedProfiles, ProfileDirection, + AddNetworkProfileByIdentifiers("E-Delivery Network"::peppol, ActivatedProfiles, ProfileDirection, 'urn:fdc:peppol.eu:poacc:bis:order_only:3', 'urn:oasis:names:specification:ubl:schema:xsd:Order-2::Order##urn:fdc:peppol.eu:poacc:trns:order:3::2.1'); end; @@ -518,10 +518,10 @@ codeunit 6394 "Onboarding Helper" internal procedure AddOrderProfiles(var TempParticipation: Record "Participation" temporary; ProfileDirection: Enum "Profile Direction"; var ActivatedProfiles: Record "Activated Net. Prof.") begin case TempParticipation.Network of - "Network"::peppol: + "E-Delivery Network"::peppol: PopulatePeppolOrderProfiles(TempParticipation."Country/Region Code", ActivatedProfiles, ProfileDirection); - "Network"::nemhandel: - AddNetworkProfileByIdentifiers("Network"::nemhandel, ActivatedProfiles, ProfileDirection, + "E-Delivery Network"::nemhandel: + AddNetworkProfileByIdentifiers("E-Delivery Network"::nemhandel, ActivatedProfiles, ProfileDirection, 'Procurement-OrdSim-1.0', ''); end; end; @@ -531,20 +531,20 @@ codeunit 6394 "Onboarding Helper" case ForCountry of 'NO': //EHF Advanced Order Initiation 3.0 - AddNetworkProfileByIdentifiers("Network"::peppol, ActivatedProfiles, ProfileDirection, + AddNetworkProfileByIdentifiers("E-Delivery Network"::peppol, ActivatedProfiles, ProfileDirection, 'urn:fdc:anskaffelser.no:2019:ehf:postaward:g3:02:1.0', 'urn:oasis:names:specification:ubl:schema:xsd:Order-2::Order##urn:fdc:peppol.eu:poacc:trns:order:3:extended:urn:fdc:anskaffelser.no:2019:ehf:spec:3.0::2.2'); end; //PEPPOL Order (BIS 3.0) - AddNetworkProfileByIdentifiers("Network"::peppol, ActivatedProfiles, ProfileDirection, + AddNetworkProfileByIdentifiers("E-Delivery Network"::peppol, ActivatedProfiles, ProfileDirection, 'urn:fdc:peppol.eu:poacc:bis:ordering:3', 'urn:oasis:names:specification:ubl:schema:xsd:Order-2::Order##urn:fdc:peppol.eu:poacc:trns:order:3::2.1'); end; internal procedure AddOrderResponseProfiles(var TempParticipation: Record "Participation" temporary; ProfileDirection: Enum "Profile Direction"; var ActivatedProfiles: Record "Activated Net. Prof.") begin - if TempParticipation.Network = "Network"::peppol then + if TempParticipation.Network = "E-Delivery Network"::peppol then PopulatePeppolOrderResponseProfiles(TempParticipation."Country/Region Code", ActivatedProfiles, ProfileDirection); end; @@ -553,25 +553,25 @@ codeunit 6394 "Onboarding Helper" case ForCountry of 'NO': //EHF Advanced Order Response 3.0 - AddNetworkProfileByIdentifiers("Network"::peppol, ActivatedProfiles, ProfileDirection, + AddNetworkProfileByIdentifiers("E-Delivery Network"::peppol, ActivatedProfiles, ProfileDirection, 'urn:fdc:anskaffelser.no:2019:ehf:postaward:g3:02:1.0', 'urn:oasis:names:specification:ubl:schema:xsd:OrderResponse-2::OrderResponse##urn:fdc:peppol.eu:poacc:trns:order_response:3:extended:urn:fdc:anskaffelser.no:2019:ehf:spec:3.0::2.2'); end; //PEPPOL Order Response (BIS 3.0) - AddNetworkProfileByIdentifiers("Network"::peppol, ActivatedProfiles, ProfileDirection, + AddNetworkProfileByIdentifiers("E-Delivery Network"::peppol, ActivatedProfiles, ProfileDirection, 'urn:fdc:peppol.eu:poacc:bis:ordering:3', 'urn:oasis:names:specification:ubl:schema:xsd:OrderResponse-2::OrderResponse##urn:fdc:peppol.eu:poacc:trns:order_response:3::2.1'); end; internal procedure AddInvoiceAndOrderProfiles(var TempParticipation: Record "Participation" temporary; ProfileDirection: Enum "Profile Direction"; var ActivatedProfiles: Record "Activated Net. Prof.") begin - if TempParticipation.Network = "Network"::nemhandel then - AddNetworkProfileByIdentifiers("Network"::nemhandel, ActivatedProfiles, ProfileDirection, + if TempParticipation.Network = "E-Delivery Network"::nemhandel then + AddNetworkProfileByIdentifiers("E-Delivery Network"::nemhandel, ActivatedProfiles, ProfileDirection, 'Procurement-OrdSim-BilSim-1.0', ''); end; - local procedure AddNetworkProfileByIdentifiers(ForNetwork: Enum "Network"; var ActivatedProfiles: Record "Activated Net. Prof."; ProfileDirection: Enum "Profile Direction"; ProcessIdentifier: Text; + local procedure AddNetworkProfileByIdentifiers(ForNetwork: Enum "E-Delivery Network"; var ActivatedProfiles: Record "Activated Net. Prof."; ProfileDirection: Enum "Profile Direction"; ProcessIdentifier: Text; DocumentIdenfitier: Text) var NetworkProfile: Record "Network Profile"; @@ -583,7 +583,7 @@ codeunit 6394 "Onboarding Helper" if NetworkProfile.FindFirst() then begin ActivatedProfiles.Init(); ActivatedProfiles.Network := NetworkProfile.Network; - ActivatedProfiles."Network Profile ID" := NetworkProfile."CDN GUID"; + ActivatedProfiles."Network Profile Id" := NetworkProfile.Id; ActivatedProfiles."Profile Direction" := ProfileDirection; ActivatedProfiles.Insert(); end; diff --git a/Apps/W1/EDocumentsConnector/app/src/Continia/Onboarding/OnboardingWizard.Page.al b/Apps/W1/EDocumentsConnector/app/src/Continia/Onboarding/OnboardingWizard.Page.al index 0533be363a..aff7c3e910 100644 --- a/Apps/W1/EDocumentsConnector/app/src/Continia/Onboarding/OnboardingWizard.Page.al +++ b/Apps/W1/EDocumentsConnector/app/src/Continia/Onboarding/OnboardingWizard.Page.al @@ -5,10 +5,6 @@ namespace Microsoft.EServices.EDocumentConnector.Continia; using System.Email; -using System.Utilities; -using System.Reflection; -using Microsoft.Purchases.Vendor; -using Microsoft.Foundation.Company; using Microsoft.Foundation.Address; page 6393 "Onboarding Wizard" @@ -668,8 +664,8 @@ page 6393 "Onboarding Wizard" RunScenario::General: begin if not SkipCompanyInformation then begin - if TempCompanyContact."Partner ID" = '' then - TempCompanyContact."Partner ID" := PartnerID; + if TempCompanyContact."Partner Id" = '' then + TempCompanyContact."Partner Id" := PartnerId; OnboardingHelper.CreateSubscription(TempCompanyContact); end; RegisterParticipation(); @@ -747,7 +743,7 @@ page 6393 "Onboarding Wizard" local procedure OnBeforeMoveStep(Backwards: Boolean; CurrentStepSkipped: Boolean) begin if (Step = Step::PartnerDetails) and not Backwards and not CurrentStepSkipped then - PartnerID := OnboardingHelper.InitializeClient(PartnerUserName, PartnerPassword); + PartnerId := OnboardingHelper.InitializeClient(PartnerUserName, PartnerPassword); if (Step = Step::NetworkDetails) then if not Backwards and not CurrentStepSkipped then begin @@ -776,7 +772,7 @@ page 6393 "Onboarding Wizard" if Step = Step::NetworkDetails then begin ParticipationNetwork := TempParticipation.Network; ParticipationIdentifierValue := TempParticipation."Identifier Value"; - if IsNullGuid(TempParticipation."Identifier Type ID") then + if IsNullGuid(TempParticipation."Identifier Type Id") then OnboardingHelper.SetDefaultIdentifierData(TempParticipation, IdentifierTypeDesc); end; @@ -1016,14 +1012,14 @@ page 6393 "Onboarding Wizard" local procedure ValidateIdentifierData() begin - TempParticipation.TestField("Identifier Type ID"); + TempParticipation.TestField("Identifier Type Id"); TempParticipation.TestField("Identifier Value"); end; local procedure ValidateParticipationProfiles() var TempActivatedProfiles: Record "Activated Net. Prof." temporary; - APIRequests: Codeunit "API Requests"; + ApiRequests: Codeunit "Api Requests"; begin CurrPage.SelectProfilesPeppol.Page.GetProfileSelection(TempActivatedProfiles); @@ -1031,7 +1027,7 @@ page 6393 "Onboarding Wizard" Error(MustChooseAProfileErr); // Check if the profiles are not already registered, the function will thrown an error if any profiles are already registered - APIRequests.CheckProfilesNotRegistered(TempActivatedProfiles, TempParticipation); + ApiRequests.CheckProfilesNotRegistered(TempActivatedProfiles, TempParticipation); end; procedure SetRunScenario(ParamRunScenario: Enum "Wizard Scenario") @@ -1117,7 +1113,7 @@ page 6393 "Onboarding Wizard" LicenseTermsAccepted: Boolean; ReceiveInvoiceCreditMemo, ReceiveInvoiceResponse, ReceiveOrder, ReceiveOrderResponse, SendInvoiceCreditMemo, SendInvoiceResponse, SendOrder, SendOrderResponse : Boolean; SkipCompanyInformation: Boolean; - ParticipationNetwork: Enum "Network"; + ParticipationNetwork: Enum "E-Delivery Network"; RunScenario: Enum "Wizard Scenario"; LastStepsForward: Integer; EditSubscriptionPageCaptionLbl: Label 'Company Contact Information'; @@ -1132,6 +1128,6 @@ page 6393 "Onboarding Wizard" PartnerPassword: Text; [NonDebuggable] PartnerUserName: Text; - PartnerID: Code[20]; + PartnerId: Code[20]; } \ No newline at end of file diff --git a/Apps/W1/EDocumentsConnector/app/src/Continia/Onboarding/Participation.Table.al b/Apps/W1/EDocumentsConnector/app/src/Continia/Onboarding/Participation.Table.al index e6ec7440e6..725be72e2e 100644 --- a/Apps/W1/EDocumentsConnector/app/src/Continia/Onboarding/Participation.Table.al +++ b/Apps/W1/EDocumentsConnector/app/src/Continia/Onboarding/Participation.Table.al @@ -4,7 +4,6 @@ // ------------------------------------------------------------------------------------------------ namespace Microsoft.EServices.EDocumentConnector.Continia; -using System; using System.Email; using Microsoft.Finance.VAT.Registration; using Microsoft.Foundation.Address; @@ -17,14 +16,14 @@ table 6391 "Participation" fields { - field(1; Network; Enum "Network") + field(1; Network; Enum "E-Delivery Network") { Caption = 'Network'; } - field(2; "Identifier Type ID"; Guid) + field(2; "Identifier Type Id"; Guid) { Caption = 'Identifier Type'; - TableRelation = "Network Identifier"."CDN GUID" where(Network = field(Network)); + TableRelation = "Network Identifier".Id where(Network = field(Network)); } field(3; "Identifier Value"; Code[50]) { @@ -138,9 +137,9 @@ table 6391 "Participation" MailManagement.CheckValidEmailAddress("Signatory Email"); end; } - field(30; "CDN GUID"; Guid) + field(30; Id; Guid) { - Caption = 'CDN GUID'; + Caption = 'ID'; DataClassification = SystemMetadata; } field(31; Created; DateTime) @@ -153,7 +152,7 @@ table 6391 "Participation" Caption = 'Updated Date-Time'; DataClassification = SystemMetadata; } - field(33; "CDN Timestamp"; Text[250]) + field(33; "Cdn Timestamp"; Text[250]) { Caption = 'CDN Timestamp'; DataClassification = SystemMetadata; @@ -163,27 +162,27 @@ table 6391 "Participation" Caption = 'Published in Registry'; DataClassification = SystemMetadata; } - field(40; "Identifier Scheme ID"; Text[50]) + field(40; "Identifier Scheme Id"; Text[50]) { Caption = 'Identifier Type'; FieldClass = FlowField; - CalcFormula = lookup("Network Identifier"."Scheme ID" where("CDN GUID" = field("Identifier Type ID"))); + CalcFormula = lookup("Network Identifier"."Scheme Id" where(Id = field("Identifier Type Id"))); Editable = false; } - field(50; "Partner ID"; Code[20]) + field(50; "Partner Id"; Code[20]) { - Caption = 'Partner ID'; + Caption = 'Partner Id'; Editable = false; } } keys { - key(Key1; Network, "Identifier Type ID", "Identifier Value") + key(Key1; Network, "Identifier Type Id", "Identifier Value") { Clustered = true; } - key(Key2; "CDN GUID") + key(Key2; Id) { } } @@ -211,9 +210,9 @@ table 6391 "Participation" CountryRegion.FindFirst(); // Throws the standard error if not found. end; - internal procedure ValidateCDNStatus(CDNStatus: Text) + internal procedure ValidateCdnStatus(Status: Text) begin - case CDNStatus of + case Status of 'DraftEnum': Validate("Registration Status", "Registration Status"::Draft); 'InProcessEnum', 'ApprovedEnum', 'SuspendedEnum', 'ErrorEnum': @@ -248,7 +247,7 @@ table 6391 "Participation" internal procedure GetNetworkIdentifier() NetworkIdentifier: Record "Network Identifier" begin - NetworkIdentifier.SetRange("CDN GUID", "Identifier Type ID"); + NetworkIdentifier.SetRange(Id, "Identifier Type Id"); NetworkIdentifier.FindFirst(); exit(NetworkIdentifier); end; @@ -258,7 +257,7 @@ table 6391 "Participation" ActivatedProfiles: Record "Activated Net. Prof."; begin ActivatedProfiles.SetRange(Network, Rec.Network); - ActivatedProfiles.SetRange("Identifier Type ID", Rec."Identifier Type ID"); + ActivatedProfiles.SetRange("Identifier Type Id", Rec."Identifier Type Id"); ActivatedProfiles.SetRange("Identifier Value", Rec."Identifier Value"); ActivatedProfiles.DeleteAll(); end; diff --git a/Apps/W1/EDocumentsConnector/app/src/Continia/Onboarding/ProfileSelection.Page.al b/Apps/W1/EDocumentsConnector/app/src/Continia/Onboarding/ProfileSelection.Page.al index e88b04782d..1993b120e4 100644 --- a/Apps/W1/EDocumentsConnector/app/src/Continia/Onboarding/ProfileSelection.Page.al +++ b/Apps/W1/EDocumentsConnector/app/src/Continia/Onboarding/ProfileSelection.Page.al @@ -36,8 +36,8 @@ page 6394 "Profile Selection" NetworkProfile.FilterGroup(0); NetworkProfileList.LookupMode(true); - if not IsNullGuid(Rec."Network Profile ID") then - NetworkProfile.Get(Rec."Network Profile ID") + if not IsNullGuid(Rec."Network Profile Id") then + NetworkProfile.Get(Rec."Network Profile Id") else if Text <> '' then NetworkProfile.SetFilter(Description, StrSubstNo('@*%1*', Text)); @@ -46,7 +46,7 @@ page 6394 "Profile Selection" NetworkProfileList.SetRecord(NetworkProfile); if NetworkProfileList.RunModal() = Action::LookupOK then begin NetworkProfileList.GetRecord(NetworkProfile); - Rec."Network Profile ID" := NetworkProfile."CDN GUID"; + Rec."Network Profile Id" := NetworkProfile.Id; ProfileName := NetworkProfile.Description; Text := NetworkProfile.Description; exit(true); @@ -75,7 +75,7 @@ page 6394 "Profile Selection" trigger OnAfterGetRecord() begin - if not IsNullGuid(Rec."Network Profile ID") then begin + if not IsNullGuid(Rec."Network Profile Id") then begin Rec.CalcFields("Network Profile Description"); ProfileName := Rec."Network Profile Description"; end else @@ -147,12 +147,12 @@ page 6394 "Profile Selection" ActivatedNetworkProfiles := Original; end; - internal procedure SetCurrentNetwork(NewCurrentNetwork: Enum "Network") + internal procedure SetCurrentNetwork(NewCurrentNetwork: Enum "E-Delivery Network") begin CurrentNetwork := NewCurrentNetwork; end; var - CurrentNetwork: Enum "Network"; + CurrentNetwork: Enum "E-Delivery Network"; } diff --git a/Apps/W1/EDocumentsConnector/app/src/Continia/Participation Setup/ActivatedNetProf.Table.al b/Apps/W1/EDocumentsConnector/app/src/Continia/Participation Setup/ActivatedNetProf.Table.al index 2f779a0cce..012ae32a2b 100644 --- a/Apps/W1/EDocumentsConnector/app/src/Continia/Participation Setup/ActivatedNetProf.Table.al +++ b/Apps/W1/EDocumentsConnector/app/src/Continia/Participation Setup/ActivatedNetProf.Table.al @@ -11,36 +11,36 @@ table 6392 "Activated Net. Prof." fields { - field(1; Network; Enum "Network") + field(1; Network; Enum "E-Delivery Network") { Caption = 'Network'; DataClassification = CustomerContent; } - field(2; "Identifier Type ID"; Guid) + field(2; "Identifier Type Id"; Guid) { - Caption = 'Identifier Type ID'; + Caption = 'Identifier Type Id'; DataClassification = CustomerContent; - TableRelation = "Network Identifier"."CDN GUID" where(Network = field(Network)); + TableRelation = "Network Identifier".Id where(Network = field(Network)); } field(3; "Identifier Value"; Code[50]) { Caption = 'Identifier Value'; DataClassification = CustomerContent; } - field(4; "Network Profile ID"; Guid) + field(4; "Network Profile Id"; Guid) { - Caption = 'Network Profile ID'; + Caption = 'Network Profile Id'; DataClassification = CustomerContent; - TableRelation = "Network Profile"."CDN GUID" where(Network = field(Network)); + TableRelation = "Network Profile".Id where(Network = field(Network)); } field(5; "Profile Direction"; Enum "Profile Direction") { Caption = 'Profile Direction'; DataClassification = CustomerContent; } - field(6; "CDN GUID"; Guid) + field(6; Id; Guid) { - Caption = 'CDN GUID'; + Caption = 'ID'; DataClassification = SystemMetadata; } field(7; Created; DateTime) @@ -62,24 +62,24 @@ table 6392 "Activated Net. Prof." { Caption = 'Profile Description'; FieldClass = FlowField; - CalcFormula = lookup("Network Profile".Description where("CDN GUID" = field("Network Profile ID"))); + CalcFormula = lookup("Network Profile".Description where(Id = field("Network Profile Id"))); Editable = false; } } keys { - key(PK; Network, "Identifier Type ID", "Identifier Value", "Network Profile ID") + key(PK; Network, "Identifier Type Id", "Identifier Value", "Network Profile Id") { Clustered = true; } - key(Key2; "CDN GUID") + key(Key2; Id) { } } - internal procedure ValidateAPIDirection(Direction: Text) + internal procedure ValidateApiDirection(Direction: Text) begin case Direction of 'BothEnum': @@ -91,7 +91,7 @@ table 6392 "Activated Net. Prof." end; end; - internal procedure GetParticipAPIDirectionEnum(): Text + internal procedure GetParticipApiDirectionEnum(): Text begin case "Profile Direction" of "Profile Direction"::Both: @@ -105,8 +105,8 @@ table 6392 "Activated Net. Prof." internal procedure GetNetworkProfile(var NetworkProfile: Record "Network Profile"): Boolean begin - if not IsNullGuid("Network Profile ID") then - exit(NetworkProfile.Get("Network Profile ID")); + if not IsNullGuid("Network Profile Id") then + exit(NetworkProfile.Get("Network Profile Id")); end; } \ No newline at end of file diff --git a/Apps/W1/EDocumentsConnector/app/src/Continia/Participation Setup/Participations.Page.al b/Apps/W1/EDocumentsConnector/app/src/Continia/Participation Setup/Participations.Page.al index 75155b7b38..abbc692168 100644 --- a/Apps/W1/EDocumentsConnector/app/src/Continia/Participation Setup/Participations.Page.al +++ b/Apps/W1/EDocumentsConnector/app/src/Continia/Participation Setup/Participations.Page.al @@ -31,7 +31,7 @@ page 6391 "Participations" ApplicationArea = All; ToolTip = 'Specifies the network name where the participation is registered in.'; } - field(IdentifierType; "Identifier Scheme ID") + field(IdentifierType; "Identifier Scheme Id") { ApplicationArea = All; ToolTip = 'Specifies the type of identifier used for the participation.'; @@ -51,7 +51,7 @@ page 6391 "Participations" ApplicationArea = All; ToolTip = 'Specifies the date and time when the participation was last updated.'; } - field("CDN GUID"; "CDN GUID") + field(Id; Id) { ApplicationArea = All; ToolTip = 'Specifies the unique identifier of the participation in the Continia Delivery Network.'; @@ -63,7 +63,7 @@ page 6391 "Participations" part(ActiveProfiles; "Active Profiles") { ApplicationArea = All; - SubPageLink = Network = field(Network), "Identifier Type ID" = field("Identifier Type ID"), "Identifier Value" = field("Identifier Value"); + SubPageLink = Network = field(Network), "Identifier Type Id" = field("Identifier Type Id"), "Identifier Value" = field("Identifier Value"); } } } @@ -131,12 +131,12 @@ page 6391 "Participations" trigger OnAction() var - APIRequests: Codeunit "API Requests"; + ApiRequests: Codeunit "Api Requests"; begin if Rec."Registration Status" = Rec."Registration Status"::Draft then Rec.Delete() else - APIRequests.DeleteParticipation(Rec); + ApiRequests.DeleteParticipation(Rec); end; } diff --git a/Apps/W1/EDocumentsConnector/app/src/Continia/Subscription and Access/CredentialManagement.Codeunit.al b/Apps/W1/EDocumentsConnector/app/src/Continia/Subscription and Access/CredentialManagement.Codeunit.al index 4383f32c4b..3d06334179 100644 --- a/Apps/W1/EDocumentsConnector/app/src/Continia/Subscription and Access/CredentialManagement.Codeunit.al +++ b/Apps/W1/EDocumentsConnector/app/src/Continia/Subscription and Access/CredentialManagement.Codeunit.al @@ -20,7 +20,7 @@ codeunit 6395 "Credential Management" internal procedure GetClientCredentialsApiBodyString(): Text var ConnectionSetup: Record "Connection Setup"; - CredentialsStringPlaceholderTok: Label 'grant_type=password&username=%1&password=%2', Comment = '%1 - Client ID, %2 - Client Secret', Locked = true; + CredentialsStringPlaceholderTok: Label 'grant_type=password&username=%1&password=%2', Comment = '%1 - Client Id, %2 - Client Secret', Locked = true; begin if IsClientCredentialsValid() then begin ConnectionSetup.Get(); @@ -28,7 +28,7 @@ codeunit 6395 "Credential Management" end; end; - internal procedure InsertClientCredentials(ClientID: SecretText; ClientSecret: SecretText; TenantSubscriptionId: Code[50]) + internal procedure InsertClientCredentials(ClientId: SecretText; ClientSecret: SecretText; TenantSubscriptionId: Code[50]) var ConnectionSetup: Record "Connection Setup"; SessionManager: Codeunit "Session Manager"; @@ -36,7 +36,7 @@ codeunit 6395 "Credential Management" if not ConnectionSetup.Get() then ConnectionSetup.Insert(); - ConnectionSetup.SetClientId(ClientID); + ConnectionSetup.SetClientId(ClientId); ConnectionSetup.SetClientSecret(ClientSecret); ConnectionSetup."Local Client Identifier" := TenantSubscriptionId; ConnectionSetup.Modify(); diff --git a/Apps/W1/EDocumentsConnector/app/src/Continia/Subscription and Access/SubscriptionMgt.Codeunit.al b/Apps/W1/EDocumentsConnector/app/src/Continia/Subscription and Access/SubscriptionMgt.Codeunit.al index e5e4b12ab8..1f3531303a 100644 --- a/Apps/W1/EDocumentsConnector/app/src/Continia/Subscription and Access/SubscriptionMgt.Codeunit.al +++ b/Apps/W1/EDocumentsConnector/app/src/Continia/Subscription and Access/SubscriptionMgt.Codeunit.al @@ -9,15 +9,13 @@ using System.Azure.Identity; using Microsoft.Foundation.Company; using System.Security.AccessControl; using Microsoft.CRM.Team; -using System.IO; -using System.Xml; using System.Email; using System.Security.User; codeunit 6397 "Subscription Mgt." { var - APIURLMgt: Codeunit "API URL Mgt."; + ApiUrlMgt: Codeunit "Api Url Mgt."; ClientCredentialsMissingErr: Label 'Client credentials missing.'; CreateClientErrTitleErr: Label 'Failed to create client credentials'; ExpectedStatusOKErr: Label 'Could not connect to Continia Online.\Invalid response, expected Status = OK'; @@ -34,7 +32,7 @@ codeunit 6397 "Subscription Mgt." end; [NonDebuggable] - internal procedure InitializeContiniaClient(PartnerUserName: Text; PartnerPassword: SecretText; var PartnerID: Code[20]) Updated: Boolean + internal procedure InitializeContiniaClient(PartnerUserName: Text; PartnerPassword: SecretText; var PartnerId: Code[20]) Updated: Boolean var HttpClient: HttpClient; HttpContent: HttpContent; @@ -52,7 +50,7 @@ codeunit 6397 "Subscription Mgt." HttpRequestMessage.GetHeaders(HttpHeaders); HttpHeaders.Add('Accept', 'application/xml;charset=utf-8'); HttpRequestMessage.Method('POST'); - HttpRequestMessage.SetRequestUri(APIURLMgt.PartnerAccessTokenUrl()); + HttpRequestMessage.SetRequestUri(ApiUrlMgt.PartnerAccessTokenUrl()); HttpContent.WriteFrom(GetPartnerZoneConnectRequestBody(PartnerUserName, PartnerPassword)); HttpContent.GetHeaders(HttpHeaders); if HttpHeaders.Contains('Content-Type') then @@ -69,11 +67,11 @@ codeunit 6397 "Subscription Mgt." PartnerAccessToken := HandlePartnerZoneAccessTokenResponse(ResponseXmlDoc); if InitializeContiniaClient(PartnerAccessToken) then - exit(CheckPartnerAndGetPartnerID(PartnerUserName, PartnerPassword, PartnerID)); + exit(CheckPartnerAndGetPartnerId(PartnerUserName, PartnerPassword, PartnerId)); end; [NonDebuggable] - internal procedure CheckPartnerAndGetPartnerID(PartnerUserName: Text; PartnerPassword: SecretText; var PartnerID: Code[20]): Boolean + internal procedure CheckPartnerAndGetPartnerId(PartnerUserName: Text; PartnerPassword: SecretText; var PartnerId: Code[20]): Boolean var SessionManager: Codeunit "Session Manager"; HttpClient: HttpClient; @@ -83,7 +81,7 @@ codeunit 6397 "Subscription Mgt." HttpResponseMessage: HttpResponseMessage; ResponseBody: Text; ResponseXmlDoc: XmlDocument; - PartnerIDNode: XmlNode; + PartnerIdNode: XmlNode; ErrorNode: XmlNode; begin // Validate input @@ -93,7 +91,7 @@ codeunit 6397 "Subscription Mgt." HttpRequestMessage.GetHeaders(HttpHeaders); HttpHeaders.Add('Accept', 'application/xml;charset=utf-8'); HttpRequestMessage.Method('POST'); - HttpRequestMessage.SetRequestUri(APIURLMgt.PartnerZoneUrl()); + HttpRequestMessage.SetRequestUri(ApiUrlMgt.PartnerZoneUrl()); HttpContent.WriteFrom(GetPartnerZoneConnectRequestBody(PartnerUserName, PartnerPassword)); HttpHeaders.Add('Authorization', SecretStrSubstNo('Bearer %1', SessionManager.GetAccessToken())); @@ -115,8 +113,8 @@ codeunit 6397 "Subscription Mgt." if ErrorNode.AsXmlAttribute().Value <> '' then Error(InvalidPartnerCredErr); - if ResponseXmlDoc.SelectSingleNode('PartnerZoneConnectResponse/@Msid', PartnerIDNode) then begin - PartnerID := CopyStr(PartnerIDNode.AsXmlAttribute().Value, 1, MaxStrLen(PartnerID)); + if ResponseXmlDoc.SelectSingleNode('PartnerZoneConnectResponse/@Msid', PartnerIdNode) then begin + PartnerId := CopyStr(PartnerIdNode.AsXmlAttribute().Value, 1, MaxStrLen(PartnerId)); exit(true); end; end; @@ -150,7 +148,7 @@ codeunit 6397 "Subscription Mgt." if EnvironmentInformation.IsSaaSInfrastructure() then HttpHeaders.Add('x-AzureTenantId', AzureADTenant.GetAadTenantId()); HttpRequestMessage.Method('POST'); - HttpRequestMessage.SetRequestUri(APIURLMgt.ClientEnvironmentInitializeUrl()); + HttpRequestMessage.SetRequestUri(ApiUrlMgt.ClientEnvironmentInitializeUrl()); HttpContent.WriteFrom(GetInitializeCredentialRequestBody()); HttpContent.GetHeaders(HttpHeaders); if HttpHeaders.Contains('Content-Type') then @@ -246,7 +244,7 @@ codeunit 6397 "Subscription Mgt." if SubscriptionResponse.SelectSingleNode(StrSubstNo(SubscriptionDetailsXMLPathLbl, CredentialMgt.GetAppCode()), SubscriptionNode) then begin SubscriptionNode.SelectSingleNode('@PartnerId', TempXMLNode); - ClientInfo."Partner ID" := CopyStr(TempXMLNode.AsXmlAttribute().Value, 1, MaxStrLen(ClientInfo."Partner ID")); + ClientInfo."Partner Id" := CopyStr(TempXMLNode.AsXmlAttribute().Value, 1, MaxStrLen(ClientInfo."Partner Id")); if SubscriptionResponse.SelectSingleNode(StrSubstNo(InvoiceDetailsXMLPathLbl, CredentialMgt.GetAppCode()), SubscriptionNode) then begin @@ -331,7 +329,7 @@ codeunit 6397 "Subscription Mgt." HttpHeaders.Add('x-AzureTenantId', AzureADTenant.GetAadTenantId()); HttpRequestMessage.Method('GET'); - HttpRequestMessage.SetRequestUri(APIURLMgt.GetSubscriptionUrl()); + HttpRequestMessage.SetRequestUri(ApiUrlMgt.GetSubscriptionUrl()); HttpClient.Timeout := 6000; HttpClient.Send(HttpRequestMessage, HttpResponseMessage); @@ -392,7 +390,7 @@ codeunit 6397 "Subscription Mgt." HttpHeaders.Add('x-AzureTenantId', AzureADTenant.GetAadTenantId()); HttpRequestMessage.Method('POST'); - HttpRequestMessage.SetRequestUri(APIURLMgt.UpdateSubscriptionUrl()); + HttpRequestMessage.SetRequestUri(ApiUrlMgt.UpdateSubscriptionUrl()); HttpContent.WriteFrom(GetUpdateSubscriptionBody(SubscriptionState, ClientInfo)); HttpContent.GetHeaders(HttpHeaders); if HttpHeaders.Contains('Content-Type') then @@ -469,7 +467,7 @@ codeunit 6397 "Subscription Mgt." UpdateSubscriptionRequest.SetAttribute('State', Format(MapOnlineSubscriptionState(SubscriptionState))); UpdateSubscriptionRequest.SetAttribute('UserId', UserId); UpdateSubscriptionRequest.SetAttribute('UserEmail', GetUserNotificationEmail()); - UpdateSubscriptionRequest.SetAttribute('PartnerId', ClientInfo."Partner ID"); + UpdateSubscriptionRequest.SetAttribute('PartnerId', ClientInfo."Partner Id"); if ClientInfo."Company Name" <> '' then begin InvoicingDetails := XmlElement.Create('InvoicingDetails'); @@ -521,7 +519,7 @@ codeunit 6397 "Subscription Mgt." HttpHeaders.Add('x-continia-companyguid', CredentialManagement.GetCompanyGuidAsText()); HttpRequestMessage.Method('POST'); - HttpRequestMessage.SetRequestUri(APIURLMgt.GetAcceptCompanyLicenseUrl()); + HttpRequestMessage.SetRequestUri(ApiUrlMgt.GetAcceptCompanyLicenseUrl()); HttpContent.WriteFrom(GetAcceptCompanyLicenseBody(CompanyName)); HttpContent.GetHeaders(HttpHeaders); if HttpHeaders.Contains('Content-Type') then @@ -580,7 +578,7 @@ codeunit 6397 "Subscription Mgt." HttpHeaders.Add('x-AzureTenantId', AzureADTenant.GetAadTenantId()); HttpRequestMessage.Method('POST'); - HttpRequestMessage.SetRequestUri(APIURLMgt.GetUpdateCompanyInfoUrl()); + HttpRequestMessage.SetRequestUri(ApiUrlMgt.GetUpdateCompanyInfoUrl()); HttpContent.WriteFrom(GetClientInfoUpdateRequest(ClientInfo)); HttpContent.GetHeaders(HttpHeaders); if HttpHeaders.Contains('Content-Type') then @@ -722,7 +720,7 @@ codeunit 6397 "Subscription Mgt." HttpHeaders.Add('x-continia-check', 'true'); Credentials := CredentialManagement.GetClientCredentialsApiBodyString(); HttpRequestMessage.Method('POST'); - HttpRequestMessage.SetRequestUri(APIURLMgt.ClientAccessTokenUrl()); + HttpRequestMessage.SetRequestUri(ApiUrlMgt.ClientAccessTokenUrl()); HttpContent.WriteFrom(Credentials); HttpRequestMessage.Content := HttpContent; HttpClient.Send(HttpRequestMessage, HttpResponseMessage); diff --git a/Apps/W1/EDocumentsConnector/app/src/Permissions/EDocConnectorObjects.PermissionSet.al b/Apps/W1/EDocumentsConnector/app/src/Permissions/EDocConnectorObjects.PermissionSet.al index 988b09e634..65afb19615 100644 --- a/Apps/W1/EDocumentsConnector/app/src/Permissions/EDocConnectorObjects.PermissionSet.al +++ b/Apps/W1/EDocumentsConnector/app/src/Permissions/EDocConnectorObjects.PermissionSet.al @@ -23,8 +23,8 @@ permissionset 6363 "EDoc. Connector Objects" page "Ext. Connection Setup" = X, codeunit "Integration Impl." = X, codeunit "EDocument Processing" = X, - codeunit "API URL Mgt." = X, - codeunit "API Requests" = X, + codeunit "Api Url Mgt." = X, + codeunit "Api Requests" = X, codeunit "Onboarding Helper" = X, codeunit "Credential Management" = X, codeunit "Session Manager" = X,