AX – 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


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

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