D365FO – How to count affected/updated rows in a Update_recordset statement

 

How to know how many rows have been updated in a Update_recordset statement?

It’s simple, you can just use rowCount() method of the table after the update statement like shown below

update_recordset inventTable

       setting

           XXXCommercialGroupId = comunanzaXXX.SubGroupId

       join comXXX

           where inventTable.ItemId == comXXX.comunanzaCode

           && comXXX.SubGroupId != '';

info(strFmt("Copy Items  from comXXX Subgroup Id to InventTable Commercial group Id: %1 rows affected", int2Str(inventTable.RowCount())));

Comments