[Shopify] Do not create multiple links for the same invoice#6019
Merged
[Shopify] Do not create multiple links for the same invoice#6019
Conversation
darjoo
approved these changes
Jan 6, 2026
AndreiPanko
approved these changes
Jan 6, 2026
onbuyuka
added a commit
that referenced
this pull request
Jan 15, 2026
onbuyuka
added a commit
that referenced
this pull request
Jan 15, 2026
onbuyuka
added a commit
that referenced
this pull request
Jan 15, 2026
onbuyuka
added a commit
that referenced
this pull request
Jan 15, 2026
onbuyuka
added a commit
that referenced
this pull request
Jan 15, 2026
onbuyuka
added a commit
that referenced
this pull request
Jan 16, 2026
…nvoice (#6160) This pull request backports #6019 to releases/27.0 Fixes [AB#617452](https://dynamicssmb2.visualstudio.com/1fcb79e7-ab07-432a-a3c6-6cf5a88ba4a5/_workitems/edit/617452)
onbuyuka
added a commit
that referenced
this pull request
Jan 16, 2026
…nvoice (#6161) This pull request backports #6019 to releases/27.1 Fixes [AB#617453](https://dynamicssmb2.visualstudio.com/1fcb79e7-ab07-432a-a3c6-6cf5a88ba4a5/_workitems/edit/617453)
onbuyuka
added a commit
that referenced
this pull request
Jan 16, 2026
…nvoice (#6162) This pull request backports #6019 to releases/27.2 Fixes [AB#617454](https://dynamicssmb2.visualstudio.com/1fcb79e7-ab07-432a-a3c6-6cf5a88ba4a5/_workitems/edit/617454)
onbuyuka
added a commit
that referenced
this pull request
Jan 16, 2026
…nvoice (#6164) This pull request backports #6019 to releases/27.3 Fixes [AB#618371](https://dynamicssmb2.visualstudio.com/1fcb79e7-ab07-432a-a3c6-6cf5a88ba4a5/_workitems/edit/618371)
onbuyuka
added a commit
that referenced
this pull request
Jan 16, 2026
…nvoice (#6163) This pull request backports #6019 to releases/27.x Fixes [AB#617455](https://dynamicssmb2.visualstudio.com/1fcb79e7-ab07-432a-a3c6-6cf5a88ba4a5/_workitems/edit/617455)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix: Duplicate document link error when posting consolidated invoice for multi-location Shopify orders
Problem
When posting a sales invoice that consolidates shipments from the same Shopify order, the system throws the error:
This occurs when:
The issue is that the code iterates through all shipment lines being invoiced and attempts to insert a document link for each shipment. When multiple shipments belong to the same Shopify order, it tries to create duplicate links to the same posted sales invoice.
Solution
Before creating a new document link from a Shopify order to the posted sales invoice, the code now checks if a link already exists for that specific combination of:
Only if no existing link is found will a new one be created, preventing the duplicate record error.
Work Item(s)
Fixes AB#617360