Visualforce Remote Objects – Retrieve Offset Paging Example

29 Oct

Below is a simple example of retrieving Account records using Salesforce Remote Objects. I imagine the paging functionality could be better, but it works to show how the offset property can be conditionally added to the query parameters JSON Object.

Remote Objects Retrieve Example


    
    
    
    
        
            
        
    

    
    

    

Retrieve Accounts via Remote Objects

{!$ObjectType.Account.Fields.Name.Label} {!$ObjectType.Account.Fields.Phone.Label} {!$ObjectType.Account.Fields.BillingCity.Label} {!$ObjectType.Account.Fields.BillingState.Label} {!$ObjectType.Account.Fields.Active__c.Label}

Salesforce has decent documentation on using RemoteObjects. See Format and Options for Remote Objects Query Criteria to learn more about record selection.

Salesforce Remote Object Documentation