- 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 02:39 PM
Hi Jose,
Should that be
var caller = gr.caller_id.getRefRecord();
?
Best Regards
Tony
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-09-2015 04:21 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-09-2015 02:42 PM
Refer section 3.30 , might be helpful
GlideElement - ServiceNow Wiki
Should be:
var caller = gr.caller_id.getRefRecord();
Suraj Chauhan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-09-2015 04:19 PM