---
title: "Codeunit 131902 Library - Service"
author: "JOP-AL"
url: https://jonas-paprotka.de/ref/codeunit/131902-library-service/
type: codeunit
id: 131902
name: "Library - Service"
app: "Application Test Library"
namespace: Microsoft.Service.Test
versions: "28-29"
build: 29.0.54011.55644
countries: "W1, DE, US"
source: "https://jonas-paprotka.de/ref/codeunit/131902-library-service/source/"
checked: 2026-11-20
changed: 2026-10-05
subject: "Microsoft Dynamics 365 Business Central"
license: "Metadata from Microsoft's symbol packages. AL source MIT, Copyright (c) Microsoft Corporation. Selection and wording © 2026 JOP-AL. https://jonas-paprotka.de/licenses/"
---

# Codeunit 131902 Library - Service

JOP-AL, https://jonas-paprotka.de/ref/codeunit/131902-library-service/

| | |
| --- | --- |
| App | Application Test Library |
| Namespace | Microsoft.Service.Test |
| Versions | 28-29 |
| Minors | W1 28.0-29.0; DE 28.0-29.0; US 28.0-29.0, [every minor](https://jonas-paprotka.de/ref/codeunit/131902-library-service/editions.json) |
| Source file | LibraryService.Codeunit.al |

## Procedures

| Name | Parameters | Returns | Access | Versions | Obsolete | Reason |
| --- | --- | --- | --- | --- | --- | --- |
| CreateBaseCalendar | (var BaseCalendar: Record "Base Calendar") | - | public | 28-29 | - | - |
| CreateContractGroup | (var ContractGroup: Record "Contract Group") | - | public | 28-29 | - | - |
| CreateContractLineCreditMemo | (var ServiceContractLine: Record "Service Contract Line"; Deleting: Boolean) | Code[20] | public | 28-29 | - | - |
| CreateContractServiceDiscount | (var ContractServiceDiscount: Record "Contract/Service Discount"; ServiceContractHeader: Record "Service Contract Header"; Type: Enum "Service Contract Discount Type"; No: Code[20]) | - | public | 28-29 | - | - |
| CreateExtendedTextForItem | (ItemNo: Code[20]) | Text | public | 28 | Pending 26.0 | Moved to codeunit Library Inventory |
| CreateExtendedTextHeaderItem | (var ExtendedTextHeader: Record "Extended Text Header"; ItemNo: Code[20]) | - | public | 28 | Pending 26.0 | Moved to codeunit Library Inventory |
| CreateExtendedTextLineItem | (var ExtendedTextLine: Record "Extended Text Line"; ExtendedTextHeader: Record "Extended Text Header") | - | public | 28 | Pending 26.0 | Moved to codeunit Library Inventory |
| CreateFaultArea | (var FaultArea: Record "Fault Area") | - | public | 28-29 | - | - |
| CreateFaultCode | (var FaultCode: Record "Fault Code"; FaultAreaCode: Code[10]; SymptomCode: Code[10]) | - | public | 28-29 | - | - |
| CreateFaultReasonCode | (var FaultReasonCode: Record "Fault Reason Code"; ExcludeWarrantyDiscount: Boolean; ExcludeContractDiscount: Boolean) | - | public | 28-29 | - | - |
| CreateFaultResolCodesRlship | (var FaultResolCodRelationship: Record "Fault/Resol. Cod. Relationship"; FaultCode: Record "Fault Code"; ResolutionCode: Code[10]; ServiceItemGroupCode: Code[10]) | - | public | 28-29 | - | - |
| CreateLoaner | (var Loaner: Record Loaner) | - | public | 28-29 | - | - |
| CreateReasonCode | (var ReasonCode: Record "Reason Code") | - | public | 28-29 | - | - |
| CreateRepairStatus | (var RepairStatus: Record "Repair Status") | - | public | 28-29 | - | - |
| CreateResolutionCode | (var ResolutionCode: Record "Resolution Code") | - | public | 28-29 | - | - |
| CreateResponsibilityCenter | (var ResponsibilityCenter: Record "Responsibility Center") | - | public | 28-29 | - | - |
| CreateServiceCommentLine | (var ServiceCommentLine: Record "Service Comment Line"; TableName: Enum "Service Comment Table Name"; TableSubtype: Option; No: Code[20]; Type: Enum "Service Comment Line Type"; TableLineNo: Integer) | - | public | 28-29 | - | - |
| CreateCommentLineForServHeader | (var ServiceCommentLine: Record "Service Comment Line"; ServiceItemLine: Record "Service Item Line"; Type: Enum "Service Comment Line Type") | - | public | 28-29 | - | - |
| CreateCommentLineForServCntrct | (var ServiceCommentLine: Record "Service Comment Line"; ServiceContractLine: Record "Service Contract Line"; Type: Enum "Service Comment Line Type") | - | public | 28-29 | - | - |
| CreateOrderFromQuote | (ServiceHeader: Record "Service Header") | - | public | 28-29 | - | - |
| CreateServiceContractAcctGrp | (var ServiceContractAccountGroup: Record "Service Contract Account Group") | - | public | 28-29 | - | - |
| CreateServiceContractHeader | (var ServiceContractHeader: Record "Service Contract Header"; ContractType: Enum "Service Contract Type"; CustomerNo: Code[20]) | - | public | 28-29 | - | - |
| CreateServiceContractLine | (var ServiceContractLine: Record "Service Contract Line"; ServiceContractHeader: Record "Service Contract Header"; ServiceItemNo: Code[20]) | - | public | 28-29 | - | - |
| CreateServiceContractTemplate | (var ServiceContractTemplate: Record "Service Contract Template"; DefaultServicePeriod: DateFormula) | - | public | 28-29 | - | - |
| CreateServiceCost | (var ServiceCost: Record "Service Cost") | - | public | 28-29 | - | - |
| CreateServiceCreditMemoHeaderUsingPage | () | Code[20] | public | 28-29 | - | - |
| CreateServiceHeader | (var ServiceHeader: Record "Service Header"; DocumentType: Enum "Service Document Type"; CustomerNo: Code[20]) | - | public | 28-29 | - | - |
| CreateServiceOrder | (var ServiceHeader: Record "Service Header"; PostingDate: Date) | - | public | 28-29 | - | - |
| CreateServiceOrderHeaderUsingPage | () | Code[20] | public | 28-29 | - | - |
| CreateServiceDocumentWithItemServiceLine | (var ServiceHeader: Record "Service Header"; DocumentType: Enum "Service Document Type") | - | public | 28-29 | - | - |
| CreateServiceDocumentForCustomerNo | (var ServiceHeader: Record "Service Header"; DocumentType: Enum "Service Document Type"; CustomerNo: Code[20]) | - | public | 28-29 | - | - |
| CreateDefaultServiceHour | (var ServiceHour: Record "Service Hour"; Day: Option) | - | public | 28-29 | - | - |
| CreateServiceHour | (var ServiceHour: Record "Service Hour"; ServiceContractHeader: Record "Service Contract Header"; Day: Option) | - | public | 28-29 | - | - |
| CreateServiceItem | (var ServiceItem: Record "Service Item"; CustomerNo: Code[20]) | - | public | 28-29 | - | - |
| CreateServiceItemComponent | (var ServiceItemComponent: Record "Service Item Component"; ServiceItemNo: Code[20]; Type: Enum "Service Item Component Type"; No: Code[20]) | - | public | 28-29 | - | - |
| CreateServiceItemGroup | (var ServiceItemGroup: Record "Service Item Group") | - | public | 28-29 | - | - |
| CreateServiceItemLine | (var ServiceItemLine: Record "Service Item Line"; ServiceHeader: Record "Service Header"; ServiceItemNo: Code[20]) | - | public | 28-29 | - | - |
| CreateServiceLineWithQuantity | (var ServiceLine: Record "Service Line"; ServiceHeader: Record "Service Header"; Type: Enum "Service Line Type"; No: Code[20]; Quantity: Decimal) | - | public | 28-29 | - | - |
| CreateServiceLine | (var ServiceLine: Record "Service Line"; ServiceHeader: Record "Service Header"; Type: Enum "Service Line Type"; No: Code[20]) | - | public | 28-29 | - | - |
| CreateServiceLineForPlan | (JobPlanningLine: Record "Job Planning Line"; UsageLineType: Enum "Job Line Type"; Fraction: Decimal; var ServiceLine: Record "Service Line") | - | public | 28-29 | - | - |
| CreateServiceOrderFromReport | (ServiceContractHeader: Record "Service Contract Header"; StartDate: Date; EndDate: Date; UseRequestPage: Boolean) | - | public | 28-29 | - | - |
| CreateServiceOrderType | (var ServiceOrderType: Record "Service Order Type") | - | public | 28-29 | - | - |
| CreateServicePriceGroup | (var ServicePriceGroup: Record "Service Price Group") | - | public | 28-29 | - | - |
| CreateServPriceAdjustmntDetail | (var ServPriceAdjustmentDetail: Record "Serv. Price Adjustment Detail"; ServPriceAdjmtGrCode: Code[10]; Type: Option; No: Code[20]) | - | public | 28-29 | - | - |
| CreateServPriceAdjustmentGroup | (var ServicePriceAdjustmentGroup: Record "Service Price Adjustment Group") | - | public | 28-29 | - | - |
| CreateServPriceGroupSetup | (var ServPriceGroupSetup: Record "Serv. Price Group Setup"; ServicePriceGroupCode: Code[10]; FaultAreaCode: Code[10]; CustPriceGroupCode: Code[10]) | - | public | 28-29 | - | - |
| CreateServiceZone | (var ServiceZone: Record "Service Zone") | - | public | 28-29 | - | - |
| CreateStandardServiceCode | (var StandardServiceCode: Record "Standard Service Code") | - | public | 28-29 | - | - |
| CreateStandardServiceLine | (var StandardServiceLine: Record "Standard Service Line"; StandardServiceCode: Code[10]) | - | public | 28-29 | - | - |
| CreateStandardServiceItemGr | (var StandardServiceItemGrCode: Record "Standard Service Item Gr. Code"; ServiceItemGroupCode: Code[10]; StandardServiceCode: Code[10]) | - | public | 28-29 | - | - |
| CreateSymptomCode | (var SymptomCode: Record "Symptom Code") | - | public | 28-29 | - | - |
| CreateTroubleshootingHeader | (var TroubleshootingHeader: Record "Troubleshooting Header") | - | public | 28-29 | - | - |
| CreateTroubleshootingLine | (var TroubleshootingLine: Record "Troubleshooting Line"; TroubleshootingHeaderNo: Code[20]) | - | public | 28-29 | - | - |
| CreateTroubleshootingSetup | (var TroubleshootingSetup: Record "Troubleshooting Setup"; Type: Enum "Troubleshooting Item Type"; No: Code[20]; TroubleshootingNo: Code[20]) | - | public | 28-29 | - | - |
| ChangeCustomer | (ServiceContractHeader: Record "Service Contract Header"; NewCustomerNo: Code[20]) | - | public | 28-29 | - | - |
| CheckServiceTimeSheetLine | (TimeSheetHeader: Record "Time Sheet Header"; ServiceHeaderNo: Code[20]; ServiceLineNo: Integer; ServiceLineQuantity: Decimal; Chargeable: Boolean) | - | public | 28-29 | - | - |
| FindContractAccountGroup | (var ServiceContractAccountGroup: Record "Service Contract Account Group") | - | public | 28-29 | - | - |
| FindServiceCost | (var ServiceCost: Record "Service Cost") | - | public | 28-29 | - | - |
| FindServiceItemGroup | (var ServiceItemGroup: Record "Service Item Group") | - | public | 28-29 | - | - |
| FindResolutionCode | (var ResolutionCode: Record "Resolution Code") | - | public | 28-29 | - | - |
| FindFaultReasonCode | (var FaultReasonCode: Record "Fault Reason Code") | - | public | 28-29 | - | - |
| FindServiceContractLine | (var ServiceContractLine: Record "Service Contract Line"; ContractType: Enum "Service Contract Type"; ContractNo: Code[20]) | - | public | 28-29 | - | - |
| FindServiceInvoiceHeader | (var ServiceInvoiceHeader: Record "Service Invoice Header"; PreAssignedNo: Code[20]) | - | public | 28-29 | - | - |
| FindServiceCrMemoHeader | (var ServiceCrMemoHeader: Record "Service Cr.Memo Header"; PreAssignedNo: Code[20]) | - | public | 28-29 | - | - |
| PostServiceOrder | (var ServiceHeader: Record "Service Header"; Ship: Boolean; Consume: Boolean; Invoice: Boolean) | - | public | 28-29 | - | - |
| PostServiceOrderWithPassedLines | (var ServiceHeader: Record "Service Header"; var TempServiceLine: Record "Service Line" temporary; Ship: Boolean; Consume: Boolean; Invoice: Boolean) | - | public | 28-29 | - | - |
| ReleaseServiceDocument | (var ServiceHeader: Record "Service Header") | - | public | 28-29 | - | - |
| ReopenServiceDocument | (var ServiceHeader: Record "Service Header") | - | public | 28-29 | - | - |
| SetCorrDocNoService | (var ServiceHeader: Record "Service Header") | - | public | 28-29 | - | - |
| SetShipmentOnInvoice | (ShipmentOnInvoice: Boolean) | - | public | 28-29 | - | - |
| SetupServiceMgtNoSeries | () | - | public | 28-29 | - | - |
| GetFirstWorkingDay | (WorkingDate: Date) | Date | public | 28-29 | - | - |
| GetNextWorkingDay | (WorkingDate: Date) | Date | public | 28-29 | - | - |
| GetNonWrkngDayFollwdByWrkngDay | () | Date | public | 28-29 | - | - |
| GetServiceHourForDate | (var ServiceHour: Record "Service Hour"; OrderDate: Date) | Boolean | public | 28-29 | - | - |
| GetServiceOrderReportGrossAmount | (ServiceLine: Record "Service Line") | Decimal | public | 28-29 | - | - |
| GetShipmentLines | (var ServiceLine: Record "Service Line") | - | public | 28-29 | - | - |
| IsWorking | (DateToCheck: Date) | Boolean | public | 28-29 | - | - |
| IsValidOnHolidays | (DateToCheck: Date) | Boolean | public | 28-29 | - | - |
| SignContract | (ServiceContractHeader: Record "Service Contract Header") | - | public | 28-29 | - | - |
| SignContract | (ServiceContractHeader: Record "Service Contract Header"; HideDialog: Boolean) | - | public | 28-29 | - | - |
| AutoReserveServiceLine | (ServiceLine: Record "Service Line") | - | public | 28-29 | - | - |
| UndoShipmentLinesByServiceOrderNo | (ServiceOrderNo: Code[20]) | - | public | 28-29 | - | - |
| UndoShipmentLinesByServiceDocNo | (ServiceDocumentNo: Code[20]) | - | public | 28-29 | - | - |
| UndoConsumptionLinesByServiceOrderNo | (ServiceOrderNo: Code[20]) | - | public | 28-29 | - | - |
| UndoConsumptionLinesByServiceDocNo | (ServiceDocumentNo: Code[20]) | - | public | 28-29 | - | - |
| CreateDefaultYellowLocation | (var Location: Record Location) | Code[10] | public | 28-29 | - | - |
| CreateFullWarehouseLocation | (var Location: Record Location; NumberOfBinsPerZone: Integer) | - | public | 28-29 | - | - |
| CreateCustomizedCalendarChange | (BaseCalendarCode: Code[10]; var CustomizedCalendarChange: Record "Customized Calendar Change"; SourceType: Option; SourceCode: Code[10]; AdditionalSourceCode: Code[10]; RecurringSystem: Option; WeekDay: Option; IsNonWorking: Boolean) | - | public | 28-29 | - | - |
| CombineShipments | (var ServiceHeader: Record "Service Header"; var ServiceShipmentHeader: Record "Service Shipment Header"; PostingDate: Date; DocumentDate: Date; CalcInvDisc: Boolean; PostInvoices: Boolean; OnlyStdPmtTerms: Boolean; CopyTextLines: Boolean) | - | public | 28-29 | - | - |
| Job2ServiceConsumableType | (Type: Enum "Job Planning Line Type") | Enum Service Line Type | public | 28-29 | - | - |
| InitScenarioWTForServiceOrder | (var TimeSheetHeader: Record "Time Sheet Header"; var ServiceHeader: Record "Service Header") | - | public | 28-29 | - | - |
| InitServiceScenario | (var TimeSheetHeader: Record "Time Sheet Header"; var TimeSheetLine: Record "Time Sheet Line"; var ServiceHeader: Record "Service Header") | - | public | 28-29 | - | - |
| InitBackwayScenario | (var TimeSheetHeader: Record "Time Sheet Header"; var ServiceHeader: Record "Service Header"; var ServiceLine: Record "Service Line") | - | public | 28-29 | - | - |
| CreateSpecificServiceOrder | (var ServiceHeader: Record "Service Header"; PaymentTermsCode: Code[10]; CFPaymentTermsCode: Code[10]) | - | public | 28-29 | - | - |
| CreateDefaultServiceOrder | (var ServiceHeader: Record "Service Header") | - | public | 28-29 | - | - |
| CreateServiceLines | (ServiceHeader: Record "Service Header") | - | public | 28-29 | - | - |

## Events

| Kind | Name | Parameters | Versions | Obsolete | Reason |
| --- | --- | --- | --- | --- | --- |
| Integration event | OnBeforeCustomerModifyCreateServiceLine | (var Customer: Record Customer) | 28-29 | - | - |
| Integration event | OnBeforePostServiceOrder | (var ServiceHeader: Record "Service Header") | 28-29 | - | - |

## Source

Symbols: Microsoft.ApplicationTestLibrary.symbols.d852d5d2-a39d-4179-baeb-f99a19e32510, https://dynamicssmb2.pkgs.visualstudio.com/DynamicsBCPublicFeeds/_packaging/MSSymbols/nuget/v3/index.json, highest build per major on 2026-11-20.
AL source 29: https://github.com/microsoft/BCApps, MIT, releases/29.x at 4303e5e584d3aa5d9e98cbc615525a5396ad6ed7.

JOP-AL, 2026-11-20.
