Q01 - Question
A command bar script finishes a long-running action on a model-driven app. You need to tell the user that the action completed, and the script is not running in the context of a form. Which Xrm method should you use?
Domain: Extend the user experience (10–15%) Type: Single choice
- A. Xrm.App.addGlobalNotification
- B. Xrm.Navigation.openAlertDialog
- C. Xrm.Utility.showProgressIndicator
- D. Xrm.Navigation.openErrorDialog
A is correct.
Explanation: The addGlobalNotification method on the App object displays a success, information, warning, or error notification for the app. It works outside the context of a form, which fits a command bar script notifying a user of a completed action while avoiding a blocking dialog.
B is incorrect: The openAlertDialog method shows a blocking dialog with a message and a button, which is not the preferred non-blocking user experience.
C is incorrect: The showProgressIndicator method displays a progress dialog with a specified message. It does not report a completed action as a notification.
D is incorrect: The openErrorDialog method displays an error dialog. It is blocking, and the action completed successfully, so an error dialog does not fit.
Q02 - Question
A form must make a column required based on the address of an account's primary contact. The rule must also be evaluated when the user saves the form. Which implementation should you choose?
Domain: Extend the user experience (10–15%) Type: Single choice
- A. A form-scoped business rule that runs on field change
- B. A client script that uses the Web API and runs on the Save event
- C. A table-scoped business rule that references the related table
- D. A calculated column that updates instantly as the user edits the form
B is correct.
Explanation: Referencing data in a related table, such as the address of a primary contact, requires using a client script and the Web API. Furthermore, business logic that must run on the Save form event also requires a client script. A single script meets both of these requirements.
A is incorrect: Business rules run on form load and field change unless the scope is table, and they cannot reference related table data.
C is incorrect: A table-scoped rule applies logic on the backend, but referencing related table data still requires using a client script and the Web API.
D is incorrect: Calculated columns run logic on retrieve, so client-side changes do not appear until the form refreshes. They do not update instantly.
Q03 - Question
A form script validates a date column. Users also import rows from files and call the Web API from shell scripts. The business requires the validation to apply on every access path. What should you do?
Domain: Extend the user experience (10–15%) Type: Single choice
- A. Add more client script handlers to the form OnSave event
- B. Run solution checker regularly on the JavaScript web resources
- C. Combine the client script with a server-side solution such as a Dataverse plug-in
- D. Use jQuery to enforce the validation on the form fields
C is correct.
Explanation: Client scripting solves specific client-side UI issues and enhances the user experience. It is not a security measure, and users can access data through data import, shell scripting, and other tools. A server-side solution such as a Dataverse plug-in ensures all access points fulfill the business requirements.
A is incorrect: Additional OnSave handlers still run only within the model-driven app form, which means that data imports and shell scripts will bypass them.
B is incorrect: The solution checker performs static analysis to identify best practice issues and deprecated methods. It does not enforce business logic at runtime.
D is incorrect: The jQuery library is not supported in form scripts or command bar commands, and it would not cover any non-form access paths.
Q04 - Question
You troubleshoot a client script in a shared environment that other users are using. You want to view diagnostic messages without disrupting them, even if the code is accidentally left in production. Which approach should you use?
Domain: Extend the user experience (10–15%) Type: Single choice
- A. Call window.alert at each step of the script
- B. Add a debugger statement at the start of the function
- C. Write messages with console.log inside a check that the console exists
- D. Open an Xrm.Navigation alert dialog for each message
C is correct.
Explanation: Writing messages to the console ensures that they are only visible when the browser console is open. Unlike the alert method, if you forget to remove the code, people using the application do not see your messages. This helps troubleshoot the application behavior without disrupting the app users.
A is incorrect: The window.alert method interrupts anyone using the application and is often left in code by mistake, causing issues for users in production.
B is incorrect: A debugger statement interrupts code execution. If it is inadvertently left in the code, it causes issues for app users in production.
D is incorrect: The openAlertDialog method displays a blocking dialog, which means it would also disrupt other users of the shared environment during troubleshooting.
Q05 - Question
An Idea form script must set columns as required based on the selected Challenge. When the user changes the Challenge lookup after the form loads, the requirement levels do not update. The OnLoad handler already calls the logic. What should you add?
Domain: Extend the user experience (10–15%) Type: Single choice
- A. An OnChange handler registered on the lookup that calls the same logic
- B. A second retrieveRecord call in the error function
- C. A call to setRequiredLevel('required') for both columns in OnLoad
- D. A form library reference to a second copy of the script
A is correct.
Explanation: To handle updates, the OnLoad handler must register an OnChange event handler on the Challenge lookup by using the addOnChange method. This handler gets the formContext and calls the same setRequiredFields function, ensuring that the requirement levels update properly whenever the user changes the related challenge.
B is incorrect: The error function only logs the message to the console when the retrieveRecord method fails. It does not respond to any lookup changes.
C is incorrect: Setting both columns to required in the OnLoad function ignores the Challenge values. The requirement must depend on the related row's specific columns.
D is incorrect: Adding another copy of the library does not register an event for lookup changes, and it can easily create script function name conflicts.
Q06 - Question
You built the EditablePCF component. Users edit the Name value and select Save, but the host app never receives the new value. The textbox value is copied to the name variable in buttonClick. Which call must run so the framework retrieves the change?
Domain: Extend the user experience (10–15%) Type: Single choice
- A. updateView
- B. notifyOutputChanged
- C. destroy
- D. init
B is correct.
Explanation: The buttonClick method copies the textbox value to the name variable and then calls the notifyOutputChanged method. This callback alerts the framework that the control has new outputs ready to be retrieved asynchronously. The framework can then retrieve them through the getOutputs method and push the updated value to the host app.
A is incorrect: The updateView method handles updates coming from the host app into the component, not changes pushed from the component to the host.
C is incorrect: The destroy method only removes the event listener during cleanup and does not report output changes to the framework.
D is incorrect: The init method runs once to set up the component and create its elements, so it cannot report later user edits.
Q07 - Question
You add a css reference for EditablePCF.css to the resources node in ControlManifest.Input.xml. When you run npm run build, the build fails. You created the css folder and the file. What should you verify first?
Domain: Extend the user experience (10–15%) Type: Single choice
- A. That the CSS file name matches the manifest resource path exactly
- B. That the component is compiled into the out/controls folder
- C. That the Power Platform Tools extension runs outside Visual Studio Code
- D. That the test harness is running in watch mode
A is correct.
Explanation: The most common build error received during this step is a typo in the file name for the CSS file you created earlier. You must verify that the resource section in the ControlManifest.Input.xml file matches the file created in the CSS folder exactly. Correct the name and rerun the build command.
B is incorrect: The out/controls folder is the build output destination after a successful compile, so it is not a cause of the failure.
C is incorrect: The Power Platform Tools extension prevents running CLI commands outside Visual Studio Code, which does not explain a CSS build failure.
D is incorrect: Watch mode applies to the test harness started with the npm start command and is not related to the build error.
Q08 - Question
You are still developing a code component and want to test it quickly in a development Dataverse environment. You don't need a separate solution file for transport. Which approach should you use?
Domain: Extend the user experience (10–15%) Type: Single choice
- A. Run pac solution init and build with msbuild
- B. Run pac pcf push with a publisher prefix
- C. Run npm start to load the test harness
- D. Edit SolutionPackageType in the cdsproj file
B is correct.
Explanation: The pac pcf push command creates a temporary solution to push your component to an environment to facilitate testing. This approach is great for use during the development of the component because you do not have to build and import a solution file manually into Dataverse.
A is incorrect: The pac solution init command with msbuild creates a solution zip for import, which suits pipelines rather than quick development testing.
C is incorrect: The npm start command runs the local test harness and does not deploy the code component to a Dataverse environment.
D is incorrect: The SolutionPackageType node sets whether the solution is managed or unmanaged and does not deploy the component to an environment.
Q09 - Question
You build a solution project for a code component with msbuild. The team needs an unmanaged solution zip for another environment, but the output is managed. What should you change?
Domain: Extend the user experience (10–15%) Type: Single choice
- A. Use the /restore flag on every build
- B. Set the msbuild configuration to Release
- C. Edit the SolutionPackageType node in the cdsproj file to Unmanaged
- D. Run pac pcf push with a different publisher prefix
C is correct.
Explanation: The default package type is a Managed solution. If you want to export as Unmanaged, you can uncomment the PropertyGroup section from your Solutions.cdsproj file and edit the SolutionPackageType node accordingly. You can then rebuild the project to generate the solution zip file with the required package type.
A is incorrect: The /restore flag is needed only for the first time the solution project is built and does not affect the package type.
B is incorrect: The Release configuration issues a production build and changes the output folder, but it does not change the package type.
D is incorrect: The pac pcf push command creates a temporary solution for testing and does not set the package type of the output.
Q10 - Question
You are building a dataset code component. You want to test how it renders records without connecting to a Dataverse environment. Which approach should you use in the test harness?
Domain: Extend the user experience (10–15%) Type: Single choice
- A. Load a CSV file with mock data in Data Inputs
- B. Set Form Factor to Tablet in Context Inputs
- C. Add console.log() calls and review the console panel
- D. Set a breakpoint in the sources panel
A is correct.
Explanation: If your component is a dataset component, the Data Inputs drop-down menu in the test harness allows you to load CSV files with mock data. You can export a CSV from a sample target environment or build a new one to verify that the component displays the records correctly.
B is incorrect: The Form Factor option in Context Inputs changes how the component renders at different sizes but does not supply mock records.
C is incorrect: The console.log() method writes trace output to the console panel and does not provide mock data to the dataset component.
D is incorrect: A debugger breakpoint pauses execution so you can inspect variables and method flow, but it does not load mock data.