PL-400 developer mechanics
Most PL-400 points depend on exact developer mechanics: which plug-in stage, which API family, which connector setting, which PCF manifest key. This page goes through them one primitive at a time.
First Principle: Choose The Right Primitive
If you get this layer-choice matrix right, a lot of the exam gets easier.
| Requirement shape | Default answer | Why |
|---|---|---|
| Simple model-driven form logic, no code preferred | Business rule | OOTB UI/business logic for simple conditions |
| Model-driven app client-side logic, form events, command behavior | JavaScript + Client API | Runs in the client, targets form/controls/navigation |
| In-transaction server-side business logic | Plug-in | Runs in Dataverse execution pipeline |
| Reusable developer-defined operation callable from code or flow | Custom API | Creates a Dataverse message with request/response contract |
| Async orchestration / approvals / connector-heavy automation | Cloud flow | Good for orchestration, not in-transaction logic |
| Long-running or external compute | Azure Function | Better than plug-ins for long-running work |
| Surface an external REST API into Power Apps / Power Automate | Custom connector | Power Platform-facing wrapper over external API |
| Publish outbound Dataverse events to external systems | Webhook, Service Bus, Event Hub, or business event | Depends on sync vs async and listener model |
| Delta sync between Dataverse and external store | Change tracking | This is the intended delta-sync mechanism |
Trap to avoid
Do not answer "cloud flow" just because automation is mentioned.
Do not answer "custom connector" just because an external system exists.
Do not answer "plug-in" when the question is really about surfacing an operation into flow/app consumption.
Dataverse Plug-ins
Pipeline stages
| Stage | Number | Transaction | Use it when... |
|---|---|---|---|
PreValidation | 10 | Usually outside | Validate early, cancel before main operation |
PreOperation | 20 | Inside | Change incoming values before commit |
MainOperation | 30 | Internal | Not for normal plug-in steps |
PostOperation | 40 | After core operation | React after save; response data exists |
The rules to know cold
PreValidationis the best place to reject an operation.PreOperationis where you change theTargetbefore it is written.MainOperationis internal only except special cases like custom API and virtual table providers.PostOperationis where output data and completed state matter.- External calls are usually better in
PostOperation, often asynchronous.
Execution context
The key object is IPluginExecutionContext.
Cold anchors:
IPluginExecutionContextInputParametersOutputParametersSharedVariablesPreEntityImagesPostEntityImagesParentContext
What each collection means
InputParameters: the incoming operation data. InPreValidationandPreOperation, you can inspect and sometimes change it.OutputParameters: the outgoing response data. These are available after the core operation, so thinkPostOperation.SharedVariables: pass serializable data from one step to a later step in the same pipeline.
Entity images
Use images instead of extra retrievals when the point is comparing old and new values.
Cold rules:
- No
Pre ImageonCreate - No
Post ImageonDelete Post Imageonly makes sense inPostOperation- Only include needed columns; do not select all columns by default
Organization service inside plug-ins
Cold rules:
IOrganizationServiceis for Dataverse SDK-style operations- Do not assume every attribute exists on the retrieved entity
- Defensive pattern: check
Contains/ avoid blind dictionary access - Prefer images over extra retrieve calls when comparing values
Tracing and debugging
Cold anchors:
ITracingServicePluginTraceLogPlug-in Profiler
What matters:
- Use
ITracingService.Tracefor real debug breadcrumbs - Tracing must be enabled in the environment
PluginTraceLogrecords survive transaction rollback- Plug-in Profiler captures execution context and lets you replay in Visual Studio
Profiling sequence
- Install Plug-in Profiler
- Start profiling the registered step
- Trigger the operation in the app
- Capture the profile row
- Replay/debug locally in Visual Studio
- Stop profiling
Plug-in performance rules
- Prefer images over retrieve calls
- Include only needed image columns
- Avoid unnecessary service calls
- Be cautious with recursion/depth
- Keep synchronous logic short and focused
Must-know exam distinctions
PreValidation= rejectPreOperation= mutatePostOperation= reactMainOperation= not your normal answerInputParameters["Target"]= incoming entity/message payload
Custom APIs
Custom APIs are one of the most important "middle layer" concepts on PL-400.
What a custom API is
A custom API creates a new Dataverse message that can be called through:
- Web API
- SDK for .NET
- sometimes workflows / Power Automate, if configured correctly
Function vs Action
| Type | HTTP shape | Mental model |
|---|---|---|
Function | GET | Read-like operation, returns data, no state change |
Action | POST | Operation with side effects or complex inputs |
Cold rules:
Is Function = truemeansGET- Functions must return data
- A function with no response property is invalid and can show as
404 Not Found - If the custom API must be callable as a workflow action,
Is Functionmust befalse
Workflow / Power Automate angle
If the exam stem implies "callable from workflow/flow designer":
Enabled for Workflowmust betrueIs Functionmust befalse- Parameter types are constrained to workflow-supported types
This is the exact kind of detail you were repeatedly missing.
Bound vs unbound
| Shape | Meaning |
|---|---|
Unbound | Global operation |
Entity-bound | Operation runs on one row |
Collection-bound | Operation targets a table collection |
Cold rule:
- Entity-bound custom APIs have an implicit
Targetrequest parameter
Plug-in relationship
- A custom API usually uses a plug-in for main operation logic
- But it does not need a plug-in if you are using it as a business event shell
- The plug-in is set as the custom API's
PluginTypeId - Do not think "register a normal plug-in step" as the execution model for a custom API
Security and visibility
Cold anchors:
Is PrivateExecutePrivilegeName
What they mean:
Is Privatehides the API from$metadataand generated classes, but it does not make the API impossible to call if someone knows it existsExecutePrivilegeNamelets you require an existing Dataverse privilege to invoke the API
Custom APIs vs custom process actions
Exam-safe read:
Custom API= developer-first, more control, code-centricCustom process action= older/no-code message extension pattern
If the stem leans developer, modern extensibility, plug-ins, or reusable operation contracts, expect Custom API.
Dataverse Business Events
Business events are easy to blur together with plug-ins and webhooks. Do not blur them.
Core idea
Business events notify subscribers after the event completes successfully.
Cold rule:
- Business events are not the answer when the logic must cancel or modify the in-flight operation
That is plug-in territory.
Important relationship to custom APIs
- Custom business events can be created by using a custom API
- A custom API can exist without plug-in logic if the purpose is event publication
- Business events expose a message and a web-service endpoint consumers can call or subscribe to
Catalogs and categories
If the exam mentions the Dataverse action trigger in Power Automate:
- Dataverse actions are organized by
Catalog - then
Category - then
Table nameif bound - then
Action name
This matters when flows trigger on actions.
Platform APIs: Web API vs Organization Service
Dataverse Web API
Best mental model:
- REST/OData surface
- HTTP verbs
- good for web apps, JavaScript, and integration clients
Cold anchors:
POSTPATCH@odata.bindPrefer: return=representation- OAuth
Organization Service
Best mental model:
- SDK-style .NET service
- message-based operations
- richer request/response classes for advanced SDK scenarios
Cold anchors:
IOrganizationServiceOrganizationRequestOrganizationResponseUpdateRequestUpsertRequestEntityReference
When to choose which
| Need | Best answer |
|---|---|
| REST integration / JavaScript client / HTTP-first access | Web API |
| SDK messages / .NET code / advanced message types | Organization Service |
| App or flow needs to call a reusable Dataverse message you define | Custom API |
ServiceClient
Cold read:
ServiceClientis the main .NET Dataverse client wrapper- it handles auth setup internally based on connection info
- it can use public or confidential client flows internally
- confidential client == app registration / secret or certificate / service principal style auth
@odata.bind
This is the exact anchor to know for associating an existing related row during create/update.
Cold rule:
- Use
@odata.bindto connect to an existing related row
Prefer: return=representation
Cold rules:
- Returns data from the created/updated row
- Useful when you need the response payload
- Adds extra retrieve cost, so only ask for minimal columns
Optimistic concurrency
Cold anchors:
UpdateRequestConcurrencyBehaviorIfRowVersionMatches
Cold rule:
- In SDK code, optimistic concurrency is an
UpdateRequest/DeleteRequestconcern - Use row version matching when the stem is about preventing overwrite of a newer change
429 / retry / throttling
Cold read:
- Dataverse and connectors have throttling/service-protection limits
429 Too Many Requestsmeans back off and retry- In Power Automate, retry policies matter
- The exam is more likely to test the concept than the raw numeric thresholds
Common traps
- Do not answer Web API when the stem clearly wants SDK message features
- Do not answer Organization Service when the stem is clearly REST/OData
- Do not answer custom API when the question is just standard CRUD against tables
Data Synchronization: Change Tracking, Alternate Keys, Upsert
Change tracking
Best mental model:
- efficient delta sync, not auditing
Cold anchors:
RetrieveEntityChangesRetrieveEntityChangesRequestDataTokenNewOrUpdatedItem
Cold rules:
- First request returns the full table snapshot
- Response returns a version/token for next sync
- Subsequent requests use that token to return only changes since then
- For standard tables, Dataverse typically returns new/updated items first, then deleted items
- If the token is too old, sync breaks and you may need a fresh baseline
What change tracking is not
- not auditing
- not "who changed what"
- not a broad analytics history mechanism
If the stem says "synchronize with external system efficiently," think change tracking.
Alternate keys
Best mental model:
- business-meaningful unique identifiers used for integration
Cold rules:
- Great when external systems do not know Dataverse GUID primary keys
- Alternate keys are common with
Upsert - If key data contains
/ < > * % & : \\ ? +,GETorPATCHbased integration breaks - Therefore, not every "unique business value" is a good alternate key for API integration
Upsert
Cold anchors:
UpsertRequestPATCH- alternate keys
If-Match: *
Cold rules:
Upsert= create if missing, update if present- SDK side often uses
UpsertRequest - Web API side often uses
PATCH - If the URL identifies the record by alternate key, do not also try to update those same key values in the body
If-Match: *forces update semantics instead of create-if-missing behavior
How to separate the three
| Need | Answer |
|---|---|
| Efficient delta sync | Change tracking |
| Uniquely identify records without GUIDs | Alternate keys |
| Create-or-update integration pattern | UpsertRequest / PATCH upsert |
Dataverse Events and Service Endpoints
The choice matrix
| Requirement | Best default |
|---|---|
| In-transaction server-side logic | Plug-in |
| Immediate outbound HTTP endpoint callback | Webhook |
| Durable async Azure messaging | Azure Service Bus |
| Event-stream style Azure listener | Azure Event Hub |
| Dataverse-native event publication after success | Business event |
IServiceEndpointNotificationService
This is a cold anchor term.
Best mental model:
- bridge used by Azure-aware plug-ins to notify the async service to post pipeline data context to Azure Service Bus
Azure-aware plug-ins
Cold rules:
- Dataverse provides an out-of-box Azure-aware plug-in route
- You register a service endpoint in the Plug-in Registration Tool
- You then register a step that identifies the message + table combination
- The plug-in notifies the async service through
IServiceEndpointNotificationService - Microsoft recommends asynchronous registration for best system performance
Security anchor
- Azure Service Bus posting uses
SASauthorization
Service endpoint registration
If the question is about outbound Dataverse integration using Azure messaging infrastructure:
- think
service endpoint - think
Plug-in Registration Tool - think
Service Bus/Event Hub/ webhook registration
What not to confuse
Webhookis not the same thing asService BusBusiness eventis not the same thing as an in-flight plug-inPlug-inis not the same thing as "publish external event"
Custom Connectors
What a custom connector is
A custom connector exposes an external API to:
- Power Apps
- Power Automate
- Copilot Studio / other Power Platform surfaces where supported
Normal build sequence
- Understand the backend API
- Have a stable API definition
- Choose/import from OpenAPI, Azure service, or Postman
- Configure authentication
- Add policy templates if needed
- Add custom code only if policies are not enough
- Test
Authentication choices
| API style | Typical answer |
|---|---|
| API key in header/query | API Key |
| OAuth 2.0 / Entra ID | OAuth 2.0 |
| Simple username/password | Basic |
Policy templates
Best mental model:
- modify connector behavior at runtime without writing code
Common use cases:
- route requests
- set or override values
- host/path shaping
- data conversion
Set Host URL
This is a repeated exact-term miss.
Cold rule:
- Use
Set Host URLwhen the backend host endpoint is dynamic and depends on parameters
Important caveat:
- DLP/custom connector policy evaluation happens before
Set Host URL - So if the stem hints at governance risk, remember dynamic host rewrite does not change how DLP initially classifies the connector
Custom code in connectors
Cold anchors:
ScriptScriptBaseExecuteAsync
Cold rules:
- Custom code is used when policy templates are not enough
- The class must be named
Script - It must implement
ScriptBase - Runtime entry point is
ExecuteAsync - Only one script file is supported
- Code execution has a time limit; do not treat connector code as a long-running compute layer
OpenAPI extension anchors
Cold anchors:
x-ms-capabilitiesx-ms-dynamic-values
What they mean:
x-ms-capabilitiesat operation level can indicate things like chunk-transfer supportx-ms-dynamic-valuesdrives dynamic selectable values for parameters from another operation
Connector vs other tools
Do not default to custom connector when the real need is:
- transaction-safe Dataverse business logic ->
Plug-in - reusable Dataverse message ->
Custom API - long-running backend logic ->
Azure Function
Cloud Flows
Dataverse connector triggers and actions
Cold areas:
- trigger filters
- retry policies
- run context
- service principal connections
Trigger filtering
Best mental model:
- reduce noise and unnecessary runs at the trigger, not after the trigger
Cold read:
- use OData filter conditions for Dataverse triggers
- select only needed columns
- do not pull broad payloads if the trigger can already narrow the scope
Run-as behavior
For When a row is created, modified, or deleted:
Run ascan use the user who modified the row or the row owner- To save those options, the flow owner needs
prvActOnBehalfOfAnotherUseror theDelegaterole
Service principal connections
Cold rules:
- Dataverse connector supports user, guest, and service-principal connections
- Service principal setup requires:
- Entra service principal
- client secret
- Dataverse application user linked to it
- sufficient Dataverse permissions
Sensitive data
Cold anchors:
Secure inputsSecure outputsAzure Key Vault
Cold rules:
- do not hardcode secrets in flows
- use secure inputs/outputs to hide sensitive data in run history
- use Azure Key Vault or environment-variable secret references where appropriate
Azure Key Vault secret environment variables
Cold anchors:
Data Type = SecretSecret Store = Azure Key VaultRetrieveEnvironmentVariableSecretValue
Cold rules:
- Secret environment variables reference Azure Key Vault rather than storing the secret in Dataverse
- Power Automate can retrieve the value via Dataverse unbound action
RetrieveEnvironmentVariableSecretValue - This is the pattern to know, not the exact clicks
Child flows
Cold rules:
- Parent and child should live in the same solution
- Child flow uses
Manually trigger a flow - Parent uses
Run a Child Flow - Parent waits for the child to complete
Retry / throttling
Best mental model:
- 429 or transient connector failures mean retry/backoff is part of the design
The exam is more likely to test:
- "should there be retry handling?"
- "should this trigger be filtered?"
- "should this secret be secured?"
than the exact numeric policy settings.
Environment Variables and ALM
Environment variables
Best mental model:
- ALM-friendly configuration values that move with solutions
Cold rules:
- Values are visible during solution import and pipeline deployment
- If you remove the value before export, the dev environment can keep it while the exported solution does not ship it
- Default, current, and target-environment values are distinct concepts
- Missing current value often means fallback behavior surprises people
Security and ownership
environmentvariabledefinitionis user/team ownedenvironmentvariablevaluepermissions inherit from the definition
Reserved flow names
Avoid environment variable names:
$authentication$connection
Caching / refresh nuance
Environment-variable-based data source references can be cached or slow to reflect changes in some scenarios.
Exam takeaway: do not assume that changing a value instantly rewires every consumer everywhere.
Solutions and layering
Cold anchors:
ManagedUnmanagedActive layerApply upgrade
Cold rules:
- Build in
unmanaged - Deploy to higher environments in
managed - Unmanaged customizations create an active layer that can override managed behavior
- The last managed import can win or merge depending on component type
- Staged upgrades can be flattened with
Apply upgrade - Components with unmanaged layers often do not receive updates cleanly
PCF: Power Apps Component Framework
You improved in client scripting, but PCF is still too brittle.
Lifecycle
Cold anchors:
initupdateViewgetOutputsdestroynotifyOutputChanged
What each one means
| Method | What to remember |
|---|---|
init | initialize component instance, start setup, request resources |
updateView | app/framework changed data or context; refresh UI |
getOutputs | return changed output values back to framework |
destroy | clean up listeners/resources when component unloads |
Core runtime mental model
- User changes something -> component calls
notifyOutputChanged - Framework then asks
getOutputsfor the new value - If the platform changes the data -> framework calls
updateView
Packaging / deployment
Cold anchors:
pac pcf initpac pcf push- solution packaging
- build tools / pipeline packaging
Best mental model:
pac pcf pushis the development/test deployment path- solution packaging is the ALM/deployment path
- for CI/CD, package the control into solutions and use build tools/pipelines
Manifest exactness
This is where exam questions like to get annoyingly specific.
Cold anchors:
feature-usageuses-featurerequired="true"/required="false"
uses-feature rule
If your component wants a feature such as WebAPI or device capability:
- declare it under
feature-usage - then add one or more
uses-featureentries
Cold rules:
- if no
uses-featureitems exist,feature-usageis unnecessary required="true"means the component requires that feature; unsupported host can cause runtime failurerequired="false"means you should code defensively and check whether the feature is available at runtime
Exact recurring anchor
Device.getCurrentPosition
This is the exact kind of thing you can verify in Learn, but you must already know the question is about PCF feature declaration and device capability.
Host support caveat
Do not assume every PCF API is available in every host.
Example: context.webAPI availability differs by host, so check support.
Client Scripting and Model-Driven UX Extension
This lane improved, but a few exact anchors still matter.
Cold anchors:
addPreSearchsetFormNotificationsetNotificationshowProgressIndicatorXrm.WebApi
What they mean
addPreSearch: register lookup filtering logic before searchsetFormNotification: form-level notificationsetNotification: control-level notificationshowProgressIndicator: block/wait UX indicatorXrm.WebApi: client-side Dataverse API access
Key separation
| Need | Answer |
|---|---|
| Filter lookup options before user search | addPreSearch |
| Show form-wide message | setFormNotification |
| Show message on one control | setNotification |
| Call Dataverse from client script | Xrm.WebApi |
Common async trap
Exam-safe read:
Xrm.WebApicalls are asynchronous- if code checks a variable immediately after starting an async request, that check can run before the result arrives
You do not need full syntax memorized, but you do need to recognize the async bug pattern.
Security Feature Selection
These questions are usually about putting the right control in the right layer.
| Requirement | Best default answer |
|---|---|
| Grant or restrict table/row privileges | Security roles |
| Protect a specific sensitive column | Column-level security |
| Show different forms to different audiences | Role-based forms |
| Share a row with specific users/teams | Row sharing |
| Group access and ownership model | Teams / Business units |
| Limit connector mixing and data movement | DLP policies |
Cold trap:
- Do not answer column-level security when the problem is actually form audience or general table privilege
- Do not answer role-based form when the issue is data protection at the field level
Azure Functions For PL-400
This is usually not the hardest lane, but it matters because it overlaps custom connectors and integrations.
Best mental model
Use Azure Functions when the requirement implies:
- long-running work
- scheduled or event-driven external processing
- server-side custom logic outside Dataverse runtime limits
Cold anchors
- scheduled trigger
- event-driven trigger
- managed identity
- HTTP-triggered Azure Function
Exam-safe rules
- If the work is too long or too external for a plug-in, Azure Function becomes much more attractive
- If the function is being surfaced into Power Platform consumption, the exam often pairs it with
custom connector - If auth should avoid stored credentials, think
managed identity
Say it out loud
If you can say these without hesitating, you know the mechanics.
Plug-ins
- "PreValidation rejects, PreOperation mutates, PostOperation reacts."
- "Use images instead of extra retrieves when comparing old and new values."
- "MainOperation is not my normal plug-in answer."
- "Tracing is
ITracingService, and profiling replays captured context."
Custom APIs
- "Function is GET and must return data."
- "Workflow-callable custom API means
Is Function = false." - "Entity-bound custom APIs have implicit
Target." - "The plug-in type belongs on the custom API, not as a normal step registration."
Platform APIs
- "Web API is REST/OData; Organization Service is SDK/message-based."
- "
@odata.bindlinks existing rows." - "
Prefer: return=representationreturns data but costs an extra retrieve." - "Optimistic concurrency is
UpdateRequestplusIfRowVersionMatches."
Integrations
- "Webhook is immediate HTTP; Service Bus is async durable messaging; Event Hub is event streaming."
- "Azure-aware posting uses
IServiceEndpointNotificationService." - "Business events happen after successful completion, not in-flight."
Data sync
- "Change tracking is for delta sync; auditing is not."
- "
RetrieveEntityChangesreturns aDataTokenfor next sync." - "Alternate keys are integration identifiers, but certain characters break GET/PATCH use."
- "
UpsertRequestis create-or-update."
Connectors
- "Policy templates first, custom code second."
- "
Set Host URLis the dynamic endpoint policy template." - "Connector code uses
Script : ScriptBaseandExecuteAsync." - "
x-ms-capabilitiesandx-ms-dynamic-valuesare OpenAPI extension anchors."
Cloud flows
- "Filter at the trigger whenever possible."
- "Secure inputs/outputs hide secrets from run history."
- "Child flows belong in the same solution."
- "Dataverse connector supports service principal connections."
PCF
- "
init,updateView,getOutputs,destroy." - "
notifyOutputChangedtells the framework there are new outputs." - "
uses-featuredeclares required capabilities likeDevice.getCurrentPosition."
Recommended Microsoft Learn Tabs To Keep Handy
- PL-400 study guide
- Register a plug-in
- Understand the execution context
- Debug plug-ins
- Create and use custom APIs
- Microsoft Dataverse business events
- Azure integration for Dataverse
- Use change tracking to synchronize data with external systems
- Use Upsert to create or update a record
- Create a table row using the Web API
- Optimistic concurrency
- Work with alternate keys
- Write code in a custom connector
- Set Host URL policy template
- Create a custom connector with an OpenAPI extension
- Secure data used in cloud flows
- Manage connections for the Dataverse connector
- Create child flows
- Use environment variables in Power Platform solutions
- Use environment variables for Azure Key Vault secrets
- Solution layers and merge behavior
- Code components overview
- Best practices for code components
uses-featuremanifest element