nerdexam
Microsoft

PL-400 · Question #450

You have a model-driven app form that uses Xrm.WebApi.updateRecord during the OnSave event to update a related record. You observe during testing that the related record does not always update when…

The correct answer is B. Enable the Async OnSave app setting. C. Wrap the update in a promise. A reliable approach is to use the Async OnSave feature to properly handle the related record update after the current record has been saved. Enabling the Async OnSave app setting is the correct way to ensure the main record is saved and the related record is updated…

Submitted by sofia.br· Apr 18, 2026

Question

You have a model-driven app form that uses Xrm.WebApi.updateRecord during the OnSave event to update a related record. You observe during testing that the related record does not always update when it should. You need to ensure that the current record is saved and the related record is updated consistently. Which two actions should you perform? Each correct answer presents part of the solution. Choose two. NOTE: Each correct selection is worth one point.

Options

  • AAdd logic before the update to ensure that the request is made only when the value has changed.
  • BEnable the Async OnSave app setting.
  • CWrap the update in a promise.
  • DAdd executionContext.getEventArgs[].disableAsyncTimeout[] before the update.
  • EAdd executionContext.getEventArgs[].preventDefault[] before the update.

How the community answered

(47 responses)
  • A
    9% (4)
  • B
    70% (33)
  • D
    4% (2)
  • E
    17% (8)

Explanation

A reliable approach is to use the Async OnSave feature to properly handle the related record update after the current record has been saved. Enabling the Async OnSave app setting is the correct way to ensure the main record is saved and the related record is updated consistently, because it makes the form wait for the promise returned by your Xrm.WebApi.updateRecord function to resolve before the form's save operation completes. This prevents the save from being inconsistent by ensuring that the asynchronous update of the related record is finished before the save is finalized. How it works: When Async OnSave is enabled, the OnSave event handler can return a promise [C]. The form will then wait for this promise to resolve (or time out after 10 seconds per promise) before the main record is finally saved. To ensure consistency, use async/await to handle the Xrm.WebApi promise and wrap both the main form save and the related record update in Promise.all() for atomic execution. The OnSave event handler must also return a single promise that includes the result of all asynchronous operations to ensure the save completes only after both updates are finished. https://learn.microsoft.com/en-us/power-apps/developer/model-driven- apps/clientapi/reference/xrm-webapi/updaterecord

Community Discussion

No community discussion yet for this question.

Full PL-400 Practice