- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-09-2015 02:32 PM
Hello can someone explain me whats wrong here?? why it says it is a null field! It shouldnt! I mean I have lots of incidents with a caller Id!! thank you very much guys!
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-09-2015 09:40 PM
jajajaja LOL I just realized something! I got the null because of the "if", as we all of us know "if" will only search forward for the first record LOL here is my problem! Deepak Ingale and Michael Fry are both quite right!! I used the while loop and then I just found this first record a null one, so this was the cheater one that was showing up before!!
Now I want to highlight something! maybe it could even be worth of putting it on another discussion!! why are these null boys coming out?? if I just copied the script of servicenow wiki and in the scripting was a notNull! well check this out! there is some kinda of mistake in the wiki!!
well this is the mistake!, it is not: notNullQuery() instead should be: addNotNullQuery() , so if you use this last script it will work!
But guys actually there is something weird here! maybe some one with more experience could correct me if there is not such a weird thing! so far for me it is! look at this! if you use in this same code(well the only thing I actually changed was the loop I used a "while" one), if you instead use a simple addQuery() It returns only the NULL records! why?? you may ask to some else! cause I dont know! the good point here is that in most of the cases it is supposed that a null record here is useless for us! so we can use addNotNullQuery() but any ways I just let you use this with precaution!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-09-2015 07:41 PM
Hi Jose,
Please check the caller record if that has FirstName and LastName set.
name is dependant of firstname and lastname
if both are blank, name would be blank.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-09-2015 09:45 PM
Thanks for helping! check out the ultimate answer I wrote for this case! thank very much!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-09-2015 05:53 PM
I think the if line should be a while. So this:
while (grINC.next()) {
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-09-2015 09:40 PM
jajajaja LOL I just realized something! I got the null because of the "if", as we all of us know "if" will only search forward for the first record LOL here is my problem! Deepak Ingale and Michael Fry are both quite right!! I used the while loop and then I just found this first record a null one, so this was the cheater one that was showing up before!!
Now I want to highlight something! maybe it could even be worth of putting it on another discussion!! why are these null boys coming out?? if I just copied the script of servicenow wiki and in the scripting was a notNull! well check this out! there is some kinda of mistake in the wiki!!
well this is the mistake!, it is not: notNullQuery() instead should be: addNotNullQuery() , so if you use this last script it will work!
But guys actually there is something weird here! maybe some one with more experience could correct me if there is not such a weird thing! so far for me it is! look at this! if you use in this same code(well the only thing I actually changed was the loop I used a "while" one), if you instead use a simple addQuery() It returns only the NULL records! why?? you may ask to some else! cause I dont know! the good point here is that in most of the cases it is supposed that a null record here is useless for us! so we can use addNotNullQuery() but any ways I just let you use this with precaution!