When we talk about add ons, we need that add on will make SAP Business One more useful, and won’t make a trouble to your team. Sometimes we created matrix within a menu in SAP Business One with Add-on. We want to load some data into matrix. Use DataTable for faster performance when loading data into matrix. It is faster than store data with matrix.
First of all, we have to declare DataTable variable. Then add columns with its suitable datatype to DataTable. At this point, DataTable ready to bind to matrix.
Second step, bind each column in matrix to suitable columns in DataTable we created before.
Add row into DataTable, then use SetValue function to store data into DataTable. Last step of this action is loading data into matrix with LoadFromDataSourceEx function and data will be inserted automatically in matrix.
But if it’s possible to get data with SQL Query, it would be the best option. DataTable have a function to executeQuery and all we have to do next is call LoadFromDataSourceEx function and data will be inserted automatically in matrix in a split second.