How to Use TypeScript for Error Dialogs in Microsoft Dataverse Web API Integration?
Table of Contents
Question
You are developing a solution based on Microsoft Dataverse. A custom ribbon button has to request the Web API to retrieve another record.
When the request gets an error, you want to inform the user about it in an error dialog. You need to show a message as well as the returned error message by using the Download Log File button.
Which TypeScript code segment should you use?
Select only one answer.
A. Xrm.Navigation.openErrorDialog({ message: “There was an error during the request”});
B. Xrm.Navigation.openErrorDialog({ message: “There was an error during the request”, details: error.message });
C. Xrm.Navigation.openAlertDialog({ text: “There was an error during the request”}, {height: 120, width: 260});
D. Xrm.Navigation.openAlertDialog({ text: error.message}, {height: 120, width: 260});
Answer
B. Xrm.Navigation.openErrorDialog({ message: “There was an error during the request”, details: error.message });
Explanation
This item tests the candidate’s knowledge of Client API references and different dialogs in the Xrm.Navigation namespace.
The code segment that includes ({ message: “There was an error during the request”, details: error.message }); will ensure the details, if present, will be available when the user downloads the log file. The code segment that includes ({ message: “There was an error during the request”}); displays an error dialog with a message as requested, but the Download Log File button is not shown. The code segments that include text: display an alert dialog, which does not include functionality for displaying the required Download Log File button.
Microsoft Power Platform Developer PL-400 certification exam practice question and answer (Q&A) dump with detail explanation and reference available free, helpful to pass the Microsoft Power Platform Developer PL-400 exam and earn Microsoft Power Platform Developer PL-400 certification.