When do we use next(), hasNext() and _next()

chanikya
Kilo Sage

Hi All,

I have 10 records only on whole table , now I want to update records So 

When do we use next(), hasNext() and _next()

1 ACCEPTED SOLUTION

Hi,

just to check if there is any record satisfying the query

hasNext() - does not actually go to that record but just tells true/false is there is any record matching the query

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

25 REPLIES 25

Community Alums
Not applicable

1. next() is used to get the next record in the GlideRecord.

2. hasNext() check the next record and return true/false.

3. _next() is used where the table already has a column name as next.