Parameters to use with reflistOpen?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-10-2013 09:47 AM
Hi,
would anyone know what the parameters are that can be used with reflistOpen()?
cheers
- Labels:
-
Orchestration (ITOM)
-
Service Mapping
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-10-2013 10:26 AM
I'm pasting the entire function for you :
function reflistOpen(target, elementName, refTableName, dependent, useQBE, refQualElements, additionalQual){
var url = reflistOpenUrl(target, target, elementName, refTableName, dependent, useQBE, refQualElements, additionalQual);
popupOpenStandard(url, "lookup");
}
code of reflistOpenUrl:
function reflistOpenUrl(target, targetElementID, elementName, refTableName, dependent, useQBE, refQualElements, additionalQual) {
var url;
if (useQBE == 'true')
url = new GlideURL(refTableName + '_search.do');
else
url = new GlideURL(refTableName + '_list.do');
url.addParam("sysparm_target", target);
var et = gel(targetElementID);
if (et)
url.addParam("sysparm_target_value", et.value);
var dspEl = gel("sys_display." + targetElementID);
if (dspEl && !et.value)
url.addParam("sysparm_reference_value", dspEl.value);
url.addParam("sysparm_nameofstack", "reflist");
url.addParam("sysparm_clear_stack", "true");
url.addParam("sysparm_element", elementName);
url.addParam("sysparm_reference", refTableName);
url.addParam("sysparm_view", "sys_ref_list");
url.addParam("sysparm_additional_qual", additionalQual);
var v = getDependentValue(target, dependent);
if (v != null)
url.addParam("sysparm_dependent", v);
var refQual = getRefQualURI(target, refQualElements);
return url.getURL() + refQual;
}
Also there is one more _refListOpen with a capital L, which is meant to be a private method( but private methods are not supported in JS anyway, so you can use it too)
_refListOpen: function(evt) {
var te = this.tableElement;
this._setDependent();
var url = reflistOpenUrl(this.refName, this.id, te.getName(), te.getReference());
for (var n in this.additionalValues)
url += "&" + n + "=" + encodeText(this.additionalValues[n]);
if (this.dependentInput)
url += "&sysparm_dependent=" + escape(this.dependentInput.value);
popupOpenStandard(url, "lookup");
return false;
}
http://www.servicenowguru.com/system-definition/advanced-templates/ : Search for reflistOpen, You will find its usage in a script.
Hope this helps!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-16-2017 09:08 AM
This was super helpful. You can create so many unique buttons using these functions. I have many use cases for custom applications where a normal SN form is not used, but the user must pick a record from a list.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-19-2019 07:08 AM
"I know this post is from 6 years ago, but hoping someone can shed some light on this - I tried hardcoding the sysid of a group in the dependent parameter in the reflistOpen and it does not seem to work, has anyone been able to successfully use the "dependent" parameter here:
function reflistOpen(target, elementName, refTableName, dependent, useQBE, refQualElements, additionalQual)
The problem I have is that the sysids that I return from a script include in the additionaQual parameter is too long and is not supported by the browser, when I try the OOB assigned to field and look at the url the sysparm_dependent field is being populated with the sysid of the assignment group, trying to replicate something similar in aUI page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-10-2013 11:06 AM
Thank you Abhiram.