Microsoft Power Platform Developer — Question 56
A model-driven app form has JavaScript that runs during the OnLoad event. The event retrieves an account record and changes visibility to a form column based on one of the record columns. The following portion of code retrieves the account record:
Xrm.WebApi.retrieveRecord('account', accountId)_
Users report that the form loads slowly.
You need to improve the performance of the code that retrieves the account and changes visibility.
What should you do?
Answer options
- A. Use a synchronous XMLHttpRequest instead.
- B. Add the code to change visibility to the success callback.
- C. Enable the Async OnLoad app setting.
- D. Set the options parameter to return only the column required.
- E. Store the returned data in a global variable.
Correct answer: C
Explanation
Enabling the Async OnLoad app setting allows the form to load without waiting for the account record retrieval to complete, thus improving overall performance. The other options either do not address the loading issue effectively or may complicate the process without significantly improving performance.