Passing sys_id into on demand script include
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-11-2024 09:43 AM
Okay. I am trying to add two reference qualifiers to two fields on a custom SN table. I wrote two on demand script includes using GlideQuery to obtain the sys_ids from those tables and push them into an array. I have confirmed using background scripts that the script includes are, indeed, pulling the records I want them to pull and push into the array. So with the fields not displaying the correct, or in some cases any, records when i click to search means that there is an issue with the code i am using to call the function. I suspect that i am not passing in the sys_id for the current record into the script include when called, but i am not seeing a way to test that.
Both fields are on a form that has an associated ID, which is a reference field. When someone updates the record and clicks on field A, I only want them to be presented with records associated with that same ID from the secondary table. The ID field is also a reference field on the second table.
Right now, this is what I have in the ref qual field in the field properties
javascript: 'sys_idIN' new script_include_name(current.sys_id);
I have tried countless other variations and even reviewed what others have done for previous ref quals. It appears no one has done specifically what I am trying to do nor has any of their examples worked.
Any assistance is appreciated and thanks in advance!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-11-2024 12:17 PM - edited ‎04-11-2024 12:29 PM
Shouldn't it be javascript: new script_include_name().refQualMatchingIsas(current.sys_id). To call something from a script include don't you need the scrip include name and the specific function you are calling within the script include.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-11-2024 12:54 PM
Not for an "on demand" or "classless" Script Include, which the op mentioned in the original question.
They are like the old/ancient "global" Business Rules.