NamedQuery Update Needed

Hey Team,

One more today. I have created a named query that I would like the WHERE a.sku field to pull the SKU number from a textfield in the same root container.

SELECT a.sku, a.lpn, a.lot_number, CONCAT(CAST(b.pos_a as CHAR),' ', CAST(b.pos_r as CHAR),' ',CAST(b.pos_xf as CHAR),' ',CAST(b.pos_xp as CHAR),' ',CAST(b.pos_y as CHAR),' ',CAST(b.pos_z as CHAR)) as "BinLoc",
       a.quantity, b.row_locked
FROM pallets a
INNER JOIN dambach_xref b
ON a.dambach_xref_id = b.id or a.dambach_xref_id2 = b.id
WHERE a.sku = '{../TextField.props.text}'

This is what I need it to look like.

Here is my namedquery. I have tested the query and it will return the correct that when I substitute a valid SKU in place of the WHERE a.sku = ‘01037’

Here is the template I built that I am trying for the table to pull the SKU # from the textfield.

You need to use a parameter to pass the SKU to the named query.

Question, once I add the SKU to the view.params would this be correct in the named query?

If so, once it is there how do I get the table to refresh with the updated SKU information?

SOrry for all the questions.

No, your query will be something like this:

SELECT a.sku, a.lpn, a.lot_number, CONCAT(CAST(b.pos_a as CHAR),' ', CAST(b.pos_r as CHAR),' ',CAST(b.pos_xf as CHAR),' ',CAST(b.pos_xp as CHAR),' ',CAST(b.pos_y as CHAR),' ',CAST(b.pos_z as CHAR)) as "BinLoc",
       a.quantity, b.row_locked
FROM pallets a
INNER JOIN dambach_xref b
ON a.dambach_xref_id = b.id or a.dambach_xref_id2 = b.id
WHERE a.sku = :SKUparam

You will need to assign a value to the parameter in your named query binding. I think it will refresh when your sku is updated.

@ahawes, just a tip. Post code (using the </> code formatting button) rather than pictures of code (or as well as screen grabs if you need to give context). @josborn had to type the whole thing out from your screengrab whereas it would have been a copy and paste if you had posted the code.

To be fair they did both, i copied and pasted.