In this article, we will learn how we can use the temporary table as a form datasource in D365. In our scenario, we will populate the temporary table at runtime and bind it with the form datasource. firstly, we will pass an argument on the clicked event and write the form datasource init method to populate the data in it. In our scenario we will work on the CustTable form, we will populate the customer group in the temporary table which we create on the selected customer while clicking the button. Step 1: Create a new table of type TempDB and add two new fields i.e., CustGroupId and CustGroup. Step 2: We will create a new form with the pattern (List Type), then add our previously created temporary table as a datasource, and then drag both the fields CustGroupId and CustGroup on the form grid part. After the form creation, we will also create the display menu item of type form and use our form on it. Step 3: We will create an extension of t...
When dealing with performance, there is a query system control named Query::Insert_Recordset. This allows multiple records to be inserted into a table in the same way the Insert_Recordset command works. This will also eliminate the need to loop over hundreds of records, as well as roundtrips between the SQL server and the AOS server. Here is a quick demo of how it works: Query query = new Query(queryStr(MDTrvExpenseDetailsQuery)); QueryRun queryRun; QueryBuildDataSource qbdsTrvExpTrans, qbdsTrvExpTable, qbdsProjTable, qbdsHcmWorker, qbdsDirPerson; Map fieldMapping; HcmPositionWorkerAssignment hcmPositionWorkerAssignment; HcmPosition hcmPosition; MDTrvExpenseDetailsContract contract = this.parmDataContract() as MDTrvExpenseDetailsContract; paymentStatus...