Deleter Methods – Business Connectivity Services

Currently BCS Meta Man generates methods for reading your data from external systems and also creating new and updating existing rows of data. We have held off implementing the Deleter method type. This is because physically deleting records of data from an external system is a permanent action and not something you may wish your users to be doing. We’ll wait for feedback from people as to whether they want this method type automatically generated. In this walkthrough we’ll show you how to manually add a deleter method type to your BCS Model created with BCS Meta Man.

1) Generate a BCS Model and .Net assembly code on any table. It should look something like this.

    BCS Meta Man with external content type added

[click the images for a larger view]

2) Right click on the bcsmm file, and open the file in XML editor.

    Open model with XML Editor pick XML (Text) Editor

3) We need to declare a Deleter method in the model file. Please replace the input parameter with the identifier(s) of your table.

    Add the Deleter method to your model file

4)  We need to define a C# method for the delete method. Open up generated service class and add the following code for delete method.

     Add C# do execute your delete

5) For Oracle the generated code will be something like this.

    Sample C# code for Oracle

6) Now if you deploy the solution to your SharePoint server, go and create an external list on this external content type, you’ll be able to delete records.

    Delete a row of data from your External List

<hrayr/>