---
title: "Codeunit 5950 Service-Calc. Discount"
author: "Jonas Paprotka"
url: https://jonas-paprotka.de/ref/codeunit/5950-service-calc-discount/
type: codeunit
id: 5950
name: "Service-Calc. Discount"
app: "Base Application"
namespace: Microsoft.Service.Document
versions: "17-28"
build: 28.5.54151.54365
source: "https://jonas-paprotka.de/ref/codeunit/5950-service-calc-discount/source/29/"
checked: 2026-09-20
subject: "Microsoft Dynamics 365 Business Central"
license: "Content © 2026 Jonas Paprotka. Quote freely with attribution and a link."
---

# Codeunit 5950 Service-Calc. Discount

Jonas Paprotka, https://jonas-paprotka.de/ref/codeunit/5950-service-calc-discount/

| | |
| --- | --- |
| App | Base Application |
| Namespace | Microsoft.Service.Document |
| Versions | 17-28 |
| Source file | Service/Document/ServiceCalcDiscount.Codeunit.al |

## Procedures

| Name | Parameters | Returns | Access | Versions | Obsolete | Reason |
| --- | --- | --- | --- | --- | --- | --- |
| CalculateWithServHeader | (var Record Service Header, var Record Service Line, var Record Service Line) | - | public | 17-28 | - | - |
| CalculateIncDiscForHeader | (var Record Service Header) | - | public | 17-28 | - | - |

## Events

| Kind | Name | Parameters | Versions | Obsolete | Reason |
| --- | --- | --- | --- | --- | --- |
| Integration event | OnAfterCalcServDiscount | (var Record Service Header) | 17-21 | - | - |
| Integration event | OnBeforeCalcServDiscount | (var Record Service Header) | 17-22 | - | - |
| Integration event | OnCalculateInvoiceDiscountOnAfterServiceLine2ValidateQuantity | (var Record Service Header, var Record Service Line, var Record Cust. Invoice Disc.) | 19-28 | - | - |
| Integration event | OnCalculateInvoiceDiscountOnBeforeServiceLine2Delete | (var Record Service Line) | 20-21 | - | - |
| Integration event | OnCalculateInvoiceDiscountOnBeforeServiceLineInsert | (var Record Service Line, Record Service Header) | 20-28 | - | - |
| Integration event | OnAfterCalcServDiscount | (var Record Service Header, var Record VAT Amount Line, var Record Service Line) | 22-28 | - | - |
| Integration event | OnCalculateInvoiceDiscountOnBeforeServiceLine2Delete | (var Record Service Line, Boolean, var Boolean) | 22-28 | - | - |
| Integration event | OnCalculateInvoiceDiscountOnBeforeApplyServiceCharge | (var Record Cust. Invoice Disc., var Record Service Header, Date, Decimal, var Boolean) | 22-28 | - | - |
| Integration event | OnCalculateInvoiceDiscountOnBeforeIsServiceChargeUpdated | (var Record Service Line, Record Customer Posting Group, var Boolean) | 22-28 | - | - |
| Integration event | OnBeforeCalcServDiscount | (var Record Service Header, var Record Service Line, var Record Service Line, Boolean, var Boolean) | 23-28 | - | - |
| Integration event | OnCalculateInvoiceDiscountOnAfterSetServiceLineFilters | (var Record Service Line) | 26-28 | - | - |
| Internal event | OnCalculateInvoiceDiscountOnAfterApplyServiceCharge | (var Record Cust. Invoice Disc., var Record Service Header, var Record Service Line, Date, Boolean) | 27-28 | - | - |

## Source

Symbols: Microsoft.BaseApplication.symbols.437dbf0e-84ff-417a-965d-ed2bb9650972, https://dynamicssmb2.pkgs.visualstudio.com/DynamicsBCPublicFeeds/_packaging/MSSymbols/nuget/v3/index.json, highest build per major on 2026-09-20.
AL source 29: https://github.com/microsoft/BCApps, MIT, releases/29.x at a66254c3b8b5bb1cea290dc8f9d097aec4381153.

Jonas Paprotka, 2026-09-20.
