Skip to main content

Change Document — Bestway CSM API Toolkit v1.1.0.0

Date: 2026-03-02 Extension: Bestway CSM API Toolkit Previous Version: 1.0.0.0 New Version: 1.1.0.0


Background

The CMS FAQ Management extension (Sataware Technologies) synchronizes Bestway's FAQ system with Business Central's fault reporting tables. To validate that synchronization programmatically — both during UAT and ongoing regression testing — the test automation framework needs read-only API access to the six fault tables and two posted document tables.

The existing bc-csm-api extension (v1.0.0.0) already exposes Service Orders, Service Order Lines, and Service Order Attachments under the bestway/csm/v1.0 API group. This update adds 8 new API pages following the same pattern, providing the data access layer for the CMS FAQ Management automated test suite.

Summary of Changes

#CategorySeverityDescription
1AddedStandardFault Area API (Page 56105)
2AddedStandardSymptom Code API (Page 56106)
3AddedStandardFault Code API (Page 56107)
4AddedStandardResolution Code API (Page 56108)
5AddedStandardFault Resol. Relation API (Page 56109)
6AddedStandardFA Symptom Relation API (Page 56120)
7AddedStandardPosted Svc. Invoice Line API (Page 56121)
8AddedStandardPosted Svc. Shipment Line API (Page 56122)
9AddedStandardApplication Insights telemetry in app.json
10ChangedStandardMigrated changelog to two-tier docs format
11ChangedStandardReorganized AL files into type-based subfolders

Detailed Changes

1–4. Fault Table APIs (Pages 56105–56108)

Four new API pages expose the standard BC fault reporting master tables: Fault Area (5915), Symptom Code (5916), Fault Code (5918), and Resolution Code (5919).

Each page follows the established bc-csm-api pattern:

  • PageType = API, Editable = false, ODataKeyFields = SystemId
  • Published under bestway/csm/v1.0
  • Exposes Code, Description, and SystemId

These pages enable automated tests to query BC for the current state of fault data after a FAQ sync — verifying that codes exist, descriptions match, and counts are correct.

Pending: FAQ sync fields (FAQ ID, Active, Created in FAQ, Last Modified in FAQ, Created in BC, Last Modified in BC) will be added to these pages once the CMS FAQ Management extension field names are confirmed after sandbox deployment.

Files:

  • Page/FaultAreaAPI.Page.al (new)
  • Page/SymptomCodeAPI.Page.al (new)
  • Page/FaultCodeAPI.Page.al (new)
  • Page/ResolutionCodeAPI.Page.al (new)

5. Fault/Resolution Code Relationship API (Page 56109)

Exposes the standard BC Fault/Resolution Code Relationship table (5920), which stores the many-to-many relationships between Fault Area, Symptom Code, Fault Code, and Resolution Code within a Service Item Group context.

Fields exposed: Fault Area Code, Symptom Code, Fault Code, Resolution Code, Service Item Group Code, Description, Occurrences, Created Manually.

Used by test cases TC-8.2 and TC-8.3 to validate that FAQ hierarchy relationships are correctly reflected in BC.

File: Page/FaultResolRelationAPI.Page.al (new)

6. Fault Area/Symptom Code Relationship API (Page 56120)

Exposes the custom BestwayUSA table INVC FA Symptom Code Relation (50113), which stores the many-to-many mapping between Fault Areas and Symptom Codes.

Fields exposed: Fault Area, Symptom Code, SystemId.

Note: The FlowField INVC Symptom Code Description is not exposed via the API because FlowFields require CalcFields execution and are not directly bindable on API pages.

File: Page/FASymptomRelationAPI.Page.al (new)

7–8. Posted Document Line APIs (Pages 56121–56122)

Two new API pages expose posted service document lines:

  • Posted Svc. Invoice Line API (56121) — Service Invoice Line table (5993)
  • Posted Svc. Shipment Line API (56122) — Service Shipment Line table (5991)

These enable test cases TC-9.1 and TC-9.2 (data safety) to verify that posted documents are not altered by FAQ sync operations. Fields include all standard fault code fields plus INVC custom fields (Bestway Serial No., Fault Code Description, etc.) on the invoice line page.

Files:

  • Page/PostedSvcInvoiceLineAPI.Page.al (new)
  • Page/PostedSvcShipmentLineAPI.Page.al (new)

9. Application Insights Telemetry

Added the applicationInsightsConnectionString to app.json, aligning with the repo-wide requirement that all extensions send telemetry to Bestway's shared Application Insights resource.

10. Two-Tier Documentation Migration

