Skip to content

Correct Shopify event subscriber signatures in extensibility code examples#3574

Merged
jswymer merged 4 commits into
MicrosoftDocs:mainfrom
jeffreybulanadi:fix-shopify-onbefore-sales-header-event-signature
May 19, 2026
Merged

Correct Shopify event subscriber signatures in extensibility code examples#3574
jswymer merged 4 commits into
MicrosoftDocs:mainfrom
jeffreybulanadi:fix-shopify-onbefore-sales-header-event-signature

Conversation

@jeffreybulanadi

@jeffreybulanadi jeffreybulanadi commented May 14, 2026

Copy link
Copy Markdown
Contributor

Three event subscriber signatures in the code examples for devenv-extending-shopify.md did not match the actual integration event signatures in the connector. Developers copying these examples would get compile errors.

Fix 1: OnBeforeCreateSalesHeader missing LastCreatedDocumentId

Doc had:

procedure OnBeforeCreateSalesHeader(ShopifyOrderHeader: Record "Shpfy Order Header"; var SalesHeader: Record "Sales Header"; var Handled: Boolean)

Actual event in ShpfyOrderEvents.Codeunit.al (CU 30162):

procedure OnBeforeCreateSalesHeader(ShopifyOrderHeader: Record "Shpfy Order Header"; var SalesHeader: Record "Sales Header"; var LastCreatedDocumentId: Guid; var Handled: Boolean)

Note: Subscribers that set Handled to true and create the Sales Header themselves must also set LastCreatedDocumentId so cleanup works correctly on failure.

Fix 2: OnBeforeCalculateUnitPrice missing Catalog parameter

Doc had:

procedure BeforeCalculateUnitPrice(...; ShopifyShop: Record "Shpfy Shop"; var UnitCost: Decimal; ...)

Actual event in ShpfyProductEvents.Codeunit.al:

procedure OnBeforeCalculateUnitPrice(...; ShopifyShop: Record "Shpfy Shop"; Catalog: Record "Shpfy Catalog"; var UnitCost: Decimal; ...)

Fix 3: OnAfterCalculateUnitPrice missing Catalog parameter

Doc had:

procedure AfterCalculateUnitPrice(...; ShopifyShop: Record "Shpfy Shop"; var UnitCost: Decimal; ...)

Actual event in ShpfyProductEvents.Codeunit.al:

procedure OnAfterCalculateUnitPrice(...; ShopifyShop: Record "Shpfy Shop"; Catalog: Record "Shpfy Catalog"; var UnitCost: Decimal; ...)

The Catalog parameter was added when B2B catalog-specific pricing was introduced and the events were updated, but the doc examples were not.

Verified against

BCApps: src/Apps/W1/Shopify/App/src/Order handling/Codeunits/ShpfyOrderEvents.Codeunit.al

BCApps: src/Apps/W1/Shopify/App/src/Products/Codeunits/ShpfyProductEvents.Codeunit.al

@jeffreybulanadi jeffreybulanadi changed the title Fix OnBeforeCreateSalesHeader subscriber signature in Shopify extensibility example Fix Shopify event subscriber signatures in extensibility code examples May 14, 2026
@jeffreybulanadi jeffreybulanadi changed the title Fix Shopify event subscriber signatures in extensibility code examples Correct Shopify event subscriber signatures in extensibility code examples May 14, 2026
@learn-build-service-prod

Copy link
Copy Markdown
Contributor

Learn Build status updates of commit 8d7b75a:

⚠️ Validation status: warnings

File Status Preview URL Details
dev-itpro/developer/devenv-extending-shopify.md ⚠️Warning Details

dev-itpro/developer/devenv-extending-shopify.md

  • Line 95, Column 6: [Warning: sensitive-language-wl - See documentation] Term 'whitelisted' is sensitive and should not be used in content or code. Usage: 'Error: Oauth error invalid_request: The redirect_uri is not whitelisted.'

For more details, please refer to the build report.

Note: Your PR may contain errors or warnings or suggestions unrelated to the files you changed. This happens when external dependencies like GitHub alias, Microsoft alias, cross repo links are updated. Please use these instructions to resolve them.

@learn-build-service-prod

Copy link
Copy Markdown
Contributor

Learn Build status updates of commit 98b8ac0:

✅ Validation status: passed

File Status Preview URL Details
dev-itpro/developer/devenv-extending-shopify.md ✅Succeeded

For more details, please refer to the build report.

@jeffreybulanadi jeffreybulanadi force-pushed the fix-shopify-onbefore-sales-header-event-signature branch from 98b8ac0 to 2a58b54 Compare May 15, 2026 00:09
@learn-build-service-prod

Copy link
Copy Markdown
Contributor

Learn Build status updates of commit 2a58b54:

✅ Validation status: passed

File Status Preview URL Details
dev-itpro/developer/devenv-extending-shopify.md ✅Succeeded

For more details, please refer to the build report.

@learn-build-service-prod

Copy link
Copy Markdown
Contributor

Learn Build status updates of commit 3252b9f:

⚠️ Validation status: warnings

File Status Preview URL Details
dev-itpro/developer/devenv-extending-shopify.md ⚠️Warning Details

dev-itpro/developer/devenv-extending-shopify.md

  • Line 95, Column 6: [Warning: sensitive-language-wl - See documentation] Term 'whitelisted' is sensitive and should not be used in content or code. Usage: 'Error: Oauth error invalid_request: The redirect_uri is not whitelisted.'

For more details, please refer to the build report.

Note: Your PR may contain errors or warnings or suggestions unrelated to the files you changed. This happens when external dependencies like GitHub alias, Microsoft alias, cross repo links are updated. Please use these instructions to resolve them.

@jswymer jswymer left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jeffreybulanadi Thanks for the contributions! We appreciate it very much. I had to revert "allowlisted" to "whitelisted" because we need to use the exact text of the message regardless of the check, until it changes in code. Thanks!

@jswymer jswymer merged commit cc769ef into MicrosoftDocs:main May 19, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants