Basic operations (for SOAP web services)

If you publish a page as a SOAP web service, it has a set of default operations that are exposed to consumers of the web service.

Note

Instead of exposing UI pages as web service endpoints, use API pages or API queries because they've been optimized for this scenario. For more information, see Writing efficient Web Services

These operations match the actions a user can perform by interacting with a page using the Business Central client. The same page- and table-based business logic is run.

The following table lists the operations and provides links to reference pages.

Pages that are backed by virtual tables aren't editable through web services. When such pages are published as SOAP web services, the only operations that are available are Read, ReadMultiple, and IsUpdated.

The term entity that is used in the operation signatures describes the data type that is used. The actual entity is defined by the page that is exposed because it contains all controls that are defined on the page. The controls are normally bound to the page's source table. The entity also contains a key that is a special string that uniquely identifies the source table record with a timestamp. This key is used as an argument in many page operations.

All basic page operations are atomic, which means that either all relevant records are affected or no records are affected, even if there was a faulty condition in only one record.

Operation Description and signature
Create Operation Creates a single record.

void Create(ref Entity entity)
CreateMultiple Operation Creates a set of records.

void CreateMultiple(ref Entity[] entity)
Delete Operation Deletes a single record.

bool Delete(string key)
Delete_part Operation Deletes a subpage of the current page.

bool Delete_<part>(string key)
GetRecIdFromKey Converts a key, which is always part of the page result, to a record ID.

string GetRecIdFromKey(string key)
IsUpdated Operation Checks if an object has been updated since the key was obtained.

bool IsUpdated(string key)
Read Operation Reads a single record.

Entity Read(string no)
ReadByRecId Operation Reads the record that is identified by RecId. You can use GetRecIdFromKey to obtain a record ID. If the record isn't found, then the operation returns null.

Entity ReadByRecId(string formattedRecId)
ReadMultiple Operation Reads a filtered set of records, paged.

Entity [] ReadMultiple(Entity_Filter[] filterArray, string bookmarkKey, int setSize)
Update Operation Updates a single record.

void Update(ref Entity entity)
UpdateMultiple Operation Updates a set of records.

void UpdateMultiple(ref Entity[] entity)

Note

Support for the SOAP protocol is being deprecated in Business Central and will be removed in the future. Start planning to move your solutions to use either OData or APIs pages/queries. The article Deprecated Features in the Platform - Clients, Server, and Database will include a section of which release this will happen in when a timeline is available for the removal.

See also

Web service performance
Troubleshoot web service errors
Web service telemetry
SOAP Web Services