Describe the issue
Codeunit "Shpfy Process Order".CreateHeaderFromShopifyOrder assigns the Shopify PO number to the sales header without truncation:
SalesHeader.Validate("External Document No.", ShopifyOrderHeader."PO Number");
https://github.com/microsoft/BCApps/blob/main/src/Apps/W1/Shopify/App/src/Order%20handling/Codeunits/ShpfyProcessOrder.Codeunit.al (currently line ~133)
Sales Header."External Document No." is Code[35], while the PO number field on Shpfy Order Header holds longer values coming from Shopify (B2B checkout PO numbers routinely exceed 35 characters — customers paste internal reference strings). When that happens, order creation fails at runtime with:
The length of the string is 45, but it must be less than or equal to 35 characters.
The Shopify order then sits in error state and requires manual PO editing + reprocessing. Every retry fails identically, so for affected merchants this is a recurring daily-operations burden.
Expected behavior
The PO number is truncated to the target field length (like other string fields mapped in the same procedure), so order creation succeeds. The full PO number remains available on the order in Shopify. Proposed one-line fix:
SalesHeader.Validate("External Document No.", CopyStr(ShopifyOrderHeader."PO Number", 1, MaxStrLen(SalesHeader."External Document No.")));
Steps to reproduce
- BC SaaS with the Shopify Connector, connected shop with B2B / draft-order flow.
- Create a Shopify order whose PO number is longer than 35 characters (e.g.
TEST-PO-1234567890-ABCDEFGHIJKLMNOPQRSTUVWXYZ).
- Sync the order and run Create Sales Document (or let the order sync job process it).
- Order processing fails with the string-length error; no sales document is created.
Additional context
Observed in production on BC 27 (SaaS) with Shopify Connector 27.x and 28.3; the assignment is unchanged on current main. All surrounding header fields are length-safe — this one assignment is the outlier. We currently work around it with a per-tenant extension subscribing to Shpfy Order Events.OnBeforeProcessSalesDocument and truncating there.
I will provide a fix for this bug (one-line change above) once the issue is approved.
Describe the issue
Codeunit "Shpfy Process Order".CreateHeaderFromShopifyOrderassigns the Shopify PO number to the sales header without truncation:https://github.com/microsoft/BCApps/blob/main/src/Apps/W1/Shopify/App/src/Order%20handling/Codeunits/ShpfyProcessOrder.Codeunit.al (currently line ~133)
Sales Header."External Document No."isCode[35], while the PO number field onShpfy Order Headerholds longer values coming from Shopify (B2B checkout PO numbers routinely exceed 35 characters — customers paste internal reference strings). When that happens, order creation fails at runtime with:The Shopify order then sits in error state and requires manual PO editing + reprocessing. Every retry fails identically, so for affected merchants this is a recurring daily-operations burden.
Expected behavior
The PO number is truncated to the target field length (like other string fields mapped in the same procedure), so order creation succeeds. The full PO number remains available on the order in Shopify. Proposed one-line fix:
Steps to reproduce
TEST-PO-1234567890-ABCDEFGHIJKLMNOPQRSTUVWXYZ).Additional context
Observed in production on BC 27 (SaaS) with Shopify Connector 27.x and 28.3; the assignment is unchanged on current
main. All surrounding header fields are length-safe — this one assignment is the outlier. We currently work around it with a per-tenant extension subscribing toShpfy Order Events.OnBeforeProcessSalesDocumentand truncating there.I will provide a fix for this bug (one-line change above) once the issue is approved.