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 Tax Addition Logic

(6) ShareShare
ReportReport
Posted on by 28
Hi All,
 
I have added code so that for every Shopify order brought in and converted to a sales order, it creates it as a line item on the sales order, and it works great. The only issue is that it is tied to the 'onaftercreateshippingcostsalesline' event subscriber function, and not every order that we get from Shopify, due to us having free shipping sales routinely. My question is if there is a better event subscriber to use that will import the line for every order? When sales orders are created from Shopify orders, there is a comment made. Is there an event subscriber that would connect to it? Is there a place where I can see all event subscribers? 
 
[EventSubscriber(ObjectType::Codeunit, Codeunit::"Shpfy Order Events",
                     'OnAfterCreateShippingCostSalesLine', '', false, false)]
    local procedure AddTaxLineToSalesOrder(ShopifyOrderHeader: Record "Shpfy Order Header";
                                           SalesHeader: Record "Sales Header")
I have the same question (0)
  • André Arnaud de Calavon Profile Picture
    304,126 Super User 2026 Season 1 on at
    Moved the question from the Dynamics 365 General to the Dynamics 365 Business Central forum.
  • Suggested answer
    YUN ZHU Profile Picture
    99,559 Super User 2026 Season 1 on at
  • Suggested answer
    OussamaSabbouh Profile Picture
    13,763 Super User 2026 Season 1 on at
    Hello,
     
    OnAfterCreateShippingCostSalesLine only fires when a shipping cost line is actually created, so it will never run for free-shipping Shopify orders—that’s expected behavior. To add a line for every Shopify order, you need to subscribe to an order-level / sales-header-level event, not a shipping-specific one. In the Shopify app, look for events in Codeunit “Shpfy Order Events” or related codeunits that fire after the Sales Header is created (e.g. an OnAfterCreateSalesHeader / OnAfterConvertOrderToSalesDocument–type event); those run once per order regardless of shipping. There’s no UI to list all events, so the practical way is to browse the Shopify app source code (search for [IntegrationEvent] in the Shopify codeunits). Hooking into a header-level event is the correct and standard approach here.
     
    Regards,
    Oussama Sabbouh

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 March 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,028 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,121 Super User 2026 Season 1

#3
Teagen Boll Profile Picture

Teagen Boll 669 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans