I m meeting an issue with an OQL querry
here is the context:
using : customized request form plugin
creating a request model
There is a first field named "field1" for the example.
It s a dropdown list, and I want the user to select only a specific ci "myci"
which lead to :
"SELECT myci"
Now, i have another field, name "field2", is a dropdown list, i want it to also list "myci" but without the one selected in the previous field : field1.
"SELECT myci WHERE myci.name NOT LIKE :template->field1"
or
SELECT myci WHERE myci NOT LIKE :template->mod1
but it's not working. I ve tested many other things and i currently don't have a working solution, explaining why i'm calling for your wisdom and intelligence.
Thank you in advance and best regards.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
same as :
SELECT myci WHERE myci.name NOT LIKE":template->field1" lead to the same result
it s not excluding the value selected in field1.
I see several options explaining that:
1)
maybe it s due to the initialisation of the list not refreshing (but then there would be other problems) -low probability
2)
wrong syntax
3)
not possible with OQL
4)
problem around myci.name vs some myci
would it be possible to do the query only on myci or to write :template->field1.name if the fields are comparable.
Thank you for your answer , and others answers in advance.
Best regards
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I was able to make it work with SELECT Contact WHERE name LIKE :template->type
But the field type was a text in which I entered "Ch%"
I was not able to combine the field and a % within the query, that is probably not possible
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I tried your solution and it's not working for me (adapting Contact & type). Moreover it's not a wanted one since the objective is to restrict user input (with a dropdown list from which some choices already selected are excluded).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Here again on the subjet quickly !
lets see the following:
field1:
SELECT myci
field2:
SELECT mycibis where myci= :template->field1
field3:
SELECT myci WHERE myci.name= :template->field1
field4:
SELECT myci WHERE myci.name = mystring
field 1 , 2 and 4 are working as intended. Meaning in field 3 , the issue is with template->field1.
Hello there,
I m meeting an issue with an OQL querry
here is the context:
using : customized request form plugin
creating a request model
There is a first field named "field1" for the example.
It s a dropdown list, and I want the user to select only a specific ci "myci"
which lead to :
"SELECT myci"
Now, i have another field, name "field2", is a dropdown list, i want it to also list "myci" but without the one selected in the previous field : field1.
"SELECT myci WHERE myci.name NOT LIKE :template->field1"
or
SELECT myci WHERE myci NOT LIKE :template->mod1
but it's not working. I ve tested many other things and i currently don't have a working solution, explaining why i'm calling for your wisdom and intelligence.
Thank you in advance and best regards.
Have you tried this:
SELECT myci WHERE myci.name NOT LIKE ":template->field1"
same as :
SELECT myci WHERE myci.name NOT LIKE":template->field1" lead to the same result
it s not excluding the value selected in field1.
I see several options explaining that:
1)
maybe it s due to the initialisation of the list not refreshing (but then there would be other problems) -low probability
2)
wrong syntax
3)
not possible with OQL
4)
problem around myci.name vs some myci
would it be possible to do the query only on myci or to write :template->field1.name if the fields are comparable.
Thank you for your answer , and others answers in advance.
Best regards
I was able to make it work with
SELECT Contact WHERE name LIKE :template->type
But the field type was a text in which I entered "Ch%"
I was not able to combine the field and a % within the query, that is probably not possible
Hi,
thank you again for your answer.
I tried your solution and it's not working for me (adapting Contact & type). Moreover it's not a wanted one since the objective is to restrict user input (with a dropdown list from which some choices already selected are excluded).
Here again on the subjet quickly !
lets see the following:
field1:
SELECT myci
field2:
SELECT mycibis where myci= :template->field1
field3:
SELECT myci WHERE myci.name= :template->field1
field4:
SELECT myci WHERE myci.name = mystring
field 1 , 2 and 4 are working as intended. Meaning in field 3 , the issue is with template->field1.
In the documentation:
https://www.itophub.io/wiki/page?id=extensions%3Arequest-templates
the only indication is:
The OQL can have a parameter in the form :template->code, where code is the code of another field.
After a few test, :template->field1 is the id of the CI. problem solved for me then. Thank you again.
Last edit: benlisle 2022-01-12