How to refresh Data Grid when list type Lookup List and lookup source is SQL with variable filtering
Hello Community,
I have question about Data Grid in the Forms & Process Based app which couldn't solve:
I have Data grid which is List Type and using SQL Lookup Source. In the first section of the Form I am inputting selection which values I use in the SQL where clause like this:
select exampletable.Period__u as Period from exampletable where examplatetable.PlantID__u = ${SelectPlant}
Looks like the Data Grid Lookup Source is triggering when the form loads (and of course not returning values because my variable ${SelectPlant} is null). Is there away to retrigger the Data Grid Lookup Source after I have inputted value to variable? I don't want to use Autolookup which is binded to Data Grid because then I can't control the column (visible, read-only, mandatory etc).

Appreciate all the help,
Juho-Matti
-
Hello Juho-Matti Jaaskelainen,
Yes, you can retrigger the datagrid lookup source using executeLookup helper JavaScript function. Please refer below link to know about the usage. This helper function should be executed on change of ${SelectPlant} variable. I hope this helps.
https://documentation.agilepoint.com/8000/appbuilder/cloudjsExecuteLookup.html -
Hello Juho-Matti Jaaskelainen,
executeLookup helper function will execute the lookup and provides the response in a callback function only. it will not bind the data to the control. So we need to send the response to the control where we want to bind the response using setFieldValue helper method. Please refer below screenshot of the sample code snippet for your use case. I hope this helps for your requirement.
请先登录再写评论。
评论
4 条评论