In Dymanics AX 4.0, I want to run some methods under the Application Object Tree (AOT) > Data Dictionary > Tables > CustTable > Methods. (Could be any table at all)
This is mainly to get some custom calculated values, and also in part to deal with SQL injection Axapta.ExecuteStmt - Is it safe?
I found AxaptaRecord.Call documentation here but it doesn't help alot. Not sure if it is the correct method too. Also, what are the method call differences in terms of function types? e.g. public, static, server, return value types etc.
Hoping for some advice. Thanks.
Those functions are intended to solve different problems in .NET that can easilly be solved from X++:
Axapta.ExecuteStmtis the way to send some SQL (on the X++ internal SQL syntax) to the database that can be a select, update_recordset, etc. Exactly the same functionallity and results that if you write SQL commands inside the X++ code.AxaptaRecord.Callis a class method. That way, with this function you can only run record methods coded in X++ inside a table (those that can be found inside the Methods node on the AOT, like the usual .find() method).EDIT: There is a third interesting method:
Axapta.CallStaticClassMethodis the way to execute an static method saved on a class. As the method needs to be static, you don't pass an object to the function, but just the class name and method name, as it is executed on a new context.