function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
twinoakstwinoaks 

ol list start at number 2 not number 1!

Hi,

 

Is it possible to start a list from number 2 say.

 

The start="2" is NOT working.

 

Thanks in anticipation

Vinit_KumarVinit_Kumar

Are you querying the records and you want it to start from '2',if that's the scenario then you should be using OFFSET keyword in your query,something like below :-

 

SELECT Id FROM Account LIMIT 100 OFFSET 2 // This would start from the 2nd record

 

Please go through the below link to learn more :-

 

http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_calls_soql_select_offset.htm

 

 

twinoakstwinoaks

Thanks for your answer but I have a list but I want to begin with number 2 not the default which is number 1 is is this possible please>?

 

 

<ol>   list </ol>

Vinit_KumarVinit_Kumar

Yes,

 

The same way you can store it in a list like below :-

 

List<Account> accList =[select id from Account Limit 10 OFFSET 2]; // This list would contain the records starting from no 2

Deshraj KumawatDeshraj Kumawat

You can use the attribute "first" if you are using pageBlockTable or repeat tag to display your list and define the index from where you want to visibly render the items in your collection.

 

You can use attribute "first" for all the apex tag allows to use collection as source.