Correct Shopify event subscriber signatures in extensibility code examples#3574
Conversation
|
Learn Build status updates of commit 8d7b75a:
|
| File | Status | Preview URL | Details |
|---|---|---|---|
| dev-itpro/developer/devenv-extending-shopify.md | 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 status updates of commit 98b8ac0: ✅ Validation status: passed
For more details, please refer to the build report. |
98b8ac0 to
2a58b54
Compare
|
Learn Build status updates of commit 2a58b54: ✅ Validation status: passed
For more details, please refer to the build report. |
…Catalog parameter in devenv-extending-shopify.md
We need to keep error messages as is
|
Learn Build status updates of commit 3252b9f:
|
| File | Status | Preview URL | Details |
|---|---|---|---|
| dev-itpro/developer/devenv-extending-shopify.md | 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
left a comment
There was a problem hiding this comment.
@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!
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