AX – D365FO – Update a field value of a table with the value of a joined table in update_recordset

This example shows that the update_recordset statement supports the joining of several tables. Data from the joined tables can be used to assign values to fields in the table that is being updated.

static void Join22aJob(Args _args)
        TableEmployee tabEmpl;
        TableDepartment tabDept;
        TableProject tabProj;
        update_recordset tabEmpl
            currentStatusDescription = tabDept.DeptName
                + ", " + tabProj.ProjName
        join tabDept
            where tabDept .DeptId == tabEmpl.DeptId
        join tabProj
            where tabProj .ProjId == tabEmpl.ProjId;
        info(strFmt("Number of records updated is %1."
            ,tabEmpl .rowCount()));

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s