
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-21-2019 12:25 AM
Hi guys,
I need an help for configuring the Advanced Reference Qualifier in the right way.
In the Time Worker table, I've created a Reference custom field "Account_ref" to the customer_account table.
I would like to fill this field automatically with the account of the selected task, I tried dding with the following Advanced Reference Qualifier...no luck.
javascript:'account='+current.task;
Thanks for your help!!!
Solved! Go to Solution.
- Labels:
-
Best Practices
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-22-2019 12:27 AM
Hi Alberto,
I replicated your config and figured out the issue, real rookie error for which i accept full responsibility 🙂
The function call in the getXMLAnswer() line is in quotes, it shouldn't be! use this:
//client script
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
var ga = new GlideAjax('TestScriptInclude');
ga.addParam('sysparm_name', 'testFunction');
ga.addParam('sysparm_task', g_form.getValue('task'));
ga.getXMLAnswer(getAjaxData);
function getAjaxData(response){
g_form.setValue('u_account_ref', response);
}
}
EDIT: Just noticed Harsh has already picked this up!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-21-2019 06:38 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-21-2019 10:31 PM
can you please confirm the client script and script include has been written in global scope ?
also please share the screenshot of your client script and script include.
also in your client script replace the getXML() to getXMLAnswer().
validate again and see are you getting the same error.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-21-2019 11:58 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-22-2019 12:10 AM
Hi Alberto,
If you use getXMLAnswer() you don't have to use var answer = response.responseXML etc etc line (it does that for you which is why i always use it over getXML()).
if you just write below for your getAjaxData function what does the alert show?
function getAjaxData(response){
alert('this is the response: ' + response);
}
cheers
Dave

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-22-2019 01:40 AM