Skip to main content

Posts

Showing posts from December, 2023

Use temporary table as form datasource in D365FO

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...

Inserting Data in Table using Query::insert_recordset

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...

Bank Cheque Report Customization

In this article, we will customize the Vendor Payment Journal   form and the Bank Cheque Payment  report in D365. We have to add the custom field in the Vendor Payment Journal form, report and also customize the slip text area of the cheque printing report. To fulfill the requirement we will follow such steps: Step 1: We will create an extension of the  LedgerJournalTrans  table and then add the custom field  Memo to it.  Step 2: We will create an extension of the  form   LedgerJournalTransVendPaym (Vendor Payment Journal)  and drag the  Memo  field in the lines from the LedgerJournalTrans datasource. Note: The custom field is successfully added to the form. Now we will add this field to the cheque report. Step 3: We will create COC of the  determineReportMenuOutput method of the ChequeController class to call our custom design of the cheque report.  [ExtensionOf(classStr(ChequeController))] internal final class ...