A BDC method is something you can do with the Business Data Catalog Entity, such as return all its rows, or return a specific row based on its identifier value.
There are four method types you can add to Business Data Catalog Application Definition File and they define how your BDC data should be used within Sharepoint. Here they are
1) Finder method – Returns all the rows of Business Data Catalog entity.
2) Specific Finder Method - Returns one specific row based on the entity’s identifier value passed in as a parameter.
3) ID Enumerator – Returns all the identifier values’ of an entity.
4) Generic Invoker – This is a custom method that a user can define for a BDC entity and then use in custom solutions via BDC API.
Depending on how you want to use your BDC data within SharePoint will impact which methods you create in your application definition file.
Finder Method
Business Data List Web Part
Business Data Column (item picker)
SpecificFinder
Business Data Item Web Part
Business Data Column
BDC Profile Page
BDC Search
IDEnumerator
BDC Search
To define method for BDC entity, you should add <methods> tag to the already defined entity, and within each <method> tag define your method’s type, parameters, properties, filters,etc.
<Methods>
<Method name=”GetProducts”>
// Properties
// Filter Descriptors
// Parameters
// Method Instances
<Method>
<Methods>
Properties - If you are defining a database entity and method you should define RDBCommandText and RDBCommandType Properties in your method.
Filter Descriptors - As we know a Business Data Catalog finder method returns all the rows of BDC entity, so the appropriate select query could return lots of rows which is not good. It may make sense if we can filter the data we want to view. To do that, we can add filter descriptors within <method> tag.
Parameters - There are two types of parameters, with “In” and “Return” direction.
In Parameters should be used in conjunction with any Filter Descriptor you define. Also your Specific Finder method will need in parameters for each identifier in your entity so this method can return a unique row of data.
The data structure being returned by your BDC method should defined as a Return parameter.
Method Instances - a method is defined as a certain type (eg Finder, Specific Finder etc) by being tagged with a MethodInstance element. Through the clever use of parameters it is possible to have a single method defined as a Finder and SpecificFinder methodinstance - but it makes debugging and maintenance of your application definition files hard. In our experience it is always better to have seperate methods for each method instance type.
Defining BDC Methods in your application definition file from scratch is pretty complex, but using BDC Meta Man you can define methods for entities very easily.
You just need drag and drop the entity on design surface, edit it and move to the Methods tab, and you will find Finder, Specific Finder and ID Enumerator already defined for you. You can just modify it if you want, create filters, modify parameters,etc.
