Skip to main content

Pass variable to the Combo box Query Where clause?

Comments

9 comments

  • Permanently deleted user

    Hi Mark

    have you investigated making use of the Runtime Modifications of a Form?

    Regards

    Ralph

    0
  • Permanently deleted user

    Thanks Ralph. Have got it working with a Runtime Modification like you suggested.

    0
  • Permanently deleted user

    Hi Mark

    glad you got it figured. I would have helped of course if you had got stuck ;-)

    Thanks

    Ralph

    0
  • Permanently deleted user

    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
  • Permanently deleted user

    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
  • Permanently deleted user

    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
  • Permanently deleted user

    Hi Edmond,

    Thanks for that, very useful to know and a great feature improvement.

    Thanks,

     

    Mark
    0
  • Permanently deleted user
    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
  • Permanently deleted user
    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

Please sign in to leave a comment.