Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Shopify: BC Doc No. attribute sent to Shopify even in cases of errors #26516

Open
1 task done
JeppeBylov opened this issue May 22, 2024 · 1 comment
Open
1 task done
Labels
approved The issue is approved Integration GitHub request for Integration area

Comments

@JeppeBylov
Copy link
Contributor

JeppeBylov commented May 22, 2024

Describe the issue

When a Shopify Order is imported and an error occurs after the CreateHeaderFromShopifyOrder finishes, then the order is order is reimported shortly thereafter, which currently clears the error message, making any consistent follow-up impossible. I don't know if the fact that the error message is cleared only happens in these cases or if there's a second issue where this also happens on new orders imported.

The cause is that in function CreateHeaderFromShopifyOrder there's an API call to shopify to add the BC Doc No. attribute.
This update triggers a webhook notification to BC, which reimports the same order.

Expected behavior

Update of attributes in Shopify shouldn't happen until the full document has been created and any errors have been accounted for.

I would move the following lines to a separate function

https://github.com/microsoft/ALAppExtensions/blob/18455700ada751a86886a8cefdb071bd4a76ce71/Apps/W1/Shopify/app/src/Order%20handling/Codeunits/ShpfyProcessOrder.Codeunit.al#L139C1-L143C7

This function should be called just before the Auto Release check.

Steps to reproduce

Prepare a case where a sales line will return an error on creation.

  1. Create order in Shopify
  2. Import orders to BC
  3. Order is now marked with error message
  4. Open order in Shopify admin
  5. Confirm that order now has a BC Doc No.
  6. Wait approx. 5 minutes
  7. Shopify Order has now been updated in BC.

Additional context

No response

I will provide a fix for a bug

  • I will provide a fix for a bug
@JeppeBylov JeppeBylov added the bug Something isn't working label May 22, 2024
@nikolakukrika nikolakukrika added the Integration GitHub request for Integration area label May 22, 2024
@JesperSchulz JesperSchulz added the approved The issue is approved label May 28, 2024
@JesperSchulz
Copy link
Contributor

Consulted @onbuyuka. Issue approved.

@aholstrup1 aholstrup1 removed the bug Something isn't working label Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved The issue is approved Integration GitHub request for Integration area
Projects
None yet
Development

No branches or pull requests

4 participants