Don't have an account?
Search for an answer or ask a question of the zone or Customer Support.
You need to sign in to do that
Sign in to start searching questions
Signup for a Developer Edition
Sign in to start a discussion
how to display serial numbers for records in visual force page can any one suggest me ,on this
Thanks in Adavance...
Thanks for reply
i want display a serial number for recrords in visual force page ,can u please provide any sample code for me
It depends on where this serial number comes from. Is it a field on your record, or are you looking to generate this from other data?
i want to generate serial number field on my records
(1) Use the record id as the serial number
(2) Create an autonumber field on the record - you may need to update existing instances with this
All Answers
Thanks for reply
i want display a serial number for recrords in visual force page ,can u please provide any sample code for me
It depends on where this serial number comes from. Is it a field on your record, or are you looking to generate this from other data?
i want to generate serial number field on my records
(1) Use the record id as the serial number
(2) Create an autonumber field on the record - you may need to update existing instances with this
Write a wrapper class set an integer property and use that wrapper class varible with your list of records. like below code
public class Wrapper{
public CustomObj__c objCustom {get; set;}
public Integer sNo {get; set;}
public Wrapper(CustomObj__c objP){
this.objCustom = objP;
if(sNo==null){sNo=0;}
sNo++;
}
}
use this sNo varible in the visualforce page the place where you want to display the serial number : in the repeat component
value = {!lstWrapper} var = "lstwrap"
<td>{!lstWrap.sNo}</td>
By
M.Prem