web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested Answer

Shopify connector error when importing return order

(5) ShareShare
ReportReport
Posted on by 14

 

We are experiencing an issue when integrating return orders.

For instance, let's say we have an order containing item A with a quantity of 2. The company managing our logistics sends a return via API by splitting the line into two separate lines with a quantity of 1 each, in order to assign a return reason to each quantity.

This process works correctly; however, when the connector imports the return order, an error occurs because both split lines contain the same Order Line ID, causing a failure in the following function:

ReturnLocations.Add(OrderLIneID,LocationId) cant work because he has 2 lines with same orderlineiD...

its on the codeunit :  codeunit 30250 "Shpfy Returns API"

Since their is no event on the shopify connectors can someone give me some hint to find a solution ?

Thanks for your help !

 
I have the same question (0)
  • Suggested answer
    YUN ZHU Profile Picture
    100,212 Super User 2026 Season 1 on at
    This looks like a standard issue. You can try submitting it to the following two places.
    BC Yammer Group -> Shopify
    AL Issues
     
    Thanks.
    ZHU
  • Nitin Verma Profile Picture
    21,812 Moderator on at
    Hi,
    You can try the below event to indentify and repocess it again.
    codeunit 50101 "Custom Shopify Returns Handler"
    {
        [EventSubscriber(ObjectType::Codeunit, Codeunit::"Shpfy Returns API", 'OnAfterImportReturn', '', true, true)]
        local procedure OnAfterImportReturn(ErrorOccurred: Boolean; ReturnOrderNo: Code[20])
        var
            CustomReturnLog: Record "Custom Return Log";
        begin
            if ErrorOccurred then begin
                CustomReturnLog.Init();
                CustomReturnLog."Return Order No." := ReturnOrderNo;
                CustomReturnLog."Error Description" := GetLastErrorText();
                CustomReturnLog.Insert();
    
                // Optionally, trigger a job to reprocess with corrected data
                ReprocessReturnOrder(ReturnOrderNo);
            end;
        end;
    
        local procedure ReprocessReturnOrder(ReturnOrderNo: Code[20])
        var
            // Logic to retrieve, modify, and re-import the return order data
        begin
            // Implement logic to fetch the original JSON, modify OrderLineIds, and re-import
        end;
    }
     
  • Suggested answer
    Khushbu Rajvi. Profile Picture
    22,342 Super User 2026 Season 1 on at
  • Vahid Ghafarpour Profile Picture
    12,258 on at
    If any of the responses helped resolve your issue, please take a moment to mark the best answer. This helps others in the community quickly find solutions to similar problems.

    To do this, simply click the "Does this answer your question?" button on the most helpful response and like the helpful posts. If your issue is still unresolved, feel free to provide more details so the community can assist further!

    Thanks for being an active part of the Dynamics 365 Community! 😊

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,012 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 986 Super User 2026 Season 1

#3
Teagen Boll Profile Picture

Teagen Boll 659 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans