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?
Select an answer to reveal the explanation.
Short Explanation
Generated files are like a printout from the database schema: next time you print, your margin notes disappear. You put your own logic in your own modules and let the CLI regenerate its files when the schema changes.
Full Explanation
When a data source is added to a code app, the Power Apps CLI generates a typed model describing the data and a service that exposes operations such as create, get, getAll, update and delete through the Power Apps client library. These files are derived from the data source's schema. When the schema changes, the documented step is to refresh the data source, which regenerates the model and service files, so any manual edits inside them are lost and a hand-changed property type can drift from the real schema and fail at runtime. The supported pattern is to treat generated files as read-only and put validation, mapping and other business logic in the app's own modules that import and wrap the generated service. Claiming the files are never touched again is false, because refresh exists precisely to regenerate them. Replacing generated services with raw fetch calls discards the typed, authenticated client the platform provides and bypasses the data source registration the app depends on. Removing the data source while keeping copies of its files leaves the app without the registered connection behind those calls, so the copies would not work. Exam caveat: source control makes accidental edits to generated files visible, so reviewing diffs after a refresh is a useful habit. Operational check: change a column in the SQL table, refresh the data source, and confirm the model updates while the wrapper module still compiles.