- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-17-2021 02:26 AM
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()
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-17-2021 02:59 AM
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
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-17-2021 02:37 AM
Hi,
since you want to update the records you can use next() method
next() - goes to every record
hasNext() - tells whether there is record satisfying the query
_next() - used when your table field/column name as "name"
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-17-2021 02:48 AM
Hi Ankur,
at script side, what case we use hasNext();?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-17-2021 02:59 AM
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
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-17-2021 04:00 AM
Hi Ankur,
Kindly help me for understanding.
if there is an single record in whole table , then can we update that record using with hasNext() in script side.