Pass variable to the Combo box Query Where clause?
I'm trying to find a way to pass a variable from my workflow into the where clause of a Query used for filtering a ComboBox. I already have the value I need to limit the ComboBox by (from elsewhere) in the workflow and it would be nice if I can use that directly without having to create a DataItem List to populate the previous ComboBox to then cascade down and do exactly what I'm wanting to do.
So instead of having FireGUID_FK = '{0}' where {0} is coming from the previous ComboBox I want to be able to do something like FireGUID_FK = FireNameGUID.ToString() where FireNameGUID is a declared Variable in the workflow. I've tried the Where clause with a fixed value and it works fine but using a variable doesn't seem to work. Any ideas?
Thanks,
Mark
-
Hi Mark
have you investigated making use of the Runtime Modifications of a Form?
Regards
Ralph
0 -
Thanks Ralph. Have got it working with a Runtime Modification like you suggested.
0 -
Hi Mark
glad you got it figured. I would have helped of course if you had got stuck ;-)
Thanks
Ralph
0 -
Hi Mark
I also need to find a solution for cascading 3 combobox. Geocortex is not supporting for cascading more than 2 combobox and I need a work arround to this problem. How could you use form value for Where query? Could you please reply with sample code if possible
Many thank
Anjitha
0 -
Hi Anjitha,
Using Runtime you can use variables from your workflow and the cascading ID as you would in the Query details of a Combobox e.g. an Assign like this
form.Find(Of ComboBoxFormItem)("ComboBox1").QueryWhereClause = "FireGUID_FK= '"+ _strFireGUID +"'" + " AND Document_type = '{0}'"
The {0} at the end is the value of the preceding combobox.
0 -
Hi Mark,
thanks for replying to Anjitha. I think he's looking for a way to do a multi-field cascade, where the query updates when you select a value in a previous (upstream) combobox. the runtime modification example only gets updated (executed) when the dialog is created, so it may not be what he is looking for. I've placed an example in this thread - https://support.geocortex.com/SupportForums/Thread.aspx?thread=46438&mid=2&pageid=0&ItemID=20&pagenumber=1#post146331 for everyone to see how Geocortex Essentials does support this concept.
regards,
Edmond
0 -
Hi Edmond,
Thanks for that, very useful to know and a great feature improvement.
Thanks,
Mark0 -
Mark,
I have the same goal to use Runtime to set the query string. I am not successful. Did you have to put any text in place in the 'Where' box section of the Combo Box? I have tried using runtime to set the clause like this: form.Find(Of ComboBoxFormItem)("ComboBox1").QueryWhereClause = "TroopArea = 'A'" and it doesn't work.0 -
This thread made my day. Andrew this answer is obviously way to late but for future searchers. - No text is needed in the "Where" clause in the ComboBox Form Wizard. The Runtime is taking care of that
- Be conciouse of your database (in my case T-SQL): This might be Andrew's issue. My example would be: "STATEABBR = " + "'" + state.ToString() + "' AND TWNSHPNO = '{0}'"
0
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.
Kommentare
9 Kommentare