Add Service Participants support for Company Information#6372
Add Service Participants support for Company Information#6372
Conversation
Co-authored-by: Groenbech96 <17690329+Groenbech96@users.noreply.github.com>
|
Could not find a linked ADO work item. Please link one by using the pattern 'AB#' followed by the relevant work item number. You may use the 'Fixes' keyword to automatically resolve the work item when the pull request is merged. E.g. 'Fixes AB#1234' |
|
@copilot Create a overload method that takes the service as argument and provides it on the table. Dont remove the filter after as well. |
Co-authored-by: Groenbech96 <17690329+Groenbech96@users.noreply.github.com>
Done in 0e3a699. Created an overload |
|
@copilot dont use EDocument.GetEDocumentService().Code)). At the call site of check receiving company info, there is a known service. Use that one. |
Co-authored-by: Groenbech96 <17690329+Groenbech96@users.noreply.github.com>
Done in 3bb73af. Updated |
|
|
||
| if EDocService."Validate Receiving Company" then | ||
| EDocImportHelper.ValidateReceivingCompanyInfo(EDocument); | ||
| EDocImportHelper.ValidateReceivingCompanyInfo(EDocument, EDocService.Code); |
| /// <param name="EDocument">The E-Document record.</param> | ||
| procedure ValidateReceivingCompanyInfo(EDocument: Record "E-Document") | ||
| /// <param name="ServiceCode">The E-Document Service code to match against.</param> | ||
| procedure ValidateReceivingCompanyInfo(EDocument: Record "E-Document"; ServiceCode: Code[20]) |
There was a problem hiding this comment.
@copilot This is breaking. Please add an overload. Then call this original and do the new stuff before.
There was a problem hiding this comment.
Done in 9b0657f. Added backward-compatible overload ValidateReceivingCompanyInfo(EDocument, EDocService) that first checks Service Participants, then calls the original ValidateReceivingCompanyInfo(EDocument) method.
…ss record not code Co-authored-by: Groenbech96 <17690329+Groenbech96@users.noreply.github.com>
|
@copilot Make sure you add tests. |
Groenbech96
left a comment
There was a problem hiding this comment.
Build: ./src/Apps/W1/EDocument/App/src/Helpers/EDocumentImportHelper.Codeunit.al#L315
AA0175 Variable 'ServiceParticipant' queries the database in 'MatchCompanyByServiceParticipant' but does not use the queried record. Only find or get record if you need to access the values. Consider using ISEMPTY.
…ence Co-authored-by: Groenbech96 <17690329+Groenbech96@users.noreply.github.com>
Fixed in 2774d26. Changed |
|
@copilot Take a look at the new instructions |
Could you clarify what new instructions you're referring to? I don't see any additional instructions in the comments. |
|
@copilot revert my latest commit. |
Co-authored-by: Groenbech96 <17690329+Groenbech96@users.noreply.github.com>
| Build: ./src/Apps/W1/EDocument/Test/src/Receive/EDocHelperTest.Codeunit.al#L119AL0118 The name '"Service Integration"' does not exist in the current context. -- Build: ./src/Apps/W1/EDocument/Test/src/Receive/EDocHelperTest.Codeunit.al#L76AL0118 The name '"Service Integration"' does not exist in the current context. [Build: ./src/Apps/W1/EDocument/Test/src/Receive/EDocHelperTest.Codeunit.al#L119](https://github.com//pull/6372/files#annotation_44933495907) AL0118 The name '"Service Integration"' does not exist in the current context. [Build: ./src/Apps/W1/EDocument/Test/src/Receive/EDocHelperTest.Codeunit.al#L76](https://github.com//pull/6372/files#annotation_44933495917) AL0118 The name '"Service Integration"' does not exist in the current context. |
Co-authored-by: Groenbech96 <17690329+Groenbech96@users.noreply.github.com>
| BuildUnexpected error when running action. Error Message: There are test failures!, StackTrace: at , C:\ProgramData\BcContainerHelper\6.1.11-preview2101285\BcContainerHelper\AppHandling\Run-AlPipeline.ps1: line 2994 <- at , C:\ProgramData\BcContainerHelper\6.1.11-preview2101285\BcContainerHelper\AppHandling\Run-AlPipeline.ps1: line 1285 <- at Run-AlPipeline, C:\ProgramData\BcContainerHelper\6.1.11-preview2101285\BcContainerHelper\AppHandling\Run-AlPipeline.ps1: line 1270 <- at , D:\a\_actions\microsoft\AL-Go\19a90088a40cf806eaeb0878ee9aa2438b400475\Actions\RunPipeline\RunPipeline.ps1: line 517 <- at , D:\a\_temp\d5d07c09-94a7-43bd-b0b4-bd17bdd890c2.ps1: line 3 <- at , D:\a\_actions\microsoft\AL-Go\19a90088a40cf806eaeb0878ee9aa2438b400475\Actions\Invoke-AlGoAction.ps1: line 21 <- at , D:\a\_temp\d5d07c09-94a7-43bd-b0b4-bd17bdd890c2.ps1: line 2 <- at , : line 1 -- BuildFunction ValidateReceivingCompanyInfoFallsBackToVATWhenNoServiceParticipant Sorry, the current permissions prevented the action. (TableData 6121 E-Document Insert: E-Document Core Tests) BuildFunction ValidateReceivingCompanyInfoWithMatchingServiceParticipant Sorry, the current permissions prevented the action. (TableData 6121 E-Document Insert: E-Document Core Tests) BuildFunction ValidateReceivingCompanyInfoFallsBackToVATWhenNoServiceParticipant Sorry, the current permissions prevented the action. (TableData 6121 E-Document Insert: E-Document Core Tests) BuildFunction ValidateReceivingCompanyInfoWithMatchingServiceParticipant Sorry, the current permissions prevented the action. (TableData 6121 E-Document Insert: E-Document Core Tests) [Build](https://github.com/microsoft/BCApps/actions/runs/21581698742/job/62354431996?pr=6372#annotation:10:6628) Unexpected error when running action. Error Message: There are test failures!, StackTrace: at , C:\ProgramData\BcContainerHelper\6.1.11-preview2101285\BcContainerHelper\AppHandling\Run-AlPipeline.ps1: line 2994 <- at , C:\ProgramData\BcContainerHelper\6.1.11-preview2101285\BcContainerHelper\AppHandling\Run-AlPipeline.ps1: line 1285 <- at Run-AlPipeline, C:\ProgramData\BcContainerHelper\6.1.11-preview2101285\BcContainerHelper\AppHandling\Run-AlPipeline.ps1: line 1270 <- at , D:\a\_actions\microsoft\AL-Go\19a90088a40cf806eaeb0878ee9aa2438b400475\Actions\RunPipeline\RunPipeline.ps1: line 517 <- at , D:\a\_temp\d5d07c09-94a7-43bd-b0b4-bd17bdd890c2.ps1: line 3 <- at , D:\a\_actions\microsoft\AL-Go\19a90088a40cf806eaeb0878ee9aa2438b400475\Actions\Invoke-AlGoAction.ps1: line 21 <- at , D:\a\_temp\d5d07c09-94a7-43bd-b0b4-bd17bdd890c2.ps1: line 2 <- at , : line 1 [Build](https://github.com/microsoft/BCApps/actions/runs/21581698742/job/62354431996?pr=6372#annotation:10:6266) Function ValidateReceivingCompanyInfoFallsBackToVATWhenNoServiceParticipant Sorry, the current permissions prevented the action. (TableData 6121 E-Document Insert: E-Document Core Tests) [Build](https://github.com/microsoft/BCApps/actions/runs/21581698742/job/62354431996?pr=6372#annotation:10:6254) Function ValidateReceivingCompanyInfoWithMatchingServiceParticipant Sorry, the current permissions prevented the action. (TableData 6121 E-Document Insert: E-Document Core Tests) [Build](https://github.com/microsoft/BCApps/actions/runs/21581698742/job/62354431996?pr=6372#annotation:10:6158) Function ValidateReceivingCompanyInfoFallsBackToVATWhenNoServiceParticipant Sorry, the current permissions prevented the action. (TableData 6121 E-Document Insert: E-Document Core Tests) [Build](https://github.com/microsoft/BCApps/actions/runs/21581698742/job/62354431996?pr=6372#annotation:10:6146) Function ValidateReceivingCompanyInfoWithMatchingServiceParticipant Sorry, the current permissions prevented the action. (TableData 6121 E-Document Insert: E-Document Core Tests) |
Co-authored-by: Groenbech96 <17690329+Groenbech96@users.noreply.github.com>
Add Service Participants to Company Information
This PR enables Belgian companies using Peppol to configure Service Participants on Company Information, so that incoming eDocuments using Peppol Scheme 0208 (Enterprise Number) are correctly matched and received.
Changes Made
1. Extend E-Document Source Type Enum
2. Add Page Extension for Company Information
3. Update Matching Logic (Backward Compatible)
ValidateReceivingCompanyInfo(EDocument, EDocService)that checks Service Participants firstValidateReceivingCompanyInfo(EDocument)signature for backward compatibilityMatchCompanyByServiceParticipanttakesEDocServicerecord parameterEDocServicerecord4. Add Tests
ValidateReceivingCompanyInfoWithMatchingServiceParticipanttest: Verifies validation succeeds when a matching Company Service Participant existsValidateReceivingCompanyInfoFallsBackToVATWhenNoServiceParticipanttest: Verifies fallback to VAT/GLN matching when no Service Participant matches5. Fix Build Warnings/Errors
IsEmpty()instead ofFindFirst()when only checking record existenceusing Microsoft.eServices.EDocument.Integration;forService IntegrationenumTestPermissions = Disabled;to allow E-Document table inserts during tests✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.