---
id: object/codeunit/5900
type: object
title: Codeunit 5900 "ServOrderManagement"
summary: Codeunit 5900 "ServOrderManagement" in Base Application (Microsoft.Service.Document). 21 public procedures, 19 events. Present since at least BC23, still in BC30, changed in BC24, BC26, BC29.
tier: official
language: en
tags:
  - codeunit
  - base application
versions:
  introduced: null
  last_changed: "29"
  deprecated: null
review:
  state: derived
  by: null
  at: null
  flags: []
generated:
  at: "2026-10-11T00:31:51.816Z"
  pipeline: 0.2.0
  prompts: {}
  input_hash: d4f720b8bf485949841e744e02c1ec471d24c3b29e96a3966697a6b02b411d85
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Layers/W1/BaseApp/Service/Document/ServOrderManagement.Codeunit.al
    title: src/Layers/W1/BaseApp/Service/Document/ServOrderManagement.Codeunit.al (releases/29.x)
    date: null
    commit: ea08af5ef2d6a9b5c5af4a029288abbe2c883220
    t: null
    quote: null
links:
  learn: []
  objects: []
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
  changes:
    - change/bcapps/10631
    - change/bcapps/10424
object_type: codeunit
object_id: 5900
name: ServOrderManagement
namespace: Microsoft.Service.Document
app: Base Application
extends: null
first_version: "23"
last_version: "30"
present_in:
  - "23"
  - "24"
  - "25"
  - "26"
  - "27"
  - "28"
  - "29"
  - "30"
changed_in:
  - "24"
  - "26"
  - "29"
source_major: "29"
obsolete: null
countries: []
ms_search_form_ids: []
counts:
  fields: 0
  procedures: 47
  events: 19
  subscribers: 0
relations:
  out: 0
  referenced_by: 0
  pages: 0
  extended_by: 0
  event_subscribers: 0
  calls: 8
  called_by: 12
  implements: 0
---

# Codeunit 5900 "ServOrderManagement"

> Codeunit 5900 "ServOrderManagement" in Base Application (Microsoft.Service.Document). 21 public procedures, 19 events. Present since at least BC23, still in BC30, changed in BC24, BC26, BC29.

Base Application · Microsoft.Service.Document · BC23-30 · [source at ea08af5e](https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Layers/W1/BaseApp/Service/Document/ServOrderManagement.Codeunit.al) · facts from BC29

## Events published

- `OnBeforeCalcContractDates(var ServiceHeader: Record "Service Header"; var ServiceItemLine: Record "Service Item Line"; var IsHandled: Boolean)` (integration)
- `OnBeforeCalcServItemDates(var ServiceHeader: Record "Service Header"; ServItemNo: Code[20]; var IsHandled: Boolean)` (integration)
- `OnBeforeToCustInvDiscInsert(var ToCustInvoiceDisc: Record "Cust. Invoice Disc."; FromCustInvoiceDisc: Record "Cust. Invoice Disc.")` (integration)
- `OnBeforeUpdateResponseDateTime(var ServItemLine: Record "Service Item Line"; var Deleting: Boolean; var IsHandled: Boolean)` (integration)
- `OnLookupServItemNoOnAfterServItemSetFilters(var ServItemLine: Record "Service Item Line"; var ServItem: Record "Service Item"; ServHeader: Record "Service Header")` (integration)
- `OnLookupServItemNoOnBeforeServItemReset(var ServiceItemLine: Record "Service Item Line"; var ServiceItem: Record "Service Item"; ServiceHeader: Record "Service Header")` (integration)
- `OnReplacementCreateServItemAfterNewServItemFilterSet(var IsHandled: Boolean; var NewServItem: Record "Service Item")` (integration)
- `OnReplacementCreateServItemAfterSerialNoCheck(var NewServItem: Record "Service Item"; FromServItem: Record "Service Item"; SerialNo: Code[50]; ServiceLine: Record "Service Line"; ServShptDocNo: Code[20]; ServShptLineNo: Integer; var IsHandled: Boolean)` (integration)
- `OnReplacementCreateServItemOnBeforeServItemAutoCreated(var FromServItem: Record "Service Item"; NewServItem: Record "Service Item"; ServiceLine: Record "Service Line"; var IsHandled: Boolean)` (integration)
- `OnAfterReplacementCreateServItem(NewServItem: Record "Service Item"; FromServItem: Record "Service Item"; var IsHandled: Boolean)` (integration)
- `OnAfterCopyCustFromServiceHeader(var Cust: Record Customer; ServiceHeader: Record "Service Header")` (integration)
- `OnInsertServCostOnCostTypeOneOnAfterServCostGet(var ServHeader: Record "Service Header"; var ServCost: Record "Service Cost")` (integration)
- `OnInsertServCostOnCostTypeZeroOnBeforeTestServiceZoneCode(ServiceHeader: Record "Service Header"; var ServiceCost: Record "Service Cost"; var IsHandled: Boolean)` (integration)
- `OnUpdateResponseDateTimeOnBeforeNewResponseDate(var ServiceItemLine: Record "Service Item Line"; var IsHandled: Boolean)` (integration)
- `OnBeforeLookupServItemNo(var ServiceItemLine: Record "Service Item Line"; var IsHandled: Boolean)` (integration)
- `OnCopyCommentLinesWithSubTypeOnBeforeServCommentLineInsert(var ServiceCommentLine2: Record "Service Comment Line"; var IsHandled: Boolean)` (integration)
- `OnBeforeCopyComponentsFromBOM(var ServiceItem: Record "Service Item"; var IsHandled: Boolean)` (integration)
- `OnCreateCustFromTemplateOnBeforeCustInsert(var Customer: Record Customer; CustomerTempl: Record "Customer Templ."; ServiceHeader: Record "Service Header")` (integration)
- `OnBeforeCheckItemServiceBlocked(var ServiceItemLine: Record "Service Item Line"; var IsHandled: Boolean)` (integration)

