✏️ Explanatory Question

X++ code to show record count during set based update operation in D365FO

👁 11 Views
📘 Detailed Answer
🟢 Easy
No previous question
No next question
💡

Answer with Explanation

In this answer we will see the code to know the record count after set based update operation.

For demo purpose, created a runnable class "CG_UpdateRecordSetRecordCount" and used the below code to update the field "classification group" of customers based on customer group.


class CG_UpdateRecordSetRecordCount
{        
    /// <summary>
    /// Runs the class with the specified arguments.
    /// </summary>
    /// <param name = "_args">The specified arguments.</param>
    public static void main(Args _args)
    {
        CustTable custTable;

        ttsbegin;
        update_recordset custTable
            setting CustClassificationId = "01"
            where custTable.CustGroup  == "30";
        ttscommit;

        Info(strfmt("%1 records are updated", custTable.RowCount()));
		        
    }

}
Figure: X++ code to show record count during set based update operation in D365FO

No previous question
No next question