You need to sign in to do that
Don't have an account?
Devendra@SFDC
How to Identify First Element of list
Hi,
How to identify first element in list?
For e.g.
for(Schedule_Task__c st:lstScheduleTask)
{
if(lstScheduleTask==0) // Is there any way to find out this is first element.
{
//
}
else
{
//
}
}
Thanks and Regards,
Devendra S
Hi,
will get you the first item out of the list - no need to do a for{} loop. Then just do your comparison on this object.
R.
All Answers
Hi,
will get you the first item out of the list - no need to do a for{} loop. Then just do your comparison on this object.
R.
Richie is correct.
but before this line please check if list is not null and size is gretter than 0, else it will throw error "list index out of bound"
Regards,
Pankaj Raijade
Thanks to both of you.
Cheers,
Devendra S