✏️ Explanatory Question

Table method update() in D365

👁 3,074 Views
📘 Detailed Answer
3,074
Total Views
10
Related Qs
0%
Progress
💡

Answer with Explanation

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");