Extend the user experience
Drill 20 practice questions focused entirely on Extend the user experience for the Microsoft PL-400 exam. Tap an answer for instant feedback and a full explanation — no sign-up, always free.
You are developing client scripting for a model-driven app account form. Requirements: when the user changes the 'Primary Contact' lookup, you must immediately requery a related phone number and populate a text field, but this logic must NOT run when the form first loads with an existing record. You have written a JavaScript function that performs the requery. How should you register the handler so it meets the requirement using supported approaches?
You are registering a JavaScript function on the OnChange event of the 'creditlimit' field in a model-driven app account form. Inside your function, you need reliable access to the form's formContext so you can read and update other fields. Your function signature is defined as 'function validateCreditLimit(executionContext)'. What must you configure in the event handler registration to ensure formContext is available?
You are writing a JavaScript function for a model-driven app's Account form OnLoad event. The function must read and update fields on the form. Your organization enforces current best practices for the Client API object model and prohibits deprecated globals. How should your function obtain the object needed to access form data?
You are writing an OnChange event handler in a model-driven app form. When a user selects a value in the 'Primary Contact' lookup field, your JavaScript must read the selected record's GUID and entity logical name to pass into a subsequent Xrm.WebApi retrieve call. Which Client API expression correctly returns the data you need?
A developer writes a JavaScript function registered on the OnSave event of the Account form in a model-driven app. When a required credit-check field is missing, the function must display a modal error message with an OK button that the user must acknowledge, and it must prevent the save from completing. Which combination correctly meets these requirements using the Client API object model?
In a model-driven app, a developer must display a persistent warning banner at the top of the Account form when the annual revenue exceeds a threshold, and the banner must automatically disappear when the value is corrected. The developer writes an OnChange handler for the revenue field. Which combination of Client API methods should be used to show and later remove the message?
On the Account form, you write a JavaScript function registered on the form OnLoad event that must retrieve the credit limit from a related parent account record and display it in a warning notification. The account record ID is available from the form context. Which Client API approach should you use to retrieve the related record data efficiently within the client script?
You are building a command bar button in a model-driven app using the modern command designer with Power Fx. The button labeled 'Submit for Approval' should only be enabled when the current record's Status field (a choice column named 'statuscode') equals the 'Draft' value, and it should be hidden entirely for any other status. You need to configure both the button's visibility and its enabled behavior with the least amount of code and without writing a JavaScript web resource. Which approach should you use?
You are extending a model-driven app for a sales team. On the Account main form, you must add a ribbon command button that opens a full-screen custom page (a Power Fx canvas-based page) as a centered dialog, passing the current account's GUID so the custom page can load related data. What is the recommended approach to implement the button's action?
You built a PCF field component that, in its init method, subscribes to a browser resize event using window.addEventListener and starts a setInterval timer to poll an external service. Testers report that after navigating between records on a model-driven form many times, the browser tab consumes increasing amounts of memory and multiple timers fire simultaneously. In which lifecycle method should you remove the event listener and clear the interval to fix this?
You are building a PCF field component for a model-driven app that lets field technicians capture a photo of completed work directly from their mobile device camera. In your component code you plan to call context.device.captureImage(). During testing on a desktop browser and mobile, the method throws or is unavailable. What must you do to correctly enable this capability?
You are building a PCF field code component that lets users pick a numeric rating with a custom slider. When the user changes the slider, you call notifyOutputChanged. The Dataverse column bound to the component is a Whole Number field named 'rating'. During testing, the value never persists to the record even though updateView receives the correct data. What must you implement so the framework can retrieve and save the updated value?
You are building a PCF code component that must call the Dataverse Web API to retrieve related records when it loads inside a model-driven app. During testing in the harness the component works, but after deployment the context.webAPI object is undefined at runtime. What must you do to make the Web API available to the component?
You are building a PCF code component that must be bound to a single currency column on a model-driven app form. The component displays and lets users edit that one value. In the ControlManifest.Input.xml, how should you declare the binding so the component receives and can update that single column's value?
You are packaging a code component built with the Power Apps component framework. The component uses an external CSS file and a localized string resource file (strings/MyControl.1033.resx). During deployment you notice the component renders with no styling and English strings do not load. What must you do to ensure these files are bundled and available to the component at runtime?
You are building a PCF field component that renders a custom slider for a numeric column on a model-driven form. When the user drags the slider, the component updates an internal variable, but you notice that the new value is never written back to the Dataverse column and does not participate in form save. Which action must your component take so the framework persists the user's changed value?
You are building a PCF code component that renders a complex, interactive chart with heavy state management. Your team already uses React extensively and wants to avoid bundling React separately in every component to reduce load times, taking advantage of the platform-provided React and Fluent libraries. Which action should you take when authoring the component's manifest and class to achieve this?
You are building a PCF field component that renders a numeric slider bound to a Dataverse field. The component also exposes an input property named 'maxValue' that controls the slider's upper bound. Rebuilding the slider control is expensive, so you only want to recreate it when 'maxValue' changes, not on every framework callback. Inside the updateView method, how should you determine whether 'maxValue' changed since the last call?
You are building a PCF field component for a model-driven app that displays a bound numeric value as a colored progress bar. When the bound column value changes (either by user edit elsewhere on the form or by a business rule), the component must redraw the bar with the new value. In which lifecycle method should you read the updated value from context.parameters and re-render the visual?
You are building a PCF field component that displays currency values and must format numbers according to the user's language and locale settings in the model-driven app. You need to retrieve the user's current formatting information (such as decimal and currency symbols) at runtime without making a Web API call. Which member of the component context should you use?
More PL-400 practice
Keep going with the other Microsoft Power Platform Developer domains, or take a full timed mock exam.
← Back to PL-400 overview