Hi,
This is my first post on this site. I have been designing forms in infopath for about 18 months and have found this site incredibly valuable when I had questions in the past. I have not been able to find any info on how to do what I am trying to do without code, which I am very sure could be done, but I would prefer not to use code or manually set filters in the data source dialogs. (when using code I use VB or JScript.. fyi)
I am creating a form that will permit our salespeople to quote our customers. When quoting this particular class of product, we only permit one of these products to be quoted per form.
Short Question: What i want to do is take the text value of a listbox control, concat it with another string and match that value to a column name to find the boolean value(s) in that column = TRUE
Long Question:
- I have a dropdown listbox listing the products available in this quote. this control is named PRODUCTS and it has 3 items whose names & values are: 'Product1', 'Product2', and 'Product3'
- I have a database in Access (I may convert it into a MS SQL 2005 db)
- This db has multiple tables, each table acts as a logical grouping of available components for all three products. eg: a table named 'Valves' that has 10 rows in it. Some valves are used by Product1, some are used by Product2, some are used by Product3 or any combination of any or all of them.
- Each table has 3 indexed, boolean columns. for purposes of this post they are named: 'Product1_avail', 'Product2_avail', and 'Product3_avail'. If a component in the table has a TRUE value in one of these columns, it is a component that can be added to that particular product chosen in the 1st
- What I want to do is take the text value from the listbox (lets say Product1) and perform concat(./PRODUCTS, "_avail"), the result of which would correspond to a column name. in this case, 'Product1_avail'.
- Then take that string value to choose the corresponding data column and return all rows whose values in that column which are marked as TRUE
- So, the XPath would look something like this (i believe): ../@(concat(xdXDocument:get-DOM()/my:myFields/my:PRODUCTS/text(), "_avail")) = "TRUE" I know that ' ../@(concat ' is not valid XPath. I'm looking for a solution that is valid XPath.
Is there a non-code solution using only XPath expressions?
If you need more info, please post your requests.
Thanks A Lot!