External list and client object model: The given key was not present in the dictionary

While using the client object model in order to retrieve the list data from an external list, you may receive this exception while calling the load method:
The given key was not present in the dictionary

It seems that you need to keep some rules in account:
1) Specify the method name in the camlQuery
2) Specify the fields that are used in the external list in the camlQuery
3) Specify the fields again but in the Load method of the ClientContext object

C# and Javascript examples:

Rowlimit not working
I specified the rowlimit to 30 ,as you can see in my c# example, but this atribute is ignored. If you want to limit the returned items to let's say 30 you need to use the Take(30) Linq Method after the Include() method. In the Javascript example, this is not as easy as it seems. I'm stil searching for a solution, someone a hint?

Retrieving the Fieldrefs and the Method name
Koen Roos has posted the easiest way to retrieve the Fieldrefs attributes and the Method needed to retrieve the items from the external by using SharePoint Designer.

Technet Question
http://social.technet.microsoft.com/For … 70208af4d6

Good luck!

VN:F [1.9.22_1171]
Rating: 5.5/10 (2 votes cast)
VN:F [1.9.22_1171]
Rating: 0 (from 2 votes)
External list and client object model: The given key was not present in the dictionary, 5.5 out of 10 based on 2 ratings