
- 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 12:38 AM
in which column it hold the value (current.task) in account table.
eg: as you had mentioned current.task , so in account table did you store the value on "account" column ?
please confirm the column name.

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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-21-2019 01:00 AM
I believe current.task will give you the sysid of the value which has been selected on column "Task" (Time Worked Table).
now you want to get list of account which has the task sys id match with account column value ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-21-2019 01:03 AM
An advanced reference qualifier won't populate the field, it will just filter the results when the reference field is opened up.
In this case you're referencing the customer_account field but there is no reference to the current task on that form.
To populate the field automatically could write a script to pick out the account from the task referenced on the time worked form and populate it in your custom field but it might be easier just to extend the field from the task form, you can do that in the form layout editing.