Skip to content

Latest commit

 

History

History
76 lines (56 loc) · 3.85 KB

how-to-add-a-deleter-method.md

File metadata and controls

76 lines (56 loc) · 3.85 KB
title description ms.date ms.topic dev_langs helpviewer_keywords author ms.author manager ms.subservice
Add a Deleter Method
Learn how to add a Deleter method in Visual Studio's BDC Designer, so an end user can delete a data record from an external list on a SharePoint site.
02/02/2017
how-to
VB
CSharp
BDC [SharePoint development in Visual Studio], deleting data
Business Data Connectivity service [SharePoint development in Visual Studio], Deleter
BDC [SharePoint development in Visual Studio], Deleter
BDC [SharePoint development in Visual Studio], removing data
BDC [SharePoint development in Visual Studio], deleting entity instances
Business Data Connectivity service [SharePoint development in Visual Studio], deleting entity instances
Business Data Connectivity service [SharePoint development in Visual Studio], deleting data
Business Data Connectivity service [SharePoint development in Visual Studio], removing data
John-Hart
johnhart
mijacobs
sharepoint-development

Add a Deleter method

You can enable an end user to delete a data record from an external list on a SharePoint site by adding a Deleter method to the model. For more information, see Design a business data connectivity model.

To create a Deleter method

  1. On the BDC Designer, choose an entity.

  2. On the menu bar, choose View > Other Windows > BDC Method Details.

    The BDC Method Details window opens. For more information about this window, see BDC model design tools overview.

  3. In the Add a Method list, choose Create a Deleter Method.

    Visual Studio adds the following elements to the model. These elements appear in the BDC Method Details window.

  4. In Solution Explorer, open the shortcut menu of the service code file that was generated for the entity, and then choose View Code.

    The entity service code file opens in the Code Editor. For more information about the entity service code file, see Create a business data connectivity model.

  5. Add code to the Deleter method to delete a record. The following example deletes a line item from a sales order by using the AdventureWorks sample database for SQL Server.

    [!NOTE] The method in this example uses two input parameters.

    [!NOTE] Replace the value of the ServerName field with the name of your server.

    :::code language="csharp" source="../sharepoint/codesnippet/CSharp/SP_BDC/bdcmodel1/salesorderdetailservice.cs" id="Snippet6":::

    :::code language="vb" source="../sharepoint/codesnippet/VisualBasic/sp_bdc/bdcmodel1/salesorderdetailservice.vb" id="Snippet6":::

Related content