Table method update() in D365

X++ Programming Language >   D365 Table >   Table Methods  

Long Question

3499


Answer:

The update table method updates the current record with the contents of the buffer. It also updates the appropriate system fields.

The where clause is optional. When used, the where clause specifies a condition for update to test while processing each row of the table. Only those rows that test true against the condition are updated with the new values.

update_recordset is a record-set based operator—it updates multiple records at once.

To override the behavior of update, use the doUpdate method.


        EmployeeTable empdet;
        empdet.EmpId = "E002";
        empdet.EmpName = "Osman Ali Sk";
        empdet.DeptId = "D001";
        empdet.insert();
        info("Data Inserted");

select forUpdate


  CustTable custTable;
        ttsBegin;
          select forUpdate custTable
          where custTable.AccountNum == '4000'; 
          custTable.CreditMax = 5000; 
          custTable.update(); 
        ttsCommit;

insert_recordset


       EmployeeTable empdet;
       DepartmentMy dept; 

        insert_recordset empdet (DeptId)
            select DeptId from dept;
        
       info("Data Copied");


This Particular section is dedicated to Question & Answer only. If you want learn more about X++ Programming Language. Then you can visit below links to get more depth on this subject.




Join Our telegram group to ask Questions

Click below button to join our groups.