I have a Finder method defined on an External Content type (created with Visual Studio). Whan That method receives a parameter. So the method is something like ReadList(string partnerName). I have FilterDescriptor associated with this parameter so the parameter gets populated when I use Entity Picker dialog.
But When I use CAML Query to get items (using SharePoint Client Object Model) I can't get to call the ReadList method with a parameter. An example of my CAML Query is
<View>
<Method Name='ReadList'/>
<Query>
<Where>
<Contains>
<FieldRef Name='Name'/>
<Value Type='Text'>{0}</Value>
</Contains>
</Where>
</Query>
<ViewFields>
<FieldRef Name='Name'/>
<FieldRef Name='Id'/>
<FieldRef Name='BdcIdentity'/>
</ViewFields>
</View>
Setting breakpoint on my BCS assembly I see that indeed ReadList method is called, but parameter is empty. Is it possible to pass the parameter to the method as well?
String.Format(@"<View><Method Name=...", Request.QueryString["PartnerName"]);. If you're doing it in JavaScript, you need to make a function for querystring (you can find one on my blog (search for qs). Next you put the CAML query in a variable (for examplevar query = "<View><Method Name=...";' and next you do aquery = query.replace(/\{0\}/g, qs("partner"));` – Gomiunik Apr 7 '12 at 18:34