## Procedures

- `ServHeaderLookup(DocumentType: Integer; var DocumentNo: Code[20]): Boolean`
- `UpdateResponseDateTime(var ServItemLine: Record "Service Item Line"; Deleting: Boolean)`
- `CreateNewCustomer(var ServHeader: Record "Service Header")`
- `ReplacementCreateServItem(FromServItem: Record "Service Item"; ServiceLine: Record "Service Line"; ServShptDocNo: Code[20]; ServShptLineNo: Integer; var TempTrackingSpecification: Record "Tracking Specification" temporary)`
- `InsertServCost(ServInvLine: Record "Service Line"; CostType: Integer; LinktoServItemLine: Boolean): Boolean`
- `FindContactInformation(CustNo: Code[20]): Code[20]`
- `FindResLocationCode(ResourceNo: Code[20]; StartDate: Date): Code[10]`
- `CalcServTime(StartingDate: Date; StartingTime: Time; FinishingDate: Date; FinishingTime: Time; ContractNo: Code[20]; ContractCalendarExists: Boolean): Decimal`
- `LookupServItemNo(var ServItemLine: Record "Service Item Line")`
- `UpdatePriority(var ServItemLine: Record "Service Item Line"; Deleting: Boolean)`
- `InServiceContract(var ServInvLine: Record "Service Line"): Boolean`
- `CheckServItemRepairStatus(ServHeader: Record "Service Header"; var ServItemLine: Record "Service Item Line" temporary; var ServLine: Record "Service Line")`
- `CopyCommentLines(FromDocumentType: Integer; ToDocumentType: Integer; FromNo: Code[20]; ToNo: Code[20])`
- `CopyCommentLinesWithSubType(FromDocumentType: Integer; ToDocumentType: Integer; FromNo: Code[20]; ToNo: Code[20]; FromTableSubType: Integer)`
- `CalcContractDates(var ServHeader: Record "Service Header"; var ServItemLine: Record "Service Item Line")`
- `CalcServItemDates(var ServHeader: Record "Service Header"; ServItemNo: Code[20])`
- `IsCreditDocumentType(ServiceDocumentType: Enum "Service Document Type"): Boolean` (internal)
- `CheckServiceItemBlockedForAll(var ServiceItemLine: Record "Service Item Line")` (internal)
- `CheckServiceItemBlockedForAll(var ServiceLine: Record "Service Line")` (internal)
- `CheckItemServiceBlocked(var ServiceItemLine: Record "Service Item Line")` (internal)
- `CheckItemServiceBlocked(var ServiceLine: Record "Service Line")` (internal)

Plus 7 local procedures.

## Triggers

OnRun

## Calls

From the extracted call graph of BC29 (graphify-al on the snapshot checkout): calls whose target is known from a declared type or an `Object::"Name"` argument. Interface dispatch and calls through events are not counted, so the list is not complete.

