Hi Folks - I need to refresh the contents of a valuelist after the table on which its based is changed in code.
This is a standard (not custom) valuelist and I figured controller.relookup() would do it but not so, nor upDateUI().
Is there a way to refresh this VL without going to the extent of creating it as a custom VL?
EDIT: Part of this looks like the rawSQL Flush I am running after data update is not being properly applied. The problem is a little bigger than I thought. After the rawSQL update and Flush, the data in the client is not fully changed. For example if I set baseYearTo to 2012 from 2025, and then after the flush, do a find and search on baseYearTo = 2012 I get zero returned rows. on closing and reopening the Client I get the correct result.
Here is the code I’m unning to update the column:
var recordsToReset = "UPDATE fabric_condition SET fc_base_year1 = " + baseYearTo + " where fc_base_year1 = "+restBaseYearFrom
//application.output(recordsToReset)
var success = plugins.rawSQL.executeSQL(globals.vServerToUse,'fabric_condition',recordsToReset,null)
application.output('Success ' + success)
if(success)(plugins.rawSQL.flushAllClientsCache(globals.vServerToUse,'fabric_condition'))
It seems that the database table fabric_condition is not being refreshed with the plugins.rawSQL.flushAllClientsCache(globals.vServerToUse,‘fabric_condition’).
Kahuna:
For example if I set baseYearTo to 2012 from 2025, and then after the flush, do a find and search on baseYearTo = 2012 I get zero returned rows. on closing and reopening the Client I get the correct result.
Apart from the fact that the flush should do what you’d like it to do:
why don’t you use the foundsetUpdater from within Servoy to do this?
This will generate the sql like you did and does the default databroadCasting as when you’d change the values by hand.
In any way it’s a less expensive operation than the flush you do now (and doesn’t work either)
Kahuna:
For example if I set baseYearTo to 2012 from 2025, and then after the flush, do a find and search on baseYearTo = 2012 I get zero returned rows. on closing and reopening the Client I get the correct result.
Apart from the fact that the flush should do what you’d like it to do:
why don’t you use the foundsetUpdater from within Servoy to do this?
This will generate the sql like you did and does the default databroadCasting as when you’d change the values by hand.
In any way it’s a less expensive operation than the flush you do now (and doesn’t work either)
Marc to the resue again …
Thanks Bud, using the foundsetUpdater seems like a workaround in this context and the flush should be doing what it needs to.
In the meantime I’ll have to take the foundsetUpdater route until someone can suggest a possible cause for this?
Have you (or any other developers reading this) had the situation where the flush dose not work>
lwjwillemsen:
Att. ! When Servoy logging for that table is enabled the foundSetUpdater falls back to row by row processing => bad performance…
Regards,
Yes thanks for that Lambert - fortunately I’m not using logging on that table but unfortunately I’m struggling with how to use either straight SQL or my dataset in the foundsetUpdater call?
The row by row update is drastically slow so need the SQL for sure to limit the rows AND reduce execution time.