Method Instances

Hi,

An entity can have a single Finder method.

Is it possible an entity have multiple IdEnumerator and "Specific Finder"?

Thanks!

Masood.

[178 byte] By [MuhammadMasood] at [2008-1-1]
# 1

The following descriptions from MSDN may answer your question:

A Finder is a special method that returns entity instances. A SpecificFinder returns exactly one entity instance. Finder methods are static methods and do not take a key as an input parameter. SpecificFinder methods are also static methods but they take a key (ID) explicitly.

Entities that can be reached only by association must have zero finders. Other entities should have one Finder method that returns multiple instances, and one SpecificFinder method that returns a single instance, given an ID.

For example, for the Customer entity, the Finder method might be SELECT * FROM Customers and the SpecificFinder method might be SELECT * FROM Customers WHERE CustomerID = id.

If you do not define Finders methods, your entity cannot be used in a Business Data List Web Part; if you do not define SpecificFinder methods, that entity cannot have actions on it, cannot be searched or indexed, and cannot be used in any of the Business Data features except the Related List Web Part.

To qualify for a Finder, the corresponding method must take filterable parameters as input and return collections of records, where each record must contain the key of the entity instance it represents. To qualify as a SpecificFinder, the corresponding method must take the entity instance key as one of the input parameters and must return fields, of which one of the fields is the key.

There is no reason to have more than one IDEnumerator because its function is just to get all the unique records. It is perceivable to have more than one specific finder because you may want to get to a specific record using different parameters, though I have not tried it myself. If it doesn't work then it is more an architectural design issue. You can always create one more entity and specify your additional specificfinder in there.

FrankChiang at 2007-9-12 > top of Msdn Tech,SharePoint Products and Technologies,SharePoint - Business Data Catalog...
# 2
It should also be noted that a ViewAccessor can in some ways act like an extra SpecificFinder. See the section on ViewAccessors at http://msdn2.microsoft.com/en-us/library/ms519671.aspx. You can select a ViewAccessor from the Toolpane for a Business Data Item Web Part via the View drop down.
JasonKillian-MSFT at 2007-9-12 > top of Msdn Tech,SharePoint Products and Technologies,SharePoint - Business Data Catalog...
# 3

Hi Jason,

do you have some sample XML for the view accessor method instance?

Thanks

Nick

NickSwan at 2007-9-12 > top of Msdn Tech,SharePoint Products and Technologies,SharePoint - Business Data Catalog...
# 4

Nick,

A search on Google using 'BDC ViewAccessor' returns exactly 1 result that points to the MSDN page that Jason listed above. There is no Metadata definition for it but I experimented and found that if I just copied the 'SpecificFinder' method and changed its type to 'ViewAccessor' then the method shows up in 'Business Data Item' web part. So in essence, ViewAccessor is just like SpecificFinder and as a result, an entity can have 1 SpecificFinder and 0 or many ViewAccessor(s) and therefore extending the power of an entity and that's good news.

FrankChiang at 2007-9-12 > top of Msdn Tech,SharePoint Products and Technologies,SharePoint - Business Data Catalog...
# 5

I have posted some xml examples that detail use of the ViewAccessor method here. Provides a little more explanation

Thanks!!

BruceVB at 2007-9-12 > top of Msdn Tech,SharePoint Products and Technologies,SharePoint - Business Data Catalog...

SharePoint Products and Technologies

Site Classified