PDA

View Full Version : Set Filter from picklist using rsp file



paudiewalsh
2020-08-13, 11:08
Hi
I am trying to set a filter to Vendor on a product file using an rsp file to list the available vendors.

I have created an rsp file and I am able to generate a Dialogpanel with a list of vendors , using
open database essdata
Select vendor from webprod_add order by 1 group by 1 into cursor cVendor
select cVendor
list html off fields vendor;
onclick "vendor","filtervendor('{}')"

However I am unable to apply the filter to the section. I tried using both the field name and a vendor name, with no luck.

Javascript code in the rsp file.
function filtervendor(vendor)
{
Lianja.showDocument("page:page1");
//Lianja.showDocument("section:webprod?action=filter&text = startswith(vendor,'LILLY')");
Lianja.showDocument("section:webprod?action=filter&text = startswith(vendor,'{vendor}')");
Lianja.hideDialogPanel();
};
}

Any help will be appreciated
Paudie

yvonne.milne
2020-08-13, 11:43
Hi Paudie,

Try this:


Lianja.showDocument("section:webprod?action=filter&text=startswith(vendor,'"+vendor+"')");

Regards,

Yvonne