Not able to query the 'Item Produced Records (sc_item_produced_record)' table in Script include.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2024 04:33 AM
I am trying to query the table 'Item Produced Records (sc_item_produced_record)' in script include. I want the record producer name from the incident sysid. I wrote the below code. Here 'case_numb' is having incident sysid. But it is not going inside if loop.
But if i am hardcoding the sysid it is working fine
Can anyone help in it.
Thanks is Advance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2024 04:48 AM
Is 'case_numb' passed into the Script Include function as an argument, or where is this defined / coming from? Have you logged 'case_numb' prior to this portion of the script to ensure it contains the expected sys_id value?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2024 05:01 AM
Yes it is coming as an argument and i have checked by adding logs and the value is coming correctly. The same 'case_numb' i am using in the same function for Gliding another table and in that it is working fine.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2024 05:31 AM
That is odd. Is the other usage of case_numb in this function before or after this one? Is it also used on a field that is a reference to the task table? Did you log it directly before this GlideRecord? Maybe try
item_name.addQuery('task', case_numb.toString());
in case it's coming in with a different type somehow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2024 07:08 AM