---
id: change/bcapps/10307
type: change
title: "#10307 [Shopify] Fix Order Totals factbox opening an unrelated sales order for a linked posted invoice"
summary: The Shopify Order Totals factbox now correctly resolves and displays totals for open sales orders, open sales invoices, and posted sales invoices by using the document link table, and navigates to the correct document type instead of always opening a sales order.
tier: official
language: en
tags:
  - fix
  - main
  - bc30
  - page shpfy order totals factbox
system: integration
review:
  state: reviewed
  by: opus
  at: "2026-10-08T02:08:14.095Z"
  flags: []
generated:
  at: "2026-10-08T01:26:53.141Z"
  pipeline: 0.2.0
  prompts:
    extract-change: 1
  input_hash: 1c10bca2bc4236d88a1258ce308c5c170a804865
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/pull/10307
    title: "microsoft/BCApps#10307: [Shopify] Fix Order Totals factbox opening an unrelated sales order for a linked posted invoice"
    date: "2026-08-19"
    commit: 1c10bca2bc4236d88a1258ce308c5c170a804865
    t: null
    quote: Resolution prefers Posted Sales Invoice → open Sales Invoice → open Sales Order, with a fallback to the header fields for legacy orders.
links:
  learn: []
  objects:
    - object/page/30172
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
  changes: []
number: 10307
repo: microsoft/BCApps
source_id: bcapps-prs
url: https://github.com/microsoft/BCApps/pull/10307
kind: pr
base_branch: main
major: "30"
merged_at: "2026-08-19T10:53:53Z"
author: onbuyuka
author_type: User
community_contribution: false
labels:
  - "AL: Apps (W1)"
  - "Team: Integrations"
change_class: code
change_kind: fix
behavior_change: true
breaking: false
files:
  count: 2
  additions: 627
  deletions: 28
  al: 1
apps:
  - Shopify
objects_touched:
  - key: page/30172
    page: page/30172
    type: page
    id: 30172
    name: Shpfy Order Totals FactBox
    app: Shopify
    status: modified
objects_unjoined: []
obsoletions: []
backports: []
fixes_issues: []
work_items:
  - 647019
systems:
  - integration
quote: Resolution prefers Posted Sales Invoice → open Sales Invoice → open Sales Order, with a fallback to the header fields for legacy orders.
joined_against:
  major: "30"
  commit: ecbc028c25dbe83b61313bc566e6c1d41184bb1c
---

# #10307 [Shopify] Fix Order Totals factbox opening an unrelated sales order for a linked posted invoice

> The Shopify Order Totals factbox now correctly resolves and displays totals for open sales orders, open sales invoices, and posted sales invoices by using the document link table, and navigates to the correct document type instead of always opening a sales order.

[Pull request](https://github.com/microsoft/BCApps/pull/10307) · merged into `main` (BC30) on 2026-08-19 by onbuyuka · 2 files (+627 -28), 1 AL · fix · tier official · reviewed (checked by Opus)

## What changed

- Factbox resolves the linked sales document through the Shpfy Doc. Link To Doc. table with fallback to header fields for legacy orders
- Totals are computed per document type using appropriate calculation methods for open or posted documents
- Sales Document No. drill-down dispatches to the correct document type via the Shpfy IOpenBCDocument interface
- Number of Lines drill-down opens the appropriate page based on document type (Sales Lines or Posted Sales Invoice Lines)
- Stale values are cleared when the linked document can no longer be resolved
- Behaviour changes for users or extensions.

## AL objects touched

- [Page 30172 "Shpfy Order Totals FactBox"](../../objects/page/30172.md), Shopify: modified

## Context

- Work items: AB#647019
- Labels: AL: Apps (W1), Team: Integrations
- Systems: integration
- From the description: "Resolution prefers Posted Sales Invoice → open Sales Invoice → open Sales Order, with a fallback to the header fields for legacy orders."

Source: metadata of a merged pull request in microsoft/BCApps (bcapps): title, labels, changed paths and counts, with a summary in our words. No source text and no description beyond one short quote (D10, D61).
