So, I have a table in a popup which is supposed to receive the results of a named query, written on startup. I’m receiving an empty dataset but on testing the named query, it runs perfectly. Tried the query binding method, which also worked perfectly but on table’s onStartup, the below script is running but the dataset being returned is empty. Am I missing something?
I believe if you turn this logger (it may be a different named query logger hopefully someone knows which) to debug, you will see the named query calls and it’s params logged to the gateway. I would start there to confirm that your parameters are exactly as you expect, there’s no hidden white spaces etc.
Edit: Wait I see this is on a runAction script? Show what extension function/setup you are using exatly here. Not to mention it seems like you are just doing a named query with a param - I don’t see why you shouldn’t do a named query binding on the data property. You can use trim() in an expression to do the same thing as .strip()
i’m not going the binding way because i need to update the table on click of a button. so adding a binding would just keep rebinding the table with the dataset.
If it’s on button press then doing this on start up makes no sense anyways regardless of the fact that it’s now working now.
What you should do if you want it like this - on button press -
Get the params (PartNumAssemblyCode.strip())
Run the named query
Assign the result to the table data prop.
I wouldn’t do anything in your onStartUp.
Make the table props.data a named query with a hard coded '’ param (or a param that would yield all rows if that’s reasonable I am guessin you are using a LIKE query), and put polling on 0 - so it loads up when the pages loads but is not refreshing.
If you need it to load with a certain subset/param for the NQ but then still only change on button press, make an additional custom proprety initialNQParam that calculates the param you should use for when the table first starts and use that in your named query binding - but keep polling 0 and make initialNQParam static (maybe its a view param or an expression that is non-changing). Then your button press logic handles all subsequent updates.