Extend the user experience
AB-400 · 87 questions
- A developer inherits a model-driven app form script that reads and sets column values through Xrm.Page in an OnLoad handler. The script must be modernized to the supported Client API pattern. What change should be made?
- In a model-driven app, a form script sets the value of a column that is read-only on the form whenever another column changes. The new value appears on screen, but after saving, the stored value in Dataverse is unchanged. What should the developer add to the script?
- On the account form of a model-driven app, a whole tab named tabpartner must be hidden whenever the Account Type column is set to Partner. Which Client API call hides the tab?
- A developer writes formContext.getAttribute("telephone1").setVisible(false) to hide the Business Phone field on a form, and the browser console reports that setVisible is not a function. What is the cause?
- A JavaScript function must run whenever the Credit Limit column changes on the account form, and it needs the form context to read other columns. The team wants the registration to be visible to makers and deployed with the solution. Which approach meets these goals?
- A developer registers a new OnLoad handler, function onLoad(executionContext), on a model-driven form. When the form opens, the script throws because executionContext is undefined on the first line, which calls executionContext.getFormContext(). What is the most likely cause?
- On a model-driven form, an OnSave handler must call a Dataverse custom API to check for duplicate contracts and the save must wait for that server call to finish before it proceeds. Which implementation follows the supported Client API pattern?
- A model-driven form script calls formContext.getAttribute("revenue").addOnChange(recalc) inside a handler registered with formContext.data.addOnLoad. Users report that after they save the record, recalc runs twice for every change, and three times after a second save. What explains this?
- A form script on the account form must retrieve the active cases for the current account, returning only the case title, case number and priority. Which Client API call meets the requirement with the least data transferred?
- A model-driven app script must create a new account together with a new primary contact in one Xrm.WebApi request so that both rows are created in a single operation. How should the script do this?
- A form script calls Xrm.WebApi.updateRecord("opportunity", id, { "parentaccountid": "ACCOUNTGUID" }) to set the Account lookup, and the request fails with a bad request error. How should the data object be written?
- A JavaScript command in a model-driven app must call an unbound Dataverse custom API named contosoRecalculateTerms that takes a string parameter. The developer wants to use the Client API rather than building a raw HTTP request. What must the request object passed to Xrm.WebApi.online.execute provide?
- A modern command on the main grid of a model-driven app opens a review page for one selected account, and the button must be visible only when exactly one row is selected. Which Power Fx formula should the Visible property use?
- A modern command on the opportunity form must call a Dataverse custom API and then open a dialog based on the response, which the team cannot express in Power Fx. How should the developer configure the command's action?
- Users of a model-driven app need a button on the case grid that sets the Escalated column to Yes on every selected row. The team wants to avoid writing and maintaining JavaScript. Which OnSelect formula for a modern command meets the requirement?
- A developer adds a modern command with a Power Fx Visible formula to the contact table using the Main grid command bar location. The button works on the contact list, but it never appears on the Contacts subgrid on the account form, even when rows are selected. What is the cause?
- From a JavaScript command on the account form, a developer must open a custom page named contosocreditreview7b2c1 as a centered modal dialog that receives the current account's ID. Which Client API call does this?
- A model-driven app needs three kinds of message from script: a warning banner at the top of one record's form, an error next to the Credit Limit field, and an app-wide message that stays visible as users move between forms and views. Which combination of Client API methods is correct?
- A JavaScript command on the case form deletes all draft activities linked to the case. Before deleting anything, the script must ask the user to confirm and must proceed only if the user agrees. Which implementation is correct?
- From the account form, a developer must open a new contact form in which the Company Name lookup is already set to the current account so the user only fills in the remaining fields. Which Client API approach is correct?
- A developer is building a standard field code component with the Power Apps component framework. The component must create its input element once, attach event listeners to it, and keep a reference to the callback that tells the framework its outputs changed. In which lifecycle method should this setup happen?
- A code component bound to a numeric column updates its own display when the user drags a slider, but the column value on the form never changes and the record saves the old value. The component stores the new value in a private field and returns it from getOutputs. What is missing?
- A field code component renders a formatted value and also adapts its layout to the space the form gives it. A developer asks when the framework calls updateView and what the method should do. Which description is correct?
- Users report that a model-driven form with a custom code component becomes slower each time it is opened and closed during a session. Profiling shows window resize listeners and a polling interval created by the component are still running after the form closes. What should the developer change?
- A developer is configuring the manifest of a code component that will be placed on a text column in a model-driven form. The component must display the column's current value and write the user's edits back to that same column. How should the property be declared?
- A rating code component must be configurable on whole number, decimal, floating point and currency columns without maintaining four copies of the component. How should the manifest support this?
- A code component calls context.device.captureImage and context.webAPI.retrieveMultipleRecords. The TypeScript compiles and the component builds without warnings, but in the model-driven app both calls fail at runtime as unsupported or unavailable. What is the most likely fix?
- A team is building several React-based code components for a model-driven app. Each component currently bundles its own copy of React and Fluent UI, which makes the bundles large and slows form loading. What should the developer change in each manifest?
- A developer converts a standard code component to a React-based virtual component that uses the platform's React library. Which change to the component class is required?
- A dataset code component on a model-driven app view renders each row as a card. Users sort the view by Estimated Revenue, but the cards appear in a different, inconsistent order. How should the component read the rows?
- A dataset code component replaces a subgrid that can contain several hundred related rows, but it only ever shows the first page of rows. The developer wants users to be able to load more rows on demand. Which approach should the component use?
- A developer adds two new properties to the ControlManifest.Input.xml of a code component, but TypeScript reports that the properties do not exist on IInputs when the code references context.parameters for them. What should the developer do?
- A developer starts a new field code component from scratch and must ship it inside a solution that can be imported into a test environment. Which sequence of steps with the Microsoft Power Platform CLI is correct?
- A developer is changing a code component several times an hour and wants each build to appear in the shared development environment for testing on a real form without creating a solution project or importing zips. Which approach fits this need?
- A solution containing a new field code component has been imported into an environment. The component should now replace the default text box for the Account Number column on the account main form for web users. What must be done?
- A developer fixes a bug in a code component, rebuilds the solution and imports it into the test environment. The import succeeds, but forms in test still run the old behavior even after a browser refresh. What is the most likely cause?
- A field technician app built as a model-driven app needs a code component that lets users take a photo with the device camera and attach it to the current record. Which implementation is correct?
- A code component on a model-driven form must let users choose one or more existing contacts using the standard Dataverse lookup experience, with the same search and recent items that users see elsewhere in the app. Which framework API should the component call?
- A code component on the account form of a model-driven app must show the number of open opportunities for the current account. The developer wants the query to run as the signed-in user and respect their security roles. How should the component retrieve the data?
- A code component on the case form displays a small summary of the case's primary contact, and its labels must match the display names of the contact table's columns in the user's language, including any renamed columns. How should the component obtain the labels?
- A developer is building a Power Apps code app that must display the signed-in user's display name and job title from the Office 365 Users connector. The environment allows code apps and the developer is signed in with the Power Apps CLI. What is the correct approach?
- A code app that uses the Office 365 Users and SharePoint connectors works for the developer. A tester the app is shared with dismissed the connection prompt on first launch, and now every connector call in the app fails for that tester only. What is the most likely explanation and fix?
- A developer added a SQL table as a data source to a code app, and the CLI generated model and service files in the project. A teammate wants to add a custom validation method directly inside the generated service file and change a property type in the generated model. What should the developer advise?
- An administrator asks a developer whether the organization's data policies, which block combining business and non-business connectors, also govern Power Apps code apps that call connectors from JavaScript. Which answer is correct?
- A developer must add the Dataverse account table to a Power Apps code app and show a list of accounts in the USA with only the name, account number and city columns. Which approach follows the documented code app pattern?
- A code app lists rows from a Dataverse case table through its generated service. An administrator sees 480 rows, but a tester signed in with a restricted account sees only the 35 cases that the tester owns, and no error is raised. The code passes no filter to the query. What explains the difference?
- A developer adds a new column, cr5a2priorityscore, to a Dataverse table that a code app already uses as a data source. The column appears in the maker portal, but TypeScript reports that the property does not exist on the generated model. What should the developer do?
- A team is starting a code app for internal audit findings. Findings relate to departments and controls, each finding must be visible only to its owning team, and every field change must be recorded with who changed it and when. Which data platform best meets these requirements with the least custom code?
- A code app has the Dataverse account table added as a data source. The developer must let users create, edit and remove accounts from a React form without writing raw HTTP requests. Which approach fits the code app model?
- A code app list screen calls ContactsService.getAll() with no options and renders only full name, email and city for active contacts. The screen takes several seconds to load, and the network trace shows very large responses. What change best improves load time?
- A code app form shows captions for the columns of a Dataverse table. Users in France and Germany see English captions because the developer hard-coded them, and customizers rename column display names from time to time. How should the developer source the captions?
- A code app creates account rows and must set each account's primary contact. The developer sets primarycontactid to the contact's GUID string in the create payload, and Dataverse rejects the request. What is the correct way to set this lookup?
- A code app shows a grid of Dataverse invoice rows. When a user selects a row and clicks Recalculate, the app must run a bound custom action named cr5a2RecalculateInvoice on that row. How should the developer wire this up?
- A developer calls a custom message from a code app and reviews the traffic in the browser network trace. The message is defined as a custom API with IsFunction set to true, and it has no side effects. How is it invoked over the Dataverse Web API?
- A code app must stamp each new request row with the signed-in user's Dataverse systemuser ID and their business unit ID. The developer wants one Dataverse call that returns both values for the current caller. Which approach should be used?
- A code app calls a Dataverse custom API. Sales managers can run it, but other users receive a privilege error, even though all of them can read and write the tables the API touches. The custom API definition has ExecutePrivilegeName set. What should the developer check?
- A code app must start an approval process in Power Automate when a user submits a request and display the approval reference that the process returns. Which setup supports this from the code app?
- After a user clicks Submit in a code app, an order must be written to SAP through a gateway connector, a Teams message posted and an Outlook email sent. If the user closes the browser partway through, the remaining steps must still complete. What is the best design?
- A code app runs an instant cloud flow through its generated service. The flow's run history shows success and the expected value is computed, but result.data in the app is always empty. What is the most likely cause?
- A code app calls two instant cloud flows. The developer plans to move the app from development to test with Power Platform Pipelines. What must be true for the app and its flows to deploy together cleanly?
- A code app needs an Ask the assistant panel that sends a user's question to an existing, published Copilot Studio agent and shows the agent's reply. How should the developer connect the app to the agent?
- A code app must answer employees' free-text questions about HR policies. The HR team already maintains a published Copilot Studio agent grounded on those policy documents and updates its knowledge sources regularly. What is the best approach for the developer?
- A maker builds a Copilot Studio agent and confirms that it answers correctly in the Copilot Studio test pane. The developer adds the Copilot Studio connector to a code app and calls ExecuteCopilotAsyncV2 with the correct agent name, but the call returns no agent response. Which step was most likely missed?
- A developer is designing the data contract between a code app and a Copilot Studio agent that the app calls through ExecuteCopilotAsyncV2. Which description matches what the app sends and what it receives?
- A code app reads a SharePoint list as a data source. In development it must use the Dev site and list; after the solution is deployed to test and production, it must use each environment's own site and list without rebuilding the app. How should the developer configure the data source?
- A code app reads its SQL Server database name from a config.json file that Vite compiles into the bundle. Each move from test to production requires editing the file, rebuilding and pushing, and once the wrong database shipped. What change best removes this risk?
- A code app's data source references an environment variable through @envvar:. After the solution is imported into test, the app still points at the development SharePoint site. The variable's default value in the solution is the Dev site URL, and no other value was set. What is the fix?
- A code app's data sources use @envvar: references to two environment variables. The team deploys with Power Platform Pipelines from development to test. Which packaging keeps the deployment clean?
- A code app calls a partner REST API at https://api.fabrikam.com by using fetch. After deployment, the browser console reports that connecting to the URL violates a Content Security Policy directive. The environment uses the default code app CSP. What should an environment administrator change?
- Security requires the code app CSP in production to stay at its defaults, with connect-src left at 'none'. A code app still needs data from an external REST service that publishes an OpenAPI definition. Which approach meets both requirements?
- A code app loads a charting library from https://cdn.contoso.com through a script tag and also calls https://data.contoso.com with fetch. With CSP enforced at the environment defaults, both are blocked. Which CSP change allows both while following directive semantics?
- A code app calls an external API from the browser. It works in the development environment, where an administrator added the API origin to connect-src. After the solution is deployed to test with Power Platform Pipelines, the same calls fail with CSP violations. What explains this?
- Operations wants page views and unhandled browser exceptions from a production code app sent to Azure Monitor Application Insights. The team has already created an Application Insights resource. What must the developer add to the code app?
- Product owners want a daily count of how often users click Approve in a code app, with the request's region attached to each occurrence. Application Insights is already initialized in the app. What should the developer add?
- A code app initializes Application Insights with a valid connection string, yet the resource receives no telemetry from production. The browser console shows errors stating that connecting to the Application Insights ingestion URL violates a Content Security Policy directive. What should be done?
- Users report that one action in a code app is slow. The team wants to line up the app's Application Insights custom events with Power Platform's own telemetry for the same user session. Which value should the developer attach to every custom event?
- A developer has finished a React code app that was initialized with pa app init and wants to publish its first version to the environment. Which sequence is correct?
- A code app must be available to the 400 members of the Finance department, whose membership changes weekly. IT maintains a Microsoft Entra security group for Finance, and access must follow that membership without manual upkeep by the app team. What is the best way to grant access?
- A code app was shared with a group of warehouse users. Users who hold only Microsoft 365 E3 licenses cannot open it, while users assigned Power Apps Premium can. The tenant has no pay-as-you-go plan, and auto-claim is turned off. What is the cause?
- A team published a code app with pa app push to a development environment that has Dataverse. They now need a repeatable promotion path to test and production, with dependency and connection reference checks before each deployment. What is the supported approach?
- In a production code app, a SharePoint connector call fails for some users while working for others, and the app shows only a generic error message. The developer needs the actual status code and error body returned for an affected user. What should the developer do?
- A user reports that a code app shows empty grids. In the browser network trace, requests to the environment's dynamics.com endpoint return HTTP 401, while the app shell loads normally. How should the developer interpret this?
- An exception in a deployed code app shows a stack trace pointing into a single minified JavaScript file at line 1, column 48211. The developer needs to find the TypeScript line that threw. What is the most effective approach?
- A developer is restyling several screens in a code app and wants to see each change against real environment data within seconds, without publishing a new version for every edit. What should the developer do?
- A React and Vite code app has grown to 30 routes. Application Insights shows a high time to interactive because the browser downloads one 4 MB JavaScript bundle before showing the home screen. Which change most directly reduces initial load?
- Each row in a code app grid renders a dropdown of 60 cost centers, and every dropdown calls CostCentersService.getAll when it mounts. Cost centers change about once a quarter. The network trace shows hundreds of identical requests per screen. What is the best fix?
- A code app screen shows 200 orders. For each order, it loops over the rows and calls CustomersService.get with the order's customer ID to display the customer name, issuing 200 extra requests. What pattern should replace the loop?