Populating ax listpage with a sql view. Permissions workaround question.

Hello,

I have a sql view that I have created that I do not wish to try and replicate in x++ because of its complexity. In the AOT I created a table, query, & listpage. In the query on the init method I call the sql view and populate the aot table with the data. The listpage then displays the data that is stored in the aot table. The problem is, that when running the list page it executes client side and I know that sql calls can only be executed from server side so I am getting permission errors. The only way I could think of to bypass this is to create a secondary menu item with the “RunOn” parameter set to “Server” that calls a class that can execute the sql and insert statements. Then have the query’s init method execute the menu item so when the query\insert class runs it runs server side.

Is this a viable solution, or is there any recommendations for a better approach. In the end the basic concept is to display data from a sql view in an ax list page.

I forgot that you can set the “RunOn” parameters for individual classes. I created a new class with a static method set the “RunOn” paramter to server, then had the querys init method call the static method and it seem to fix the issue.

I still would like to know if this is best practice for something like this. Thanks in advanced.