Validation must occur when customer records are updated. For all customers where the value of the customer group field is international, you must the delivery mode to Air.
You need to update the customer records.
Which two segments can you use? Each correct answer presents a complete solution.
NOTE: Each correct selection is worth one point.

Show answerHide answer
Correct answer: A, D Option AOption D
Explanation
Explanation:This question tests knowledge of efficient, bulk data operations in X++ within Dynamics 365 Finance and Operations. The requirement is to update millions of records while ensuring validation logic executes. While update_recordset is the most performant for bulk updates, it bypasses individual record validation by default. Using while select forupdate with .update() is the standard method to ensure per-record validation and business logic runs.
Correct Option:
Option A:
This is a correct solution. The while select forupdate loop fetches records individually. Inside the loop, field assignment and the .update() method call ensure that all table and field-level validation logic, including validateField, validateWrite, and update method overrides, are executed for each customer record. This guarantees business rules are enforced, which is the stated requirement.
Option D:
This is also a correct solution. It is functionally identical to Option A. The .doUpdate() method is the instance method called by the static Table.update() method. Using CustTable.doUpdate() performs the same core operation as CustTable.update(), invoking the full update sequence and all associated validation logic on the current record buffer.
Incorrect Options:
Option B:
This is incorrect syntax. X++ does not support a T-SQL style UPDATE...SET statement. The update keyword in X++ is used as a method on a table buffer (e.g., custTable.update();), not as a standalone SQL command. This code would not compile.
Option C:
This is incorrect for the requirement. While update_recordset is syntactically correct and offers superior performance for bulk updates, it performs a set-based operation directly in the database. This bypasses most application-layer validation, business logic, and event handlers (like onUpdating/onUpdated). Since the scenario mandates validation, this option does not fulfill the requirement.
Reference:
Reference: Microsoft Learn - "Perform maintenance and bulk operations" which contrasts update_recordset (for performance, minimal logging) with record-by-record operations (for business logic execution).








