I thought this would be simple, but I am stumped by the object model at this point. here is my situiation.
I would like to return the value of a particular column called 'Prokey' from an external list.
Now , getting selected items is easy enough using:
SP.ListOperation.Selection.getSelectedItems(context);
but this only returns IDs. in the case of external lists, the BdcIdentity column value.
getting the column values is also pretty easy with this bit of code:
var queryFields = '<ViewFields><FieldRef Name="Prokey" /><FieldRef Name="BdcIdentity" /></ViewFields>';
var camlQuery = new SP.CamlQuery();
camlQuery.set_viewXml(queryFields);
wwlistItems= mylist.getItems(camlQuery);
context.load(wwlistItems,'Include(Prokey,BdcIdentity)');
context.executeQueryAsync(ReadListItemSucceeded, ReadListItemFailed);
but this code returns THE ENTIRE LIST, not just selected items. I have tried to combine the two (creating a CAML query with a Where clause for each selected item's BdcIdentity value, but I get no results from the query