Skip to content

Complete ValueRefExternal customization in Codeunit 10750 'SII XML Creator" – 4 usages of FillOperationDescription still pending" #29290

@rutxy16eyna

Description

@rutxy16eyna

Why do you need this change?

This issue is a continuation of the problem described in the following previous tickets:

#28904
#29100

Unfortunately, the proposed solution in those tickets does not fully address our needs.

ÔÜÖ´©Å What we need
We want to be able to modify the value of ValueRefExternal after the call to FillOperationDescription, in all places where this pattern appears in the standard code.
Currently, the standard assigns the Entry No. of the document to ValueRefExternal. However, we need to be able to override this value (e.g., with the external document number) via a new event subscriber.

­ƒöì Current status in the standard
The function FillOperationDescription is currently called in 6 different places. The change has already been applied in 2 of them, but is still pending in 4 others:

PopulateXMLWithSalesInvoice   Already modified
PopulateXMLWithPurchInvoice   Already modified
CorrectiveInvoiceSalesDifference ÔÇô ÔØî Pending
HandleReplacementPurchCorrectiveInvoice ÔÇô ÔØî Pending
HandleNormalPurchCorrectiveInvoice ÔÇô ÔØî Pending
HandleReplacementSalesCorrectiveInvoice ÔÇô ÔØî Pending

We kindly request that the same logic and event be added to the remaining 4 locations to ensure consistency and extensibility.

Describe the request

 Expected Code Pattern
We propose the following change in the pattern:
Current standard code:

FillOperationDescription(
    XMLNode, GetOperationDescriptionFromDocument(false, VendorLedgerEntry."Document No."),
    VendorLedgerEntry."Posting Date", VendorLedgerEntry.Description);

FillRefExternaNode(XMLNode, ValueRefExternal);
FillSucceededCompanyInfo(XMLNode, SIIDocUploadState);

Proposed code:

FillOperationDescription(
    XMLNode, GetOperationDescriptionFromDocument(true, CustLedgerEntry."Document No."),
    CustLedgerEntry."Posting Date", CustLedgerEntry.Description);

**ValueRefExternal := Format(SIIDocUploadState."Entry No");
OnPopulateXMLWithSalesInvoiceOnBeforeFillRefExternaNode(SIIDocUploadState, ValueRefExternal);**
FillRefExternaNode(XMLNode, ValueRefExternal);
FillSucceededCompanyInfo(XMLNode, SIIDocUploadState);

Also add the suscriber:

[IntegrationEvent(false, false)]
local procedure OnPopulateXMLWithSalesInvoiceOnBeforeFillRefExternaNode(SIIDocUploadState: Record "SII Doc Upload State"; var ValueRefExternal: Text)

This would allow partners to customize the ValueRefExternal value before it is passed to FillRefExternaNode.

Internal work item: AB#610237

Metadata

Metadata

Assignees

No one assigned

    Labels

    FinanceGitHub request for Finance areaevent-requestRequest for adding an eventships-in-future-updateFix ships in a future update

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions