Skip to content

[Shopify] Expose Product facade procedures for Add to Shopify parity#8713

Open
Franco111000 wants to merge 1 commit into
microsoft:mainfrom
Franco111000:fix/7867-shopify-product-facade-procedures
Open

[Shopify] Expose Product facade procedures for Add to Shopify parity#8713
Franco111000 wants to merge 1 commit into
microsoft:mainfrom
Franco111000:fix/7867-shopify-product-facade-procedures

Conversation

@Franco111000

@Franco111000 Franco111000 commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

What & why

The native Add to Shopify action on the Item Card publishes an item through a specific sequence: it confirms the action and resolves the target shop, checks that the item's attributes are compatible with Shopify product options, adds the item, and resolves the product URL. A partner extending the connector cannot reproduce that flow today, because the relevant procedures live on internal codeunits (Shpfy Sync Products, Shpfy Product Export).

This change exposes the missing steps on the existing public Shpfy Product facade (codeunit 30234):

  • ConfirmAddItemToShopify(Item; var ShopifyShop) confirms the add and resolves the shop, including the multi-shop selection prompt.
  • CheckItemAttributesCompatibleForProductOptions(Item; ShopifyShop) is the attribute-compatibility check added in v28.
  • GetProductUrl(Item; ShopCode) is the item and shop overload of the existing GetProductUrl.

The facade delegates to the existing internal implementations, which stay internal. CheckItemAttributesCompatibleForProductOptions takes the shop on the facade and primes the implementation with SetShop before delegating, exactly as the native Item Card flow does.

Linked work

Fixes #7867

How I validated this

  • I read the full diff and it contains only changes I intended.
  • I built the affected app(s) locally with no new analyzer warnings.
  • I ran the change in Business Central and confirmed it behaves as expected.
  • I added or updated tests for the new behavior, or explained below why none are needed.

What I tested and the outcome

  • The three procedures are thin delegations to existing internal implementations and carry no new logic of their own.
  • Added UnitTestCheckItemAttributesCompatibleForProductOptionsFromFacade (codeunit 139596): calls the facade for an item with more than three "As Option" attributes and confirms it returns false and logs the skipped record, exercising the facade's SetShop and delegate sequence end to end.
  • Added UnitTestGetProductUrlForItemFromFacade (codeunit 139604): links a Shopify product holding a URL to an item and confirms the facade returns that URL for the item and shop.
  • ConfirmAddItemToShopify is a pure passthrough that shows the existing confirmation dialog, so it is covered by the native action's behavior rather than a new interactive test.
  • I rely on CI for the build and full test run; the local .alpackages is empty in this fork, following the AL-Go for PTE pattern this repo uses.

Risk & compatibility

  • Additive only: three new public procedures on an already-public facade. No existing signatures change, no breaking changes, no data or upgrade impact, and no new permissions, telemetry, or feature flags.
  • The implementation codeunits remain internal.
  • Scope note on the page change: issue [BC Idea]: Add requested procedures in facade codeunit to match BC behavior. #7867 also proposed making the Shpfy Add Item Confirm page (30144) setters public. Those setters are internal helpers that the native flow drives only through Shpfy Sync Products.ConfirmAddItemToShopify. Exposing that procedure on the facade gives partners the same entry point the native action uses, including shop selection, while keeping the page's surface internal, so this PR takes that route instead of widening the page. Glad to switch to public page setters if you would prefer to match the issue literally.
  • Possible follow-up (out of scope): the native flow also calls CheckItemCanBeExported between confirming and the attribute check. If end-to-end parity is wanted, that procedure could be exposed on the facade as well. Happy to add it if the team prefers.

Add three public procedures to the "Shpfy Product" facade so partners can
replicate the native Add to Shopify flow:
- ConfirmAddItemToShopify
- CheckItemAttributesCompatibleForProductOptions
- GetProductUrl for an item and shop

The implementation codeunits stay internal; the facade delegates to them and
primes the shop where required. Adds facade tests for the attribute check and
the product URL lookup.
@Franco111000 Franco111000 requested a review from a team June 22, 2026 10:56
@github-actions github-actions Bot added AL: Apps (W1) Add-on apps for W1 From Fork Pull request is coming from a fork needs-approval Workflow runs require maintainer approval to start labels Jun 22, 2026
@JesperSchulz JesperSchulz added the Integration GitHub request for Integration area label Jun 22, 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 needs-approval Workflow runs require maintainer approval to start

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BC Idea]: Add requested procedures in facade codeunit to match BC behavior.

2 participants