Dear support,
I have a query which is also asking for data in a related object:
BO: user
Name
Surename
Country (Relation to countries)
BO countries
Name
Currency
Now I built a query which is asking for attributes at runtime:
Name
Countries.Name
But only name is shown in the query mask.
Question:
Is it not possible to use related data in a query and ask for specification at runtime?
Best regards,
Peter
related data in query not asked
-
- Posts: 595
- Joined: Sun Apr 24, 2005 2:22 am
- Contact:
Hi Peter,
Yes, it is definitely possible to use related data in a query and ask for search parameters at run time. Your customer query in the rule form may look like this:
FIND Customer WHERE Customer.Name CONTAINS ?'Customer Name' AND Customer.Country.Name CONTAINS ?Country
You can switch between the Rule Form and the Simple Form of the query by clicking on the corresponding tab at the bottom of the query editor.
When the query is run, the system will show two text boxes where the user can enter search parameters. The first will have label Customer Name, the second - Country.
Please see query Product in the Ordering sample application for an example.
Yes, it is definitely possible to use related data in a query and ask for search parameters at run time. Your customer query in the rule form may look like this:
FIND Customer WHERE Customer.Name CONTAINS ?'Customer Name' AND Customer.Country.Name CONTAINS ?Country
You can switch between the Rule Form and the Simple Form of the query by clicking on the corresponding tab at the bottom of the query editor.
When the query is run, the system will show two text boxes where the user can enter search parameters. The first will have label Customer Name, the second - Country.
Please see query Product in the Ordering sample application for an example.
Aware IM Support Team
Hi Support,
my query looks like this:
FIND People WHERE People.Name CONTAINS ?Name AND People.Surename CONTAINS ?Surename AND People.Company.Name CONTAINS ?Name
Sorry, this is from my real application cause I deleted the small example already.
Well... I see during query runtime only the fields for Name and Surename..
I seems I am doing a general mistake...
Best regards,
Peter
my query looks like this:
FIND People WHERE People.Name CONTAINS ?Name AND People.Surename CONTAINS ?Surename AND People.Company.Name CONTAINS ?Name
Sorry, this is from my real application cause I deleted the small example already.
Well... I see during query runtime only the fields for Name and Surename..
I seems I am doing a general mistake...
Best regards,
Peter
Hi Support,
I found it.......
After reading the query it was clear to me that the issue is that in several BO's there is the same attribute name here: name (you can also see it in the query)
It seems that the application can not handle this.....
After I changed the attribute name I had to re-build the queries and it worked. Changing the name alone does not help as it seems the queries are not rebuild accordingly.
SOLVED.
Best regards,
Peter
I found it.......
After reading the query it was clear to me that the issue is that in several BO's there is the same attribute name here: name (you can also see it in the query)
It seems that the application can not handle this.....
After I changed the attribute name I had to re-build the queries and it worked. Changing the name alone does not help as it seems the queries are not rebuild accordingly.
SOLVED.
Best regards,
Peter
-
- Posts: 595
- Joined: Sun Apr 24, 2005 2:22 am
- Contact:
Hi Peter,
> It seems that the application can not handle this.....
This is done on purpose. If the system detects the same label used for different parameters in a query, it will display only one box with this label, but use the value the user enters into it for both parameters in the query. This way the user does not have to enter the same value twice if he wants to search for it in different attributes. For example, below is query "Item using single parameter" from the Library sample application:
FIND Item WHERE Item.Title CONTAINS ?Parameter OR Item.Author CONTAINS ?Parameter OR Item.Code CONTAINS ?Parameter ORDER BY Item.Title
The system will show only one box but will use the user-entered text to search for it in several attributes.
In your case this happened by chance because two attributes had the same name. To get the system show separate boxes when asking for query parameters, you do not need to change attribute names or rebuild queries. All you need to do is to switch to the Rule Form and change the label after "?", for example:
FIND People WHERE People.Name CONTAINS ?Name AND People.Surename CONTAINS ?Surename AND People.Company.Name CONTAINS ?Company
> It seems that the application can not handle this.....
This is done on purpose. If the system detects the same label used for different parameters in a query, it will display only one box with this label, but use the value the user enters into it for both parameters in the query. This way the user does not have to enter the same value twice if he wants to search for it in different attributes. For example, below is query "Item using single parameter" from the Library sample application:
FIND Item WHERE Item.Title CONTAINS ?Parameter OR Item.Author CONTAINS ?Parameter OR Item.Code CONTAINS ?Parameter ORDER BY Item.Title
The system will show only one box but will use the user-entered text to search for it in several attributes.
In your case this happened by chance because two attributes had the same name. To get the system show separate boxes when asking for query parameters, you do not need to change attribute names or rebuild queries. All you need to do is to switch to the Rule Form and change the label after "?", for example:
FIND People WHERE People.Name CONTAINS ?Name AND People.Surename CONTAINS ?Surename AND People.Company.Name CONTAINS ?Company
Aware IM Support Team