When current user is not an admin, find() method doesn't work, table is empty

So I’m just trying to make a simple find() method work. It should work for all users regardless of their rights. But for some reason, it only works for users with admin rights. For users without the admin role, table is empty, AX can’t see records.

I also tried using SecurityUtil::sysAdminMode() method to disable admin role. In this case as well, AX can’t see any records in the table. Even when I open the table through a table browser, it is empty!

Can anyone tell me why is AX executing the code in the context of the current user? I tried deleting cahces, AUCs, etc. The table is RetailStoreTable.

I’m very tired and maybe I’m missing something very simple but I don’t know what…

May be enabled Record level security on the table.
Users might not have permissions to fetch the records from db.

This is not the case. But even if it was the case, then users wouldn’t be able to see the data from client site, but it shouldn’t affect the code executed, right? I mean, if it’s written in X++ that we’re selecting a record, it doesn’t mean that AX should check if the current user has the rights to see this record, it should just select it.

Found the cause and the solution: community.dynamics.com/…/92711

Hey, could you explain the solution. Pointed thread not verified one.