- [Codeunit 7600 "Calendar Management"](../codeunit/7600.md) (3 calls: `CalcServTime → CalcTimeDelta`, `CalcServTime → IsNonworkingDay`, `CalcServTime → SetSource`)
- [Codeunit 1381 "Customer Templ. Mgt."](../codeunit/1381.md) (2 calls: `CreateCustFromTemplate → InitCustomerNo`, `CreateCustFromTemplate → SelectCustomerTemplate`)
- [Codeunit 5906 "ServLogManagement"](../codeunit/5906.md) (2 calls: `ReplacementCreateServItem → ServItemAutoCreated`, `ReplacementCreateServItem → ServItemReplaced`)
- [Codeunit 27 "Confirm Management"](../codeunit/27.md) (1 call: `CreateNewCustomer → GetResponseOrDefault`)
- [Codeunit 5056 "CustCont-Update"](../codeunit/5056.md) (1 call: `CreateCustFromTemplate → InsertNewContactPerson`)
- [Codeunit 5921 "ServComponent-Copy from BOM"](../codeunit/5921.md) (1 call: `CopyComponentsFromBOM → (object)`)
- [Codeunit 5931 "Resource Skill Mgt."](../codeunit/5931.md) (1 call: `ReplacementCreateServItem → CloneObjectResourceSkills`)
- [Page 456 "No. Series"](../page/456.md) (1 call: `ReplacementCreateServItem → (object)`)

## Called by

- [Table 5901 "Service Item Line"](../table/5901.md) (8 calls: `OnDelete → UpdatePriority`, `OnDelete → UpdateResponseDateTime`, `OnInsert → UpdatePriority`, …)
- [Codeunit 5988 "Serv-Documents Mgt."](../codeunit/5988.md) (7 calls: `CalcContractDates → CalcContractDates`, `CheckServiceItemBlockedForAll → CheckServiceItemBlockedForAll`, `PostDocumentLines → CheckServItemRepairStatus`, …)
- [Table 5902 "Service Line"](../table/5902.md) (3 calls: `CopyFromItem → IsCreditDocumentType`, `InitHeaderDefaults → FindResLocationCode`, `ReplaceServItem → IsCreditDocumentType`)
- [Codeunit 416 "Release Service Document"](../codeunit/416.md) (2 calls: `CheckServiceItemBlockedForAllAndItemServiceBlocked → CheckItemServiceBlocked`, `CheckServiceItemBlockedForAllAndItemServiceBlocked → CheckServiceItemBlockedForAll`)
- [Codeunit 5923 "Service-Quote to Order"](../codeunit/5923.md) (2 calls: `CheckItemServiceBlocked → CheckItemServiceBlocked`, `CheckServiceItemBlockedForAll → CheckServiceItemBlockedForAll`)
- [Page 5905 "Service Lines"](../page/5905.md) (2 calls: `InsertStartFee → InsertServCost`, `InsertTravelFee → InsertServCost`)
- [Page 5907 "Service Item Worksheet Subform"](../page/5907.md) (2 calls: `InsertStartFee → InsertServCost`, `InsertTravelFee → InsertServCost`)
- [Page 5966 "Service Quote Lines"](../page/5966.md) (2 calls: `InsertStartFee → InsertServCost`, `InsertTravelFee → InsertServCost`)
- [Table 5900 "Service Header"](../table/5900.md) (2 calls: `UpdateBillToCont → FindContactInformation`, `UpdateCont → FindContactInformation`)
- [Table 5965 "Service Contract Header"](../table/5965.md) (2 calls: `UpdateBillToCont → FindContactInformation`, `UpdateCont → FindContactInformation`)
- [Codeunit 5912 "ServLedgEntries-Post"](../codeunit/5912.md) (1 call: `InsertServLedgerEntry → InServiceContract`)
- [Codeunit 5920 "ServItemManagement"](../codeunit/5920.md) (1 call: `AddOrReplaceSIComponent → ReplacementCreateServItem`)

## Recent changes

- 2026-08-26 [#10631 Integration/main to releases 29.x 31a860b5](../../changes/bcapps/10631.md) (releases/29.x, BC29, feature)
- 2026-08-24 [#10424 [Extensibility Request] issue 30421: allow custom travel cost lookup](../../changes/bcapps/10424.md) (main, BC30, feature)

## Across versions

- Present in: BC23-30
- Changed (declaration) in: BC24, BC26, BC29

Source: AL metadata extracted from the code (names, ids, signatures, properties); no code bodies (D10).

## Ask your agent

Procedure bodies are not stored here (D10). The call sections above are our own, per object, from the BC29 call graph. For a procedure body or the calls of one procedure, ask bc-code-atlas (external, by Stefan Maron, MIT; default corpus w1-28), which the bc-observatory plugin connects: `bcatlas_resolve_node(object_type: "codeunit", object_name: "ServOrderManagement")`, then `bcatlas_get_procedure_body` or `bcatlas_get_neighbors` on the returned id.
