
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2019 08:14 AM
Hello All,
We have two fields called "u_name" and "u_expiry_date" in the "ast_contract" table. This table is user in a Catalog Item variable. There is a field which is referencing the ast_contract table in one of the questions of the Ctalog item. I want to display the fields "u_name" and "u_expiry_date" over there and not the default number field which is being shown.
Please see attached screenshots for the same.
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-26-2019 03:52 AM
The picture shows that you have typing error in attributes.
ref_ac_columns1=u_name
to
ref_ac_columns=u_name

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2019 08:28 AM
Hi Arindam,
There could be only one display value defined for a given table but you can search on different columns by setting ref_ac_columns_search attribute to true (which I think you already have defined)
-Pradeep Sharma
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-26-2019 03:52 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-26-2019 04:08 AM
Hello,
Tried correcting it but still it is not working. Please help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-26-2019 07:49 AM
Sorry, I din't mention that before. You made one more error. The settings are attributes and not reference qualifier. Moreover, one can set attributes only on a field (column) of the table and not on a variable of catalog item.
Nevertheless I analysed the problem more deep, found the old answer, which don't work now directly, but I could modify the code to the following, which works at me:
function onLoad () {
function setAJAXTableCompleter (table, variableName, columns, orderBy) {
try {
var control = g_form.getControl(variableName);
var ref = control != null ? g_form.getElement("sys_display." + control.id) : null;
if (ref != null) {
ref.onfocus = function () {
if (!this.ac) {
this.ac = new AJAXTableCompleter(this, control.id, "", "", table);
this.ac.setAdditionalValue("ac_columns", columns);
this.ac.setAdditionalValue("ac_order_by", orderBy);
// this.ac.max = 10; // display max 10 items }
};
}
} catch (err) {}
}
setAJAXTableCompleter("ast_contract", "contract", "short_description", "number");
}
The above code is onLoad Catalog Client Script. The name on the variable on the catalog item in my test was "contract" (see the second parameter of setAJAXTableCompleter function). I wanted to display display "short_description" as the second column and to sort the results by "number" columns. The results look like on the picture below
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-26-2019 10:27 AM
ps you will notice when using a reference qualifier like this with extra columns, when you select an entry it will only select the default column. So if you made it searchable on all columns it could help to choose to add an extra field to show the other data in of the selection. Meaning, if you can search on a, b and c, and the user looks for b, then a will be displayed (if a would be the default), so perhaps with some scripting add the option to also show b and c in an extra field, could make sense sometimes.
Good luck, regards!