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?
Select an answer to reveal the explanation.
Short Explanation
Think of the generated service as a remote control the CLI hands you for each table. Create, update and delete are already buttons on it, and update and delete just need the row's ID. The trap is reaching for Xrm.WebApi, which belongs to model-driven forms, not to code apps.
Full Explanation
Adding a Dataverse table to a code app generates a model file that describes the table's shape and a service file that exposes data operations. For the account table, the generated AccountsService provides create, get, getAll, update and delete. Create takes a record object built from the model, excluding system-managed columns such as the primary key and owner; update takes the primary key plus only the changed columns; delete takes the primary key. The client library handles authentication and routing, so the app never builds raw HTTP requests. Xrm.WebApi is part of the model-driven Client API, available to form scripts and web resources; a code app runs in its own host and does not receive that object. Hand-built fetch calls with a token copied from a portal session break authentication, are blocked by the default connect-src policy, and bypass the managed data path. The model file defines types only; it has no persistence methods such as save or remove. Exam caveat: on update, sending unchanged columns counts as a change and can fire plug-ins or audit entries, so send only what changed. Operational check: open the generated service file, confirm the method signatures, and test an update that sends a single changed column.