Migrated from the single-file CHANGELOG.md in the extension root to the two-tier format under docs/:

  • docs/CHANGELOG.md — summary index with categorized entries and links to change documents
  • docs/CHANGE-v1.1.0.0.md — this file, with detailed per-item analysis

11. File Reorganization

Reorganized all .al source files from the extension root into type-based subfolders, following the repo convention documented in the Contribution Guidelines:

  • Codeunit/ — helper codeunits (1 file: CsmApiHelper.Codeunit.al)
  • Page/ — API page objects (11 files, renamed from {Name}.al to {Name}.Page.al)

The legacy root-level CHANGELOG.md was removed — it is fully superseded by docs/CHANGELOG.md.

The same reorganization was applied to the test extension (bc-csm-api-test/), moving all 5 test codeunits into Codeunit/.

Object Inventory

Object IDTypeNameSource TableStatus
56101PageService Order APIService HeaderExisting
56102PageService Order Line APIService LineExisting
56103PageServ. Order Attachment APIDocument AttachmentExisting
56104CodeunitCSM API HelperExisting
56105PageFault Area APIFault Area (5915)New
56106PageSymptom Code APISymptom Code (5916)New
56107PageFault Code APIFault Code (5918)New
56108PageResolution Code APIResolution Code (5919)New
56109PageFault Resol. Relation APIFault/Resol. Cod. Relationship (5920)New
56120PageFA Symptom Relation APIINVC FA Symptom Code Relation (50113)New
56121PagePosted Svc. Invoice Line APIService Invoice Line (5993)New
56122PagePosted Svc. Shipment Line APIService Shipment Line (5991)New

File Structure

bc-csm-api/
├── app.json
├── README.md
├── BestwayCSM.postman_collection.json
├── Codeunit/
│ └── CsmApiHelper.Codeunit.al (56104)
├── Page/
│ ├── ServiceOrderAPI.Page.al (56101)
│ ├── ServiceOrderLineAPI.Page.al (56102)
│ ├── ServiceOrderAttachmentAPI.Page.al (56103)
│ ├── FaultAreaAPI.Page.al (56105) ← new
│ ├── SymptomCodeAPI.Page.al (56106) ← new
│ ├── FaultCodeAPI.Page.al (56107) ← new
│ ├── ResolutionCodeAPI.Page.al (56108) ← new
│ ├── FaultResolRelationAPI.Page.al (56109) ← new
│ ├── FASymptomRelationAPI.Page.al (56120) ← new
│ ├── PostedSvcInvoiceLineAPI.Page.al (56121) ← new
│ └── PostedSvcShipmentLineAPI.Page.al (56122) ← new
└── docs/
├── CHANGELOG.md
└── CHANGE-v1.1.0.0.md

Known Limitations

  1. FAQ sync fields not yet exposed. The CMS FAQ Management extension adds 6 fields to each fault table (FAQ ID, Active, Created/Modified timestamps). The exact field names are unknown until the compiled extension is deployed to the sandbox and symbols are downloaded. The API pages expose standard BC fields now and will be updated with FAQ sync fields in a patch release.

  2. FlowField on table 50113 not exposed. The INVC Symptom Code Description FlowField on the FA Symptom Relation table cannot be directly bound on an API page. Tests that need this value should join the Symptom Code API data in the test layer.

  3. No subpage linking. Unlike the Service Order API (which links Lines and Attachments as subpages), the new fault table APIs are standalone entities. OData $expand is not supported on these endpoints — each must be queried independently.

Deployment Notes

Pre-Deployment

  1. Ensure BestwayUSA extension v27.0.0.0 is published (dependency).
  2. Ensure CMS FAQ Management extension is published (for FAQ sync fields — not required for base fault table fields).

Deployment

  1. Build and publish bc-csm-api v1.1.0.0 to the sandbox via VS Code (AL: Publish / F5).
  2. Verify all 12 pages are accessible in the API endpoint listing.

Post-Deployment Verification

  1. Query each new endpoint via Postman or curl to confirm data returns.
  2. Verify OData pagination works on tables with >100 records (Fault Codes, Resolution Codes).
  3. Confirm the Application Insights resource receives telemetry events from the extension.

Testing

The automated test suite for the CMS FAQ Management extension (CMS FAQ Management/test/) depends on these API pages. After deploying v1.1.0.0:

  1. Configure the test .env file with BC credentials.
  2. Run pytest -m tier2 -v to verify BC OData connectivity.
  3. Run pytest -m tier3 -v to verify cross-system (FAQ API + BC) tests.

The existing bc-csm-api-test extension (56110–56114) is not affected by this change — it tests the Service Order API pages, not the fault table pages.