Dear All,
I have a table Order with field OrderNumber (integer)
i'm trying create form with table display and field OrderNumber for filter
when OrderNumber = Blank/Null, table will display all order and if OrderNumber not blank then filter as ordernumber entry
I have succes for character type of field using "%" but not for integer, please help me
Regards
Juned
Fetch table using blank Query for integer
Moderators: Jon, Steve, Ian, Dave
-
- Ebase User
- Posts: 35
- Joined: Mon Jul 14, 2014 11:55 pm
-
- Moderator
- Posts: 1342
- Joined: Wed Sep 12, 2007 12:49 pm
You can do this by constructing the entire SQL where clause in code. It will be something like this:
In your Database Resource, add a resource field named for example WC by clicking the + button in the Resource fields panel. Make sure to uncheck the Persistent checkbox (most important).
Then in the Where clause box enter &&WC.
In your form create a new form field WC, then bring up the resource fields mapping panel by clicking the icon on the main toolbar for the form editor. Map the resource field WC to form field WC.
Then in the script where you are loading the table, you now need to set the WC variable to contain the appropriate SQL. Something like this (using Javascript):
Here's a link to the documentation that explains how to do this http://dev-docs.verj.io/ufs/doc/Databas ... c309125520. If you're concerned about the possibility of hackers attempting to use SQL injection, you should use the alternative technique described in the documentation which prevents against this.
In your Database Resource, add a resource field named for example WC by clicking the + button in the Resource fields panel. Make sure to uncheck the Persistent checkbox (most important).
Then in the Where clause box enter &&WC.
In your form create a new form field WC, then bring up the resource fields mapping panel by clicking the icon on the main toolbar for the form editor. Map the resource field WC to form field WC.
Then in the script where you are loading the table, you now need to set the WC variable to contain the appropriate SQL. Something like this (using Javascript):
Code: Select all
if (fields.ORDER_NO.value)
{
fields.WC.value = "order_no= " + fields.ORDER_NO.value; // filter by order number
}
else
{
fields.WC.value = "1=1"; // show all orders
}
0 x
-
- Ebase User
- Posts: 35
- Joined: Mon Jul 14, 2014 11:55 pm
Who is online
Users browsing this forum: No registered users and 25 guests