sprTimeSheetJournalLines

Prev Next

Represents timesheet journal lines (spr) in Business Central.

Methods

Method Return Type Description
GET sprTimeSheetJournalLines sprTimeSheetJournalLines Gets a timesheet journal line object.
DELETE sprTimeSheetJournalLines none Deletes a timesheet journal line object.
POST sprTimeSheetJournalLines sprTimeSheetJournalLines Creates a timesheet journal line object.
PATCH sprTimeSheetJournalLines sprTimeSheetJournalLines Updates a timesheet journal line object.

Navigation

Navigation Return Type Description
sprTimeSheetJournals sprTimeSheetJournal Gets the timesheet journal associated with the journal line.
sprEmployees sprEmployee Gets the employee associated with the journal line.
sprContracts sprContract Gets the contract associated with the journal line.
sprAllocations sprAllocation Gets the allocation associated with the journal line.
sprActivityCodes sprActivityCode Gets the activity code associated with the journal line.
sprDimensionSetLines Collection(sprDimensionSetLine) Gets the dimension set lines of the journal line.

Properties

Property Type Description Relation to
id Guid Specifies the timesheet journal line's ID. Non-editable.
journalBatchName String[10] Specifies the timesheet journal batch's name. sprTimeSheetJnlBatch.name
journalBatchId Guid Specifies the timesheet journal batch's ID. sprTimeSheetJnlBatch.id
lineNo Int32 Specifies the timesheet journal line's number.
changeType NAV.sprTimeSheetJnlChangeType Specifies the timesheet journal line's change type. It can be:
0- " "
1- Add Time (Obsolete)
2- Set Activity
3- Delete Period
4- Refill Period
employeeNo String[20] Specifies the employee's number. sprEmployees.number
employeeId Guid Specifies the employee's ID. sprEmployees.id
contractNo String[20] Specifies the contract's number. sprContracts.number
contractId Guid Specifies the contract's ID. sprContracts.id
allocationNo Int32 Specifies the allocation's number. sprAllocations.number
allocationId Guid Specifies the allocation's ID. sprAllocations.id
activityCode String[10] Specifies the activity's code. sprActivityCodes.code
activityId Guid Specifies the activity's ID. sprActivityCodes.id
activityType Option Specifies the activity's type. Read-Only.
Available options:
0- " "
1- Work
2- Non-Work
3- Business Trip
4- Vacation
5- Work Incapacity
6- Absence
7- Day off
dateFrom Date Specifies the timesheet journal line's start date.
dateTo Date Specifies the timesheet journal line's end date.
hours Decimal Specifies the timesheet journal line's number of hours.
systemModifiedAt DateTimeOffset Specifies the timesheet journal line's last modified date. Read-Only.
Post Journal

Entries created in Journal and Journal Lines has no effect to payroll calculation until Journal is Posted. Call bound action Microsoft.NAV.postJournalLines on sprTimeSheetJournals API

Examples

Create sprTimeSheetJournalLines

POST URI: /companies({{companyId}})/sprTimeSheetJournalLines

Request

{
    "journalBatchId": "{{timeSheetJournalId}}",
    "changeType": "2",
    "employeeId": "{{employeeId}}",
    "contractId": "{{contractId}}",
    "allocationId": "{{allocationId}}",
    "activityCode": "DD",
    "dateFrom": "2025-11-01",
    "dateTo": "2025-11-05",
    "hours": 8
}

Create sprTimeSheetJournalLines with sprDimensionSetLines at once

POST URI: /companies({{companyId}})/sprTimeSheetJournalLines?$expand=sprDimensionSetLines

Request

{
    "journalBatchId": "{{timeSheetJournalId}}",
    "changeType": "2",
    "employeeId": "{{employeeId}}",
    "activityCode": "DD",
    "dateFrom": "2025-11-01",
    "dateTo": "2025-11-05",
    "hours": 8,
    "sprDimensionSetLines" : [
        {
            "id": "ef863059-4ec6-ec11-bac4-fc8e882d628f",
            "code": "PADALINYS",
            "valueId": "f3863059-4ec6-ec11-bac4-fc8e882d628f",
            "valueCode": "ADM"
        },
        {
            "id": "f2863059-4ec6-ec11-bac4-fc8e882d628f",
            "code": "SEKTORIUS",
            "valueId": "03873059-4ec6-ec11-bac4-fc8e882d628f",
            "valueCode": "S02"
        }
    ]
}