开发者

How to query more than 5000 records in Flex Salesforce app?

I've run into an issue where Salesforce will only return 1000 records to my flex app from a query. I'd like to get more than that (like 5000-10000). Is this possible?

Here is what I have tried (app is an F3WebApplication)

note:this code does work, I just need it to return more results:

app.wrapper.query(query, 
        new mx.rpc.Responder(
            function(rows:ArrayCollection):void {
            开发者_JAVA技巧    if(user_list != null){
                    filteredList = addOwnerData(rows);
                    filteredList = PutChildrenWithParents(filteredList);
                } else {
                    filteredList = PutChildrenWithParents(rows);
                }

                my_accounts_raw = new ArrayCollection(filteredList.toArray());
                refreshSearchData(filteredList);
            },
            function():void{_status = "apex error!";}
        )
    );   
}

I've also tried app.connection.Query to then use queryMore but can't get that to work at all.

Any ideas?


connection has access to query and queryMore, and the callback gets queryResult instead of the arrayCollection. Logic goes something like:


app.connection.query("SELECT Id, Name from ETC__c", new SfdcAsyncResponder(getResult,showError));

public function getResult(results:QueryResult):void { if(!results.done) {app.connection.queryMore(results.queryLocator,new SfdcAsyncResponder(getResult,showError));} / ... / }

Note that if you aren't using the wrapper functionality, you'll probably need to coordinate offline data manually (if this is AIR).

HTH


query/queryMore is the way to go, you'll need the queryLocator value from the first query result in order to call queryMore.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