Rollbase - Filtering by Formula

Posted by araqiel on 15-Jul-2014 07:24

Hello,

I would like to know if in Filtering of a View, it's possible to input SQL query ?

I try it, but not work : Error: Error in SQL Query ListView=19158 SELECT COUNT(A.OBJ_ID) FROM RB_OBJ_DATA A WHERE A.OBJ_DEF_ID=19114 AND (rbv_api.selectValue("SELECT id FROM frais_collaborateur")) RB_17: Error preparing statement for query SELECT COUNT(A.OBJ_ID) FROM RB_OBJ_DATA A WHERE A.OBJ_DEF_ID=19114 AND (rbv_api.selectValue("SELECT id FROM frais_collaborateur")) [DataDirect][OpenEdge JDBC Driver][OpenEdge] Column "RBV_API.SELECTVALUE" cannot be found or is not specified for query. (13865)


I try with RBV_API.SELECTVALUE and without. Same result. Not working. I would like filter many records by an id of an object.

Thanks for your help.

Posted by Orchid Corpin on 16-Jul-2014 11:53

Hi araquil,

If you are trying to list all records with the filter of a field equivalent to current user all you have to do is type in R17980 = {!#CURR_USER.id} (the field R17980 must be a related field from USER object)
Make sure you are in the same object's list view so you don't have to specify the "SELECT R19060 FROM frais_collaborateurs WHERE" just the WHERE clause value.
In the "Columns" section above it you can specify what field are to be shown in your list view, the field R19060 find the fieldname with this integration code.

Hope this will help.

Regards,
Orchid


All Replies

Posted by pvorobie on 15-Jul-2014 09:59

You should use regular SQL syntax. Do not use JavaScript API in your SQL query.

Posted by Orchid Corpin on 15-Jul-2014 13:12

Hi ARAQIEL,

You can use SQL query, to do that change first the Filter Conditions to "Formula" and you can specify your sql codes in the textarea provided. No need for you to use RBV_API.SELECTVALUE. See image with a sample filter code.

Hope this will help.

Regards,

Orchid

Posted by araqiel on 16-Jul-2014 03:01

Hi,

Thanks for your replies. I see what do you mean.

But in my case I would like use SQL query.

I want a manager see records of his collaborators. For that, I typed the query on 'Test Query' window. I try to input in the Filter Conditions but not work. Will he means to do so?

My query : R19060 = (SELECT R19060 FROM frais_collaborateurs WHERE R17980 = {!#CURR_USER.R12756#id})


And the reply :

Error: Error in SQL Query ListView=19158 SELECT COUNT(A.OBJ_ID) FROM RB_OBJ_DATA A WHERE A.OBJ_DEF_ID=19114 AND (A.INTG4 = (SELECT A.INTG4 FROM frais_collaborateurs WHERE A.INTG3 = 19795)) RB_32: Error preparing statement for query SELECT COUNT(A.OBJ_ID) FROM RB_OBJ_DATA A WHERE A.OBJ_DEF_ID=19114 AND (A.INTG4 = (SELECT A.INTG4 FROM frais_collaborateurs WHERE A.INTG3 = 19795)) [DataDirect][OpenEdge JDBC Driver][OpenEdge] Table/View/Synonym non trouvé. (7519)

 

Thanks,

Posted by Orchid Corpin on 16-Jul-2014 11:53

Hi araquil,

If you are trying to list all records with the filter of a field equivalent to current user all you have to do is type in R17980 = {!#CURR_USER.id} (the field R17980 must be a related field from USER object)
Make sure you are in the same object's list view so you don't have to specify the "SELECT R19060 FROM frais_collaborateurs WHERE" just the WHERE clause value.
In the "Columns" section above it you can specify what field are to be shown in your list view, the field R19060 find the fieldname with this integration code.

Hope this will help.

Regards,
Orchid


This thread is closed