Skip to content

Fix #7724: Resolve Option 1 Name from existing Shopify Variant records#8048

Open
tVisionDeb wants to merge 1 commit into
microsoft:mainfrom
tVisionDeb:fix/7724-shopify-variant-option-name
Open

Fix #7724: Resolve Option 1 Name from existing Shopify Variant records#8048
tVisionDeb wants to merge 1 commit into
microsoft:mainfrom
tVisionDeb:fix/7724-shopify-variant-option-name

Conversation

@tVisionDeb
Copy link
Copy Markdown
Contributor

@tVisionDeb tVisionDeb commented May 7, 2026

Summary

Fixes #7724: Variant option names should be resolved from existing Shopify Variant records instead of using hardcoded values.

Changes

  • Modified ShpfyProductExport.Codeunit.al to call ResolveOption1Name() procedure when syncing product variant option names
    • Added new local procedure ResolveOption1Name() that queries existing variants for the correct option name
    • Ensures consistency with Shopify's actual variant configuration

Validation

  • Compiled successfully on BC-28 (Runtime 17.0): 0 errors
  • Compiled successfully on BC-29 (Runtime 18.0): 0 errors
  • Test app compiled successfully on both runtimes: 0 errors

Test Execution Results

Full test suite executed on BC-28 (container BC-20260506, version 28.0.46665.48932):

  • 190 test methods passed, 20 failed across 26 codeunits (24 passed, 2 failed)
  • All product/variant-related tests passed (Codeunit 139601 Shpfy Create Product Test - all methods pass)

Failing tests (pre-existing, unrelated to this change):

  1. Codeunit 139606 - Shpfy Shipping Test (1 failure):

    • UnitTestExportFulfillmentServiceShipment - Fails with API version check error ("The Shopify Admin API used by your current Shopify connector is no longer supported"). This is a platform-level version mismatch in the test environment.
  2. Codeunit 139608 - Shpfy Orders API Test (19 failures):

    • All fail with: "The field Customer Disc. Group of table Sales Line contains a value (GCMURLJYCQ) that cannot be found in the related table (Customer Discount Group)"
    • This is a pre-existing test data setup issue where randomized customer data references a non-existent Customer Discount Group record. Unrelated to product export logic.

Relevant passing tests (product export with variants):

  • UnitTestCreateTempProductFromItemWithVariants
  • UnitTestCreateTempProductFromItemWithVariantsAndExtendedText
  • UnitTestCreateTempProductFromItemWithVariantsAndItemAttributes
  • UnitTestCreateTempProductFromItemWithVariantsAndSKUIsVariantCode
  • (and 40+ additional product/variant test methods)

…nt records

- Modified FillInProductVariantData to call new ResolveOption1Name procedure
- ResolveOption1Name queries existing variants for consistent Option 1 Name
- Falls back to 'Variant' if no existing variants or names are inconsistent
@tVisionDeb tVisionDeb requested a review from a team as a code owner May 7, 2026 15:51
@github-actions github-actions Bot added AL: Apps (W1) Add-on apps for W1 From Fork Pull request is coming from a fork labels May 7, 2026
@JesperSchulz JesperSchulz added the Integration GitHub request for Integration area label May 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AL: Apps (W1) Add-on apps for W1 From Fork Pull request is coming from a fork Integration GitHub request for Integration area

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Shopify variant create uses wrong option name after initial import from Shopify

3 participants