{"title":"Delete Operation","url":"https://jonas-paprotka.de/docs/dev-itpro/webservices/delete-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/delete-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/delete-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":1083,"chars":46},{"level":2,"title":"Parameters","slug":"parameters","at":1129,"chars":149},{"level":2,"title":"Results","slug":"results","at":1278,"chars":138},{"level":2,"title":"Faults","slug":"faults","at":1416,"chars":449},{"level":2,"title":"Usage Example","slug":"usage-example","at":1865,"chars":679},{"level":2,"title":"Related information","slug":"related-information","at":2544,"chars":44}],"text":"Deletes a single record.\nExecuting the Delete operation in a web service first executes the ../developer/triggers-auto/page/devenv-ondeleterecord-page-trigger on the designated page. If application code in the OnDeleteRecord trigger for the page returns true, then the ../developer/triggers-auto/table/devenv-ondelete-table-trigger for the corresponding table is executed. If no fault occurs, then the record is deleted from the database.\nIf the application code in the trigger returns false, then the OnDelete trigger is not executed. This does not necessarily mean that the record has not been deleted because it may have been deleted explicitly by the application code for the page's OnDeleteRecord trigger.\nThe return value from the Delete operation is the return value from the page's OnDeleteRecord trigger.\nIf Delete returns true, then the record has been deleted. If Delete has thrown a fault, then the record has not been deleted. But when Delete returns false, then this indicates that there was application logic involved, and the record may or may not have been deleted.\n## Method Signature\n`bool Delete(string key)`\n## Parameters\nParameter|Description\nkey|Type: String<br /><br /> The bookmark of the record, including both primary key and concurrency information.\n## Results\nResult name|Description\nDelete_Result|Type: Boolean<br /><br /> The value that is returned by the OnDeleteRecord page trigger.\n## Faults\nSOAP fault message|Description\nOther user has modified \\[*record name*\\].|Indicates that another user or process has modified the record after it has been retrieved for this delete operation.\n\\[*record name*\\] \\[*field*\\] \\[*value*\\] does not exist.|Indicates that the record has been deleted by another user or process after it has been retrieved for this delete operation.\nOther faults are possible if they are generated by the AL code.\n## Usage Example\n```c#\n\n      using System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace ConsoleApplication\n{\n    // Imports newly generated web service proxy.\n    using WebService;\n\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // Creates instance of service and sets credentials.\n            Customer_Service service = new Customer_Service();\n            service.UseDefaultCredentials = true;\n            Customer cust = new Customer();\n            cust.Name = \"Customer Name\";\n            service.Create(ref cust);\n            cust = service.Read(cust.No);\n            service.Delete(cust.Key);\n        }\n    }\n}\n```\n## Related information\nbasic-page-operations"}