• #11659
    Salesforce | Ravi Ravi #403
    Forcetalks

    How can I use 'query more' using javascript remoting?

    How can I use ‘query more’ using javascript remoting?

     

    #12827
    Salesforce | Surbhi Surbhi #389
    Forcetalks

    Hi Ravi,

    Please have a look on below code:

    @RemoteAction

    public static SObject[] getRecords(Id offsetId) {
    if(offsetId == null) {
    return [SELECT Id, Name FROM Contact ORDER BY Id ASC LIMIT 100];
    } else {
    return [SELECT Id, Name FROM Contact WHERE ID > :offsetId ORDER BY Id ASC LIMIT 100];
    }
    }

    function handleResult(result, event) {
    // handle a batch here
    // do more
    if(result.length===100)
    {!$RemoteAction.controller.getRecords}(result[99].Id,handleResult);
    }
    }
    {!$RemoteAction.controller.getRecords}(null,handleResult);

    Thanks

Viewing 2 posts - 1 through 2 (of 2 total)

Please to reply to this topic.

CONTACT US

We're not around right now. But you can send us an email and we'll get back to you, asap.

Sending

About Us

Forcetalks is a Salesforce collaboration platform for coders & developers, geeks & nerds, consultants & business heads, admins & architects, managers & marketers and of course the business owners. A community where you can learn from, where you can contribute to. For you. For Salesforce. Read More...

Copyright 2018 Forcetalks. All Right Reserved.

Log in with your credentials

or    

Forgot your details?