---
id: change/bcapps/9404
type: change
title: "#9404 [Shopify] Fix Sync Prices using stale WorkDate from SingleInstance cache"
summary: Fixed the Shopify product price calculator to rebuild its cached temporary sales header when the Work Date changes, preventing price sync from applying outdated discounts after changing the work date mid-session.
tier: official
language: en
tags:
  - fix
  - main
  - bc30
  - codeunit shpfy product price calc.
system: integration
review:
  state: reviewed
  by: opus
  at: "2026-10-08T02:12:17.212Z"
  flags: []
generated:
  at: "2026-10-08T01:26:53.141Z"
  pipeline: 0.2.0
  prompts:
    extract-change: 1
  input_hash: e286ff6ccca89ef01747a735e56130c38c22e7b4
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/pull/9404
    title: "microsoft/BCApps#9404: [Shopify] Fix Sync Prices using stale WorkDate from SingleInstance cache"
    date: "2026-07-15"
    commit: e286ff6ccca89ef01747a735e56130c38c22e7b4
    t: null
    quote: running Sync Prices after changing the Work Date could apply the discount valid for the previous Work Date
links:
  learn: []
  objects:
    - object/codeunit/30182
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
  changes: []
number: 9404
repo: microsoft/BCApps
source_id: bcapps-prs
url: https://github.com/microsoft/BCApps/pull/9404
kind: pr
base_branch: main
major: "30"
merged_at: "2026-07-15T19:22:59Z"
author: onbuyuka
author_type: User
community_contribution: false
labels:
  - "AL: Apps (W1)"
change_class: code
change_kind: fix
behavior_change: true
breaking: false
files:
  count: 3
  additions: 97
  deletions: 1
  al: 1
apps:
  - Shopify
objects_touched:
  - key: codeunit/30182
    page: codeunit/30182
    type: codeunit
    id: 30182
    name: Shpfy Product Price Calc.
    app: Shopify
    status: modified
objects_unjoined: []
obsoletions: []
backports: []
fixes_issues: []
work_items:
  - 642194
systems:
  - integration
quote: running Sync Prices after changing the Work Date could apply the discount valid for the previous Work Date
joined_against:
  major: "30"
  commit: ecbc028c25dbe83b61313bc566e6c1d41184bb1c
---

# #9404 [Shopify] Fix Sync Prices using stale WorkDate from SingleInstance cache

> Fixed the Shopify product price calculator to rebuild its cached temporary sales header when the Work Date changes, preventing price sync from applying outdated discounts after changing the work date mid-session.

[Pull request](https://github.com/microsoft/BCApps/pull/9404) · merged into `main` (BC30) on 2026-07-15 by onbuyuka · 3 files (+97 -1), 1 AL · fix · tier official · reviewed (checked by Opus)

## What changed

- Added WorkDate() check to SetShop() guard condition to detect work date changes
- Cached temporary sales header is now rebuilt when work date changes, not just when shop code or SystemModifiedAt changes
- Added regression test that verifies correct discount application after work date change without shop record modification
- SetShopAndCatalog() method already recreates header unconditionally, so it required no changes
- Behaviour changes for users or extensions.

## AL objects touched

- [Codeunit 30182 "Shpfy Product Price Calc."](../../objects/codeunit/30182.md), Shopify: modified

## Context

- Work items: AB#642194
- Labels: AL: Apps (W1)
- Systems: integration
- From the description: "running Sync Prices after changing the Work Date could apply the discount valid for the previous Work Date"

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).
