Skip to main content

Service Order Lockout

Business Central extension that prevents concurrent editing of Service Orders by locking records to a single user at a time. Other users see the order in read-only mode with a notification identifying the current editor. Includes automatic stale-lock cleanup, a manager override action, and role-based access control via the BW-CS-SERVICE permission set.

Overview

When a Customer Service representative opens a Service Order, the extension acquires a lock on that record. If a second user opens the same order, they see a message identifying the first user and are placed in View Only mode — they can read the order but cannot edit it. When the first user closes the order, the lock releases and the next opener gets full edit access.

A Live Status column on the Service Orders list shows Open or In Progress at a glance so agents can tell which orders are currently being worked on before drilling in.

Features

  • Record-level locking — only one user can edit a given Service Order at a time
  • Live Status columnOpen / In Progress indicator on the Service Orders list
  • Concurrent access notification — second user sees who holds the lock and enters View Only mode
  • Record navigation support — navigating between orders via Next/Previous correctly releases the previous lock and acquires a new one
  • Stale lock auto-release — locks older than a configurable threshold (default: 4 hours) are automatically cleared on page open
  • Release Lock action — SUPER users can manually force-release a stuck lock directly from the Service Order card
  • Configuration page — enable/disable toggle and timeout setting via "Service Order Lockout Setup"
  • Role-based access control — only users with the BW-CS-SERVICE or SUPER permission set can access Service Orders when lockout is enabled

Installation

  1. Publish the extension to the Business Central environment
  2. Assign the BW-CS-SERVICE permission set to all Customer Service users who need Service Order access (see Permission Set)
  3. Search for "Service Order Lockout Setup" to verify default settings (Enabled = true, Timeout = 4 hours)

Usage

Customer Service Representatives

  • Open an order — the lock is acquired automatically. Edit normally.
  • Close the order — the lock releases automatically. No extra steps required.
  • Open an order another user is editing — a message identifies the current editor. Click OK to view the order in read-only mode.
  • Navigate between orders — using Next/Previous on the card automatically releases the previous lock and acquires the new one.
  • Check the list — the Live Status column shows which orders are currently being worked on.

Supervisors / SUPER Users

  • Release a stuck lock — open the locked Service Order, then click Processing → Release Lock. Confirm the prompt. The lock transfers to you.
  • Configuration — search for "Service Order Lockout Setup" to:
    • Toggle lockout on/off (useful during bulk data operations or migrations)
    • Set the stale lock timeout (1–72 hours; default: 4)

Permission Set

The BW-CS-SERVICE permission set (ID 52401) controls access to Service Orders when lockout is enabled. Users without this permission set (and without SUPER) are blocked from opening the Service Order card.

Object TypeObjectPermission
Table DataService HeaderRead, Modify
Table DataService Order Lockout SetupRead

The permission level is intentionally Read/Modify only — CS representatives edit existing orders but do not create or delete them. Insert and Delete are omitted by design.

SUPER users are permitted through the access check without explicit BW-CS-SERVICE assignment, ensuring administrators can always reach the Release Lock action.

Configuration

SettingDefaultRangeDescription
Lockout Enabledtrueon / offMaster toggle. When disabled, all locking logic is bypassed — no locks are acquired, the Live Status column is hidden, and all users can edit freely.
Stale Lock Timeout (Hours)41 – 72Hours before an unreleased lock is considered stale and auto-cleared on page open.

Access the configuration page via BC search: "Service Order Lockout Setup" (under Administration).

Objects

IDNameTypeDescription
52400ServiceHeaderTable ExtensionExtends Service Header with Check Status, Live Status, Open By User ID, and Locked At fields
52401Service Order Lockout SetupTableSingleton configuration table (lockout toggle, timeout)
52400ServiceOrdersPage ExtensionExtends Service Orders list with Live Status column
52401ServiceOrderPage ExtensionExtends Service Order card with lock/unlock logic and Release Lock action
52402Service Order Lockout SetupPageConfiguration card page
52401BW-CS-SERVICEPermission SetGrants CS users access to Service Orders
52402Service Order Lockout UpgradeCodeunitClears stale locks during v1.0 → v1.1 upgrade

Known Limitations

  • Sub-second race on concurrent lock acquisition — if two users open the same unlocked order within the same sub-second window, both can acquire the lock. The practical risk is negligible (microseconds window, worst case is the pre-extension status quo), and the stale lock timeout provides a backstop. A LockTable() call would eliminate the race but serializes all Service Order card opens across the entire table.
  • Locking enforced at the page layer only — API calls, web services, batch jobs, and direct Modify calls from other extensions do not acquire or respect locks. This is appropriate for the intended use case (preventing CS reps from stepping on each other in the UI) but is not a data-integrity concurrency control.

Changelog

See docs/CHANGELOG.md for a summary of all changes, and the linked CHANGE documents for detailed narratives.