aurelienclere-365/d365fo-cowork-plugin/d365fo-extension-strategy

Trust tier 3
  • community
  • ext:[{"type":"hook","description":"Pre/post lifecycle hooks"}]
Source check pending

Checking that the SKILL.md file is still in the repository.

Use when user asks how to extend or customize D365FO without overlayering base code. "how to extend VendTable without overlayering", "best way to add a field to SalesTable", "can I use CoC for PurchFormLetter", "extension point for SalesLine validation", "how to add logic when a customer is saved", "modify behavior of CustPostInvoice class", "extend a form without touching base objects", "what extension strategy should I use", "difference between CoC and event handler"

Install

npx vskill@latest install aurelienclere-365/d365fo-cowork-plugin/d365fo-extension-strategy

Semi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard

SKILL.md

D365FO Extension Strategy

Recommend the correct extension pattern for D365FO customizations that avoid overlayering. This is a prompt-only skill — it does not call MCP tools but applies D365FO extension best practices directly.

When to use

  • User wants to add custom fields, logic, or UI to a standard D365FO object
  • User asks which extension API to use (CoC, Event Handler, Table Extension, Form Extension)
  • User asks whether a specific class or table supports a particular extension type
  • User needs an X++ code skeleton to start from
  • User asks about the difference between CoC and Data Event Handlers

Workflow (prompt-only — no MCP tools required)

  1. Understand what the user needs to change:
  • Add a field -> Table Extension
  • Add a UI control -> Form Extension
  • Override method behavior -> Chain of Command (CoC)
  • React to data events (insert / update / delete) -> Data Event Handler or CoC on table
  • Add a menu item -> New Action Menu Item + new class or form
  • Extend security -> Security Extension (Privilege/Duty)
  1. Apply the decision guide (see below).
  1. Provide a code skeleton from references/extension-patterns.md.
  1. Flag constraints for the chosen pattern (e.g., CoC requires next, table extensions

cannot change existing field types).

  1. Recommend using `find_coc_extensions` (via the d365fo-class-analysis skill) to

check whether another extension already wraps the same method before creating a new one.

Decision Guide

ScenarioRecommended PatternKey Constraint
Add custom fieldTable ExtensionCannot change existing field base types
Override class methodChain of CommandMust call next — class must support CoC
React to table insert/updateCoC on table OR Data Event HandlerEvent Handler = post-commit, no rollback
Intercept and change return valueChain of Command onlyEvent Handlers cannot modify return values
Add form controlForm Extension + event handlerCannot reorder existing controls
Add menu item to existing menuMenu ExtensionNew class or form required
Restrict/grant access to new fieldSecurity Extension (Privilege)Must wire to a Duty and a Role
Cross-model loose couplingData Event HandlerRuns after commit — cannot be cancelled

Code Skeleton: CoC on a class method

x++
[ExtensionOf(classStr(TargetClass))]
final class TargetClass_YourModel_Extension
{
public ReturnType methodName(ParamType param)
{
// Code here runs BEFORE the original method (pre-processing)
ReturnType result = next methodName(param); // calls the original (required)
// Code here runs AFTER the original method (post-processing)
return result;
}
}

Code Skeleton: Data Event Handler

x++
[DataEventHandler(tableStr(SalesTable), DataEventType::Inserted)]
public static void SalesTable_onInserted(Common _record, DataEventArgs _eventArgs)
{
SalesTable salesTable = _record as SalesTable;
// Runs after every SalesTable.insert() — post-commit, cannot rollback
}

See references/extension-patterns.md for full skeletons covering table extensions, form extensions, and security extensions.

Notes

  • Never overlayer objects outside your own model. All changes must be extensions.
  • CoC > Event Handler when you need to intercept and modify behavior or parameters.
  • Event Handler > CoC when you need loose coupling or only need to react post-commit.
  • Always check for existing CoC extensions (via d365fo-class-analysis) before writing a

new one — conflicting next chains cause hard-to-debug runtime issues.

Security

  • Security scanPassed, 95 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
5

Not refreshed yet.

Extension points

  • hookPre/post lifecycle hooks

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/aurelienclere-365/d365fo-cowork-plugin/d365fo-extension-strategy/badge)](https://verified-skill.com/skills/aurelienclere-365/d365fo-cowork-plugin/d365fo-extension-strategy)

Something wrong with this skill or its page? Tell us.