What's the difference b/w next() and hasNext()?

jamesgo
Giga Contributor

if the query has only one match, will hasNext() return true?

7 REPLIES 7

may I have any good example related to next() and hasNext()

You can check my reply above or take a look at the GlideRecord documentation for examples: next() 

Ravindra Swami
Tera Contributor

I am a learner on service now and i want to set a regex on name field. please help me in this case

condition is that you should not enter any other character rather than a-z, A-Z and space only