Dear Support,

1.How can i use extra filter condition in form builder?

2. What is the return value when i making a beanshell script in select box, beacuse i use this code : http://dev.joget.org/community/display/KB/Form+Variables

Something changed in v3 scriptting? Because when we were using 2.0.3 it was working.

Thx.

  • No labels

14 Comments

  1. If somebody make an application whice is using Extra Filter Condition, please share at this forum site.

    Thx,

    Miklos

    1. Hi Miklos Daru,

      The "Extra Filter Condition" in "Default Form Options Binder" is actually using HQL (Hibernate Query Language) format. It is quite similar to SQL.

      Below is an example query:

      Let say you want to filter your options to "new" or "rejected" based on a field id called "status", just append the field id with "customProperties." and then write your condition clause. 

      customProperties.status IN ('new','rejected')

      Regards,

      Owen

  2. Hi Owen ,

    Can i know is it hash variable can use in data list extra filter condition ?

    Let say , i want to write condition is list out this user's applications.. So i will need to use HQL like below :
    customProperties.submittedBy LIKE '%#currentUser.lastName#%' ? cheers,

    kienfei

    1. Hi kienfei,

      Yes, you can do that. It is same with the "Extra Filter Condition" in "Default Form Options Binder".

      Regards,

      Owen

  3. Hi, 

    is it possilble to use a Hash variable there ?

    likecustomProperties.id LIKE #form.contacts.name#

    ?
    but for me it looks like it is not possible to use Hash on Application level ?

    cheers
    Ralf

    1. Hi Ralf,

      Yes, it is possible. It depends on the scope on where you access it.

      For instance, in your case, if you are at the list level, you can't possibly use the form hash variable because there's no pointer set to the form data.

      One good example to use hash variable in the JDBC Datalist Binder (Custom SQL Queries) binder in Datalist would be on storing the DB access parameter (JDBC path, username, etc) as Application level environment Hash Variable (See Hash Variables).

      Hope this helps.


  4. Hi Hugo,
    I tried it on form level, not list.

    Edit Select Box > Choose Options Binder > Select Form > Choose Validator > Workflow Variables

    Extra Filter Condition : likecustomProperties.id LIKE #form.contacts.name#

    also if I try to use #form.contacts.name#  in a form it doesen't give a value back... it shows #form.contacts.name#

    any idea what I do wrong ?
    cheers
    Ralf

    1. Hi Ralf,

      I think the form hash does not work inside the Options Binder. As a workaround, try Dynamic Cascading Drop-Down List. Hope this helps!

      1. but I think it is not in the release yet or ?

        but in the form itself it should work ?

        1. Hi Ralf,

          This feature is implemented in revision 338 and above. You may need to build it yourself as there's no new version release yet. Thanks.

  5. how can i put two extra filter condition? example: customProperties.department_id IN ('ICT') and

    customProperties.field4 IN ('approved')

    1. I have the same question. No reply?

      1. Hi Dinx and marimo,

        Dinx had the right answer. You can using "and" or "or" to add more filter condition just like normal query.

        Example:

        customProperties.department_id IN ('ICT') AND customProperties.field4 IN ('approved', 'new')
        customProperties.department_id IN ('ICT') AND (customProperties.field4 = 'approved' OR customProperties.field4 = 'new')

        Hope this is help :)

        1. Thanks Owen Ong, its really help.. Really thanks for you reply.