codeunit 30246 "Shpfy Create Sales Doc. Refund" Add events in CreateSalesLinesFromRefundShippingLines
Why do you need this change?
In the procedure CreateSalesLinesFromRefundShippingLines We need 2 new events (OnBeforeCreateSalesLinesFromRefundShippingLines and OnAfterCreateSalesLinesFromRefundShippingLines) to modify the Sales Line generation like it is done in the CreateSalesLinesFromReturnLines procedure .
Describe the request
local procedure CreateSalesLinesFromRefundShippingLines(RefundHeader: Record "Shpfy Refund Header"; var SalesHeader: Record "Sales Header"; var LineNo: Integer)
var
RefundShippingLine: Record "Shpfy Refund Shipping Line";
SalesLine: Record "Sales Line";
IsHandled: Boolean;
begin
RefundShippingLine.SetRange("Refund Id", RefundHeader."Refund Id");
if RefundShippingLine.FindSet() then
repeat
RefundProcessEvents.OnBeforeCreateSalesLinesFromRefundShippingLines(RefundHeader, SalesHeader, LineNo, IsHandled);
if not IsHandled then begin
LineNo += 10000;
...
SalesLine.Modify();
end;
RefundProcessEvents.OnAfterCreateSalesLinesFromRefundShippingLines(RefundHeader, SalesHeader, LineNo);
until RefundShippingLine.Next() = 0;
end;
Hi @cponcet-pdw,
Thanks for submitting this extensibility request. To help us process it efficiently, please update the issue to include the required information.
Missing Information:
-
Alternatives Evaluated: Which existing events/patterns were tried and why are they insufficient? IsHandled events should only be used when standard events won't work.
-
Justification for IsHandled: Why is the IsHandled bypass functionality necessary? Provide specific technical reasons why a standard event, redesign, or contribution isn't feasible. Generic statements like 'we need to bypass' are not acceptable - explain the concrete business logic that must be skipped/replaced and why alternative approaches won't work.
-
Performance Considerations: What is the expected execution frequency of this event? Provide an assessment of potential performance impact.
-
Data Sensitivity Review: Confirm whether any sensitive data is exposed through this event, or provide rationale if exposure is necessary.
-
Multi-Extension Interaction: What are the risks if multiple extensions subscribe to this IsHandled event? How will conflicts be mitigated if multiple subscribers try to handle the event?
Please update the issue with the missing details. We'll automatically re-analyze once updated.
Justification for IsHandled: Ishandled was requested because in the CreateSalesLinesFromReturnLines function, which has the same structure and a similar purpose, you added it. As far as I'm concerned, I'm not interested in this IsHandled option; I just want to add information about the sales line.
Hello @cponcet-pdw Shopify is part of BCApps repo, an open-source component which works on contribution level. Please check this manual and propose code change by yourself.