---
title: "GetRecordsEx"
canonical: "https://docs.dk.is/space/DEV/10354705/GetRecordsEx"
format: markdown
---
This function is used to return chunks [TRecord](https://dkdocs.atlassian.net/wiki/spaces/DEV/pages/10356227) from a table and is very useful to do a full read of a table   
The same can be accomplished using [GetRecords](https://dkdocs.atlassian.net/wiki/spaces/DEV/pages/10355290) passing the date and time to enumerate through the table. 

## Parameters

Used to call the function

1. TableName - string
2. RecordID - Integer
3. NumberOfRecords - Integer
4. opt - [TRecordOptions](https://dkdocs.atlassian.net/wiki/spaces/DEV/pages/10355850)

## Returns

Returns the following

- Array of [TRecord](https://dkdocs.atlassian.net/wiki/spaces/DEV/pages/10356227)

In this example we start by getting the first chunk from the table  
then we take the RecordID of the last record returned and pass it in again until we finish enumerating through the table  


##### **Get Records from Job table**

```csharp
IItemServiceservice recService = new dkWS.IItemServiceservice() { TokenSecurityValue = new TokenSecurity() { Token = token.Token, AppID = token.AppID } };
var jOpt = new TRecordOptions() { ExtraProperties = new string[] { "RecordID", "Number", "Name", "RecordModified" }, MaxRecords = 100, UseXMLDateTime = true };
var recs = recService.GetRecordEX("pjjob", 0, 100, jOpt);
List<TRecord> list = new List<TRecord>();
list.AddRange(recs);
while(recs.Count()> 80)
{
    var iLast = Convert.ToInt32(recs[recs.Count() - 1].Fields.SingleOrDefault(x => x.Name.ToLower() == "recordid").Value);
    recs = recService.GetRecordEX("pjjob", iLast, 100, jOpt);

}


```

 

 

## Related articles



> Macro (contentbylabel)

> Macro (details)
> 
> | **Related issues** |  |
> | --- | --- |