ALAppExtensions icon indicating copy to clipboard operation
ALAppExtensions copied to clipboard

codeunit 30246 "Shpfy Create Sales Doc. Refund" Add events in CreateSalesLinesFromRefundShippingLines

Open cponcet-pdw opened this issue 9 months ago • 3 comments

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;

cponcet-pdw avatar Feb 04 '26 15:02 cponcet-pdw

Hi @cponcet-pdw,

Thanks for submitting this extensibility request. To help us process it efficiently, please update the issue to include the required information.

📚 Extensibility Guidelines

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.

AleksandricMarko avatar Feb 04 '26 21:02 AleksandricMarko

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.

cponcet-pdw avatar Feb 05 '26 08:02 cponcet-pdw

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.

AleksandricMarko avatar Feb 09 '26 14:02 AleksandricMarko