{"title":"ReadMultiple Operation","url":"https://jonas-paprotka.de/docs/dev-itpro/webservices/readmultiple-operation/","by":"JOP-AL","license":"Copyright (c) Microsoft Corporation. CC BY 4.0, https://creativecommons.org/licenses/by/4.0/; code samples MIT. From https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/webservices/readmultiple-operation, MicrosoftDocs/dynamics365smb-devitpro-pb at 828b6ee (2026-11-19). Changed: includes filled in, links to this site, and for agents shortened without dropping a fact.","credit":"Microsoft Corporation, CC BY 4.0","origin":"https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/webservices/readmultiple-operation","source":{"name":"Business Central developer and IT pro docs","repo":"https://github.com/MicrosoftDocs/dynamics365smb-devitpro-pb","commit":"828b6ee72fcd75755627cd6011f3d20899217ab2","date":"2026-11-19"},"checked":"2026-11-19","date":"2021-04-01","meta":{"topic":"article"},"outline":[{"level":2,"title":"Method Signature","slug":"method-signature","at":450,"chars":107},{"level":2,"title":"Parameters","slug":"parameters","at":557,"chars":502},{"level":2,"title":"Results","slug":"results","at":1059,"chars":650},{"level":2,"title":"Faults","slug":"faults","at":1709,"chars":185},{"level":2,"title":"Remarks","slug":"remarks","at":1894,"chars":11},{"level":2,"title":"Retrieving Last Page","slug":"retrieving-last-page","at":1905,"chars":155},{"level":2,"title":"Entity_Filter","slug":"entity_filter","at":2060,"chars":493},{"level":2,"title":"Usage Examples","slug":"usage-examples","at":2553,"chars":1136},{"level":2,"title":"Related information","slug":"related-information","at":3689,"chars":44}],"text":"Reads a filtered set of records. This operation returns an array of entities. The ReadMultiple operation allows the consumer of a web service to specify the number of records to be returned at one time. This can reduce load on the server.\n> NOTE\n> Records on a page that were inserted after the page was retrieved are not read. Records on a page may be incorrectly included in the retrieved dataset if they were deleted after the page was retrieved.\n## Method Signature\n`Entity [] ReadMultiple(Entity_Filter[] filterArray, string bookmarkKey, int setSize)`\n## Parameters\nParameter|Description\nfilterArray|Type: Entity_Filter\\[\\]<br /><br /> An array of record filters.\nbookmarkKey|Type: String<br /><br /> The last record bookmark of the page that was previously read.<br /><br /> To return the first page of results, set bookmarkKey to NULL.\nsetSize|Type: Integer<br /><br /> The size of the set to be returned.<br /><br /> To return the complete set of results, set setSize to zero.<br /><br /> To reverse the order of the results, set setSize to negative.\n## Results\nResult name|Description\n*entity\\[\\]*|Type: An array of Entities<br /><br /> An array of a specific object type that represents the page. Contains the latest values that are present on the page.<br /><br /> The server will return at most setSize records. If all records have been already returned, then subsequent calls will return no records \\(a 0-element array in C\\#\\). You should keep calling the ReadMultiple method until no records are returned.\nentity.Key|Type: String<br /><br /> The key of the last record read. In C\\#, you can access it with `Entity[Entity.Length-1].Key`. Pass this as bookmarkKey for the next ReadMultiple call.\n## Faults\nThis operation does not throw faults when no matching records are present. Instead, it returns an empty record list.\nFaults are possible if they are generated by the AL code.\n## Remarks\n## Retrieving Last Page\nTo retrieve the last record of a page, set setSize to -1. Using negative numbers in setSize sorts the records in descending order.\n## Entity_Filter\nYou use the Entity_Filter parameter with the ReadMultiple operation. It describes a filter that can be applied on a specific field in a record. The Entity_Filter parameter contains two members: Field and Criteria.\n Field contains the name of the field that the filter is applied to. This name comes from the Entity_Fields enum.\n Criteria is of type string and can contain any valid Business Central style filter that is specified in a standard Business Central filter format.\n## Usage Examples\nThe following example returns the first 100 customer names that start with an S.\n```c#\nList<Customer_Filter> filterArray = new List<Customer_Filter>();\nCustomer_Filter nameFilter = new Customer_Filter();\nnameFilter.Field = Customer_Fields.Name;\nnameFilter.Criteria = \"S*\";\nfilterArray.Add(nameFilter);\nCustomer[] custList = service.ReadMultiple(filterArray.ToArray(), null, 100);\n```\nThis example uses the bookmarkKey argument to read customer records in batches of 10:\n```c#\nCustomer_Service service = new Customer_Service();\nservice.UseDefaultCredentials = true;\n\nconst int fetchSize = 10;\nstring bookmarkKey = null;\nList<Customer> customerList = new List<Customer>();\n\n// Reads customer data in pages of 10.\nCustomer[] results = service.ReadMultiple(new Customer_Filter[] { }, bookmarkKey, fetchSize);\nwhile (results.Length > 0)\n{\n    bookmarkKey = results.Last().Key;\n    customerList.AddRange(results);\n    results = service.ReadMultiple(new Customer_Filter[] { }, bookmarkKey, fetchSize);\n}\n\n// Prints the collected data.\nforeach (Customer customer in customerList)\n{\n    Console.WriteLine(customer.Name);\n}\n```\n## Related information\nbasic-page-operations"}