Access Issue with ESQ

Hi Community,




I have a task where based on the combination of two fields I have to populate several other fields from a different section in the frontend before saving the record. 

Please see the below image where all the fields inside the red boundary are auto-populated.


Below is the code


Code is working fine, but the problem is it's not working if the user is other than Supervisor.

I believe, since other users have no access of the section from where values are being fetched this is the reason for this issue.


Please help me to resolve this issue.


Is there any alternative of ESQ like Select or Update class I can use in Edit page schema in order to achive this?







Like 0



Hi Akshit,


ESQ takes into account access rights of users who initialize the ESQ query meaning that you are correct, the set of records that ESQ returns differs for different users. There are rules to restrict\allow using access rights in ESQ query and they are listed in the Terrasoft.Core.DB.QueryJoinRightLevel.


EnabledAlways = 0 - access rights are always taken into account


EnabledForAdditionalColumns = 1 - use access rights in case the connected schema uses columns that are not used in the primary schema from which the connection is performed (PrimaryColumn).


Disabled = 2 - do not use access rights restrictions.


In your case you can go to the system setting with the "QueryJoinRightLevel" code and specify the value for this setting as 2 and relogin to the app. This should disable access rights check in the connected schemas.


Best regards,


Hello Akshit,

As an alternative to what Oscar mentioned, if you don't want to change that setting and only want this behavior for this query, I would instead of doing the ESQ, use a configuration service and then retrieve the data using the Select class, which doesn't take access rights into account (or a direct database query). Then return those results to the page.

Using this method will bypass the access rights without changing the setting which could potentially impact other queries.


Hi Ryan ,


Thank you for the information, It is really helpful.



Hi Oscar,


Thank you for your information.


I just want to ask If I make the required change in the "QueryJoinRightLevel" system setting, then does it allow other users (like in my case users other than Supervisor) to access the tables.


Because In my case no other user should have access permission to the section from which the data is being fetched.






This system setting is used for ESQ only so it will only affect ESQ results.


Best regards,


Show all comments