[ic] lookup_query in table editor

Scott Andreas scott at tildaworks.com
Tue Apr 13 03:49:20 UTC 2021


Hello All

I have a lookup query that I am trying to add into table-editor
here is my query:
[perl tables=products interpolate=1]
my ($ary,$index_hash,$name_ary) = $Db{product_codes}->query("SELECT
distinct category FROM products_codes WHERE owner = '[data session
username]' ORDER BY category ASC");
$Tmp->{category} = {
mv_results => $ary,
mv_field_names => $name_ary,
};
return;
[/perl][loop object=`$Tmp->{category}` prefix=cat]
[cat-code]
[/loop]
 I can loop the results as expected with [loop object=`$Tmp->{category}`
prefix=cat]
[cat-code]
[/loop]
But adding the resultant set into table editor I am having issues with
[table-editor
auto_secure=1
form_name=item_editor
mv_data_table=products_code
    widget.category=combo
    filter.category=nullselect
    override.category=|[loop object=`$Tmp->{category}`
prefix=cat][cat-code][/loop]|
override.owner=`$Session->{username}`
hidden.owner=`$Session->{username}`
override.company=`$Values->{company}`
    hidden.company=`$Values->{company}`
]

I've even tried using: lookup_query.category=`select distinct category from
products_codes where owner='$Session->{username}'`

If I try lookup_query.category=`select distinct category from
products_codes where owner='bob'`
the list populates

I am on IC 5.12
i am sure the issue is with interpolation but getting the list to show up
correctly I am having a bugger of a time trying fo figure out.

Any direction would be helpful

Thank you


-- 
J. Scott Andreas
Ph:541-729-6090
email: scott at tildaworks.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.interchangecommerce.org/pipermail/interchange-users/attachments/20210412/bf6327b0/attachment.htm>


More information about the interchange-users mailing list