Dynamics 365 Using a temporary table in X++
Dynamics 365 for Finance and Operations contains numerous temporary tables that are used by the application. We also have the option of creating Temporary tables based on any of the existing table in the AOT. They can be created in order to hold temporary data for the duration of a code block or snippet. As an example, we will use the customer to insert and display a couple of temporary records without affecting the actual data.
1 As an example, we will use the customer table to insert and display a couple of temporary
records without affecting the actual data stored in Dynamics 365. Lets add a new class to our Visual Studio Project. Right Click project name
2 Click Add a new item, we are going to add a new class for our temporary table
3 Click New Item. In the pop up window which is displayed I am going to select code in the left hand window. This will show me all the code options I can add
4 select runnable class in the code pane options and give the class a name. I am going to call the class RunnableClassCustomerTempTable
5 Right Click our new class object RunnableClassCustTempTable. Click in the menu option which is displayed Set as Startup Object. This will run this code when we start to run the project
6 In the code pane of the class enter the following lines of code. The key method in this recipe is setTmp(). This method is available in all the tables, and it makes the current table instance behave as a temporary table in the current scope.

Like
Report
*This post is locked for comments