How to access a Particular 'Read List' operation in CSOM using Jquery..

I read the article below and found that multiple 'Read List' operations can be defined in same ECT as needed.

https://howtodowithsharepoint.wordpress.com/2014/06/01/sharepoint-2013-how-to-develop-filtered-views-for-external-lists-using-business-data-connectivity-service/

I found it interesting...

My main question is, I use below code to get this List records for any processing on UI..

        var ctx = new SP.ClientContext.get_current();
        var web = ctx.get_web();
        //Platform
        var list = web.get_lists().getByTitle('<List Name>');
        var query = new SP.CamlQuery();

        query.set_viewXml('<View><ViewFields><FieldRef Name="Field1" /><FieldRef Name="Field2" /></ViewFields></View>');
        items = list.getItems(query);
        ctx.load(items, 'Include(Field1, Field2)');

Where do I specify which one 'Read List' operation should above be executed upon?
September 12th, 2015 11:28am

Hi,

From your post, my understanding is that you want to query external list from the Read List operation using Jquery.

To access the external list data, we can define Method tag inside CAML query to get data from the Read List operation: <Method Name=Read List>.

In the CAML query, the ViewFields tag  requires you to include all fields that an operation returns.

In the ctx.load method the 'Include' statement makes the fields available to use in the onQuerySucceeded function.

Please refer to the link below for more details (Figure 5 is the code example for CAML query):

http://brandonmichaelhunter.blogspot.com/2011/04/using-javascript-to-access-external.html

Thanks,

Victoria

Free Windows Admin Tool Kit Click here and download it now
September 14th, 2015 1:08am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics