Skip to content

[Shopify] Add cues for Skipped Records and API Errors on Activities page - #10092

Open
Onat Buyukakkus (onbuyuka) wants to merge 1 commit into
mainfrom
bugs/646260-shopify-activities-cues
Open

[Shopify] Add cues for Skipped Records and API Errors on Activities page#10092
Onat Buyukakkus (onbuyuka) wants to merge 1 commit into
mainfrom
bugs/646260-shopify-activities-cues

Conversation

@onbuyuka

@onbuyuka Onat Buyukakkus (onbuyuka) commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

What & why

Skipped records from background (Job Queue) Shopify syncs and logged API errors were invisible unless users manually opened the logs — the skipped-record notification relies on GuiAllowed, which is false in background sessions, and the Job Queue entry still shows Success. This adds two cues to the Shopify Activities page so users see issues at a glance:

  • Skipped Recordscount("Shpfy Skipped Record"), styled amber when > 0, drills down to the Shpfy Skipped Records page.
  • API Errorscount("Shpfy Log Entry" where "Has Error" = true), styled red when > 0, drills down to the Shpfy Log Entries page filtered to errors.

New FlowFields (10, 11) on the Shpfy Cue table (30100) and two cue tiles on the Shpfy Activities page (30100). Both cues are unfiltered by date; the Retention Policy framework (1-month period on SystemCreatedAt, already registered for both tables) handles cleanup. Follows the existing cue pattern (Unmapped Customers, Unprocessed Orders, Synchronization Errors).

Linked work

Fixes AB#646260

How I validated this

  • I read the full diff and it contains only changes I intended.
  • I built the affected app(s) locally with no new analyzer warnings.
  • I ran the change in Business Central and confirmed it behaves as expected.
  • I added or updated tests for the new behavior, or explained below why none are needed.

What I tested and the outcome

  • Built the Shopify Connector app locally (al_build) — packages with no new warnings.
  • Manually validated on the Shopify Activities page: both cues render, color amber/red when counts are > 0, and drill down to the Skipped Records page and the error-filtered Log Entries page respectively.
  • No automated tests added — the change is declarative cue metadata (FlowField CalcFormula plus page tiles and drill-downs) with no custom AL logic to unit-test; validated manually in BC.

Risk & compatibility

Low — additive only: two new FlowFields on an internal cue table plus two cue tiles. No table schema/data changes, no breaking changes. Read permissions already cover the underlying tables (Shpfy Skipped Record and Shpfy Log Entry are R in Shpfy - Read).

@onbuyuka
Onat Buyukakkus (onbuyuka) requested a review from a team August 10, 2026 13:35
@github-actions github-actions Bot added the AL: Apps (W1) Add-on apps for W1 label Aug 10, 2026
@github-actions github-actions Bot added the Integration GitHub request for Integration area label Aug 10, 2026
@github-actions github-actions Bot added this to the Version 29.0 milestone Aug 10, 2026
Skipped records from background (Job Queue) syncs and logged API errors
were invisible unless users manually opened the logs. Add two cues to the
Shpfy Cue table (30100) and Shpfy Activities page (30100):

- Skipped Records: count of Shpfy Skipped Record, styled amber when > 0,
  drills down to the Shpfy Skipped Records page.
- API Errors: count of Shpfy Log Entry with Has Error = true, styled red
  when > 0, drills down to the Shpfy Log Entries page filtered to errors.

Both cues are unfiltered by date; the Retention Policy framework (1-month
period on SystemCreatedAt) handles cleanup.

Fixes AB#646260

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 26d86952-9110-4708-a976-98be9eb2bfe7
@onbuyuka
Onat Buyukakkus (onbuyuka) force-pushed the bugs/646260-shopify-activities-cues branch from c794f35 to c951d80 Compare August 10, 2026 13:38
Caption = 'Skipped Records';
FieldClass = FlowField;
}
field(11; "API Errors"; Integer)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$\textbf{🟡\ Medium\ Severity\ —\ Performance}$

The new "API Errors" FlowField counts "Shpfy Log Entry" rows filtered by "Has Error" = true, but the source table (Shpfy Log Entry, table 30115) only declares Key1 on "Entry No." with no key covering "Has Error" in SumIndexFields. Per CodeCop AA0232 / this article, a FlowField's source table needs a key that covers the CalcFormula's WHERE clause fields for the platform to answer CalcFields from SIFT; without it, every CalcFields call (triggered on each page activation via RefreshOnActivate = true and explicitly in the new OnAfterGetRecord trigger) falls back to a row-by-row scan of the log table, which grows unbounded over time.

Knowledge:

👍 useful · ❤️ especially valuable · 👎 wrong - reply with why · AL review agent v1.31.4

trigger OnAfterGetRecord()
begin
Rec.CalcFields("Skipped Records", "API Errors");
if Rec."Skipped Records" > 0 then

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$\textbf{🟡\ Medium\ Severity\ —\ Style}$

The new StyleExpr values are assigned from inline text literals ('Ambiguous', 'Favorable', 'Unfavorable') in OnAfterGetRecord(). These style tokens form a small contract with the page runtime, so leaving them as repeated magic strings makes typos and future drift harder to spot. Define named object-scope constants or locked labels for the allowed style values and assign those instead.

👍 useful · ❤️ especially valuable · 👎 wrong - reply with why · AL review agent v1.31.4


var
SkippedRecordsStyleTxt: Text;
APIErrorsStyleTxt: Text;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$\textbf{🟡\ Medium\ Severity\ —\ Style}$

The page file ends without a trailing newline. Add a final newline after the closing brace so the file matches normal source-file formatting conventions and avoids repeated \ No newline at end of file diff noise in future changes.

Suggested fix (apply manually — could not be anchored as a one-click suggestion):

}

👍 useful · ❤️ especially valuable · 👎 wrong - reply with why · AL review agent v1.31.4

@github-actions

Copy link
Copy Markdown
Contributor

$\textbf{🟡\ Medium\ Severity\ —\ Testing}$

This change adds two new Shopify cue FlowFields plus page-side styling and drilldown behavior, but no Shopify test codeunit changes accompany it. Add tests that seed skipped-record and error-log data, open "Shpfy Activities", and verify the new cue counts, style states, and the "API Errors" drilldown filter so these UI/data behaviors are covered by regression tests.

Line mapping was unavailable, so this was posted as an issue comment.

👍 useful · ❤️ especially valuable · 👎 wrong - reply with why · AL review agent v1.31.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AL: Apps (W1) Add-on apps for W1 Integration GitHub request for Integration area

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant