What's the difference b/w next() and hasNext()?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-21-2014 06:53 AM
- 34,846 Views
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-10-2017 02:15 AM
hasNext() : hasNext() method returns true if iterator have more elements.
next() : next() method returns the next element and also moves to the next element.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-11-2022 10:56 PM
may I have any good example related to next() and hasNext()
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-12-2022 06:15 AM
You can check my reply above or take a look at the GlideRecord documentation for examples: next()
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-02-2022 10:16 PM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago
Hey Ravindra,
[a-zA-Z\s] : use this in On-change client script for the Name field.
Also, its not the best practice to limit the name field for below reasons:
1. its a read-only by OOB.
2. In future you might store integration users thier name may include "numbers".
3. Name is auto-populated by First Name & Last Name, you will/have to disturb this logic. (Highly Not Recommended).
NOTE: If my knowledge helped you to learn / understand the waters. Please leave a HELPFUL. thanks !
