Question 250
A Dynamics 365 Business Central development project faces this issue: An AL loop changes a Record before checking that the current user is authorized for the operation. Which action best addresses the requirement?
Explanation
Correct Answer
This resolves the scenario's main defect: A check after a side effect can create partial updates and audit gaps. A practical validation is: Unauthorized tests leave all affected records unchanged.
Incorrect Answers
This changes a workflow associated with a partner uses a long text field for fixed domain codes and repeated typos create unhandled cases. The present failure instead depends on this distinction: A check after a side effect can create partial updates and audit gaps.
The option would apply to “A developer calls a web service inside a transaction and ignores timeouts while locks remain held”. Network latency and retry storms can magnify locking and inconsistency risks. This question instead requires “Perform authorization and business-state checks before mutating data”.
The proposed step is suitable when a developer calls Error for a recoverable validation problem but the customer loses the context needed to fix the record. It misses this case: An AL loop changes a Record before checking that the current user is authorized for the operation. The relevant action is Perform authorization and business-state checks before mutating data.