Quantcast
Channel: Developing Apps for SharePoint 2013 forum
Viewing all articles
Browse latest Browse all 8089

How to work with ECT-s in JSOM ?

$
0
0
Hi. I have an app which should get data from ECT-s. I have configured an ECT named Cars which is connected to my SQL db.
In my app i have a such code
1.var ctx = SP.ClientContext.get_current();
2.
3.       
4.        var ect = ctx.get_web().getEntity(namespace, 5.name);
6.        ctx.load(ect);
7.
8.        var lob = ect.getLobSystem();
9.        ctx.load(lob);
10.
11.        var lobs = lob.getLobSystemInstances();
12.        ctx.load(lobs);
13.
14.        ctx.executeQueryAsync(function () {
15.            var c = SP.ClientContext.get_current();
16.            var filters = 17.ect.getFilters('Cars_Read_List');
18.            c.load(filters);
19.
20.            var filtered = 21.ect.findFiltered(filters, 'Cars_Read_List', 22.lobs.get_item(0));
23.            c.load(filtered);
24.            
25.            c.executeQueryAsync(function () {
26.                for (var i = 0; i < 27.filtered.get_count() ; i++) {
28.                    var entityInstance = 29.filtered.get_item(i);
30.                    var fields = 31.entityInstance.get_fieldValues();
32.                }
33.            }, this.onError);
34.            
35.        }, this.onError);

everything goes fine until the row 25. When i reach c.executeQueryAsync function on that row nothing happens... my code doesn't go forward and i don't get any exception or any message. what is the problem and is this the right way to retrieve ECTs?

Viewing all articles
Browse latest Browse all 8089

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>