Dynamic OQL

0
Hi Team, Is it possible to write a dynamic OQL query? My requirement is to get details from an entity using OQL query, but the entity will be selected by the user at run time. I have to pass the entity name selected by the user to the OQL query and return the corresponding results. I s it possible?   Regards, Megha
asked
3 answers
1

Hi Megha,

Yes this is possible. 

You would create the OQL query in a string variable and add the entity as a variable in the OQL query. 

For example: 

'SELECT table.field AS field1 
FROM ' + $EntityVariable + ' AS table'

Cheers,

Jeffrey

answered
1

Yes. Take a look at the example that Arjen has supplied in the OQL module:

answered
0

Check how OQL UI works. It does pretty much what you want: a user types in whatever OQL string to execute, and then dump the output into a table.

answered