-
Notifications
You must be signed in to change notification settings - Fork 686
Description
Why do you need this change?
This issue is a continuation of the problem described in the following previous tickets:
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