Can any one tell us how to call sql stored procedure using X++ CLASS
Hi, use the Statement class for it (the following code must be run on server):
Connection connection = new Connection();Statement statement = connection.createStatement();str sqlCode = 'EXECUTE something - or any other SQL code';SqlStatementExecutePermission permission = new SqlStatementExecutePermission(sqlCode);permission.assert();statement.executeQuery(sqlCode);
Martin "Goshoom" Dráb | Freelancer | Goshoom.NET Dev Blog
How can the results of a class like this be used as a datasource for a form of report?
How can a class that uses the statement class be used as the data source for a form or report in the AOT?
You can't use classes as a form (or MorphX report) datasource - it has to be a table. The solution is simply to fill a (temporary) table by the data - then just use it as usual.