Logo vun Bc Dataverse Entity Generator

Bc Dataverse Entity Generator

Communautéit
fernandoartalf
bc-dataverse-entity-generator

Generates AL CDS integration table objects from Dataverse entities using ALTPGen with PowerShell automation scripts. REQUIRES terminal tools. Automatically determines next available table ID, EXECUTES the generation script via terminal, monitors for errors (especially ALTPGen path issues), auto-fixes configuration problems, handles post-generation file organization to src/Table/ with BCS prefix naming convention, DELETES original generated file to prevent duplicates, and UPDATES permission set automatically. FULLY AUTOMATED workflow - agent executes all commands directly. If terminal tools are unavailable, agent must decline to proceed.

Iwwersiicht

Editeurfernandoartalf
RepositoryAL-Copilot-Skills-Collection
Skill-Nummbc-dataverse-entity-generator
Stären
28
Forks
8
Matgeliwwert Fichieren
7
LizenzMIT
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • 7 matgeliwwert Dateien

    Skripten, Virlagen a Referenzen, déi de Modell beim Schaffe liese kann. D'Dateie kënnen nëmme gelies ginn a ginn ni ausgeféiert.

  • Open Source

    Vum fernandoartalf op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Bc Dataverse Entity Generator an TypingMind, fir e mat all LLM ze benotzen, oder füügt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vun GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier hei drënner an a bestätegt.
    https://github.com/fernandoartalf/AL-Copilot-Skills-Collection/tree/main/skills/bc-dataverse-entity-generator
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill afügen → Vu GitHub-URL, pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an de Skill-Verzeechnes vun deem KI-Agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/fernandoartalf/AL-Copilot-Skills-Collection.git /tmp/AL-Copilot-Skills-Collection
mkdir -p .claude/skills
cp -r /tmp/AL-Copilot-Skills-Collection/skills/bc-dataverse-entity-generator .claude/skills/bc-dataverse-entity-generator
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Bc Dataverse Entity Generator an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Bc Dataverse Entity Generator automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Bc Dataverse Entity Generator net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Keys.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

Business Central Dataverse Entity Generator

Generates AL table objects from Microsoft Dataverse entities using ALTPGen and PowerShell automation. Automates the COMPLETE workflow: table ID allocation, command execution, error detection/fixing, file organization with BCS prefix, original file deletion, and automatic permission set updates.

⚡ FULLY AUTOMATED: Agent takes control of the terminal and executes all commands automatically. User interaction only required for authentication (browser popup for first-time OAuth).

🚨 TERMINAL TOOLS REQUIRED: This skill REQUIRES terminal command execution. If unavailable, agent must decline to proceed.

Prerequisites

  • Terminal tools enabled (REQUIRED)
  • AL Language extension installed in VS Code (includes ALTPGen)
  • Azure AD App Registration with Dynamics CRM > user_impersonation permission
  • Access to target Dataverse environment
  • PowerShell scripts configured in .github/skills/bc-dataverse-entity-generator/scripts/

Automated Workflow

Step 0: Check Terminal Tools Availability

BEFORE starting, verify terminal tools are available:

if terminal tools NOT available:
    ❌ This process requires terminal command execution to be enabled.
    
    The bc-dataverse-entity-generator skill cannot run manually because it requires:
    - Automatic error detection and path fixing
    - Real-time monitoring of ALTPGen output
    - Automated file organization and cleanup
    - Permission set updates
    
    Please enable terminal tools in VS Code agent settings to use this skill.
    
    STOP — do not proceed

Step 1: Analyze Request & Determine Next Table ID

  • Extract entity name from user request (lowercase: "account", "contact", "quote")
  • Scan existing tables in src/Table/*.al
  • Extract table IDs using regex: table\s+(\d+)
  • Find highest ID and add 1
  • Verify within app.json idRanges

Step 2: Execute PowerShell Generation Script

Build and execute command:

powershell
cd .github\skills\bc-dataverse-entity-generator\scripts
powershell -ExecutionPolicy Bypass -File ".\Generate-Entity.ps1" -Entity "{entity}" -BaseId {tableId}

Agent MUST execute directly via terminal tools

Inform user while executing:

Generating {Entity} CDS table...
Entity: {entity}
Table ID: {tableId} (next available)
Note: Browser may prompt for authentication (first run only)

Monitor terminal output for completion or errors.

Step 3: Error Handling & Auto-Fix

ALTPGen Path Error:

  1. Search for altpgen.exe in VS Code extensions: C:\Users\{User}\.vscode\extensions\ms-dynamics-smb.al-*\bin\win32\altpgen\altpgen.exe
  2. Find latest version automatically
  3. Update $AltpgenPath in Generate-Entity.ps1
  4. Re-execute generation script

Base Path Error:

  1. Add extra Split-Path to calculate correct project root
  2. Update script
  3. Re-execute

Other Errors:

  • Authentication: Inform user to complete browser popup
  • Entity not found: Verify entity name (lowercase) exists in Dataverse
  • Duplicate ID: Find next available ID, re-execute with new ID
  • Network: Check ServiceUri and connectivity

Step 4: Post-Generation File Organization

Automatic steps:

  1. Locate generated file in project root (e.g., Account.al, CDSaccount.Table.al)

  2. Read file content and apply BCS prefix:

    • Find table declaration: table \d+ "CDS {Entity}"
    • Update to: table {id} "BCS CDS {Entity}"
  3. Create properly named file:

    • Write content to: src/Table/BCSCDS{Entity}.Table.al
    • Example: Account.al → src/Table/BCSCDSAccount.Table.al
  4. Delete original file from project root to prevent duplicate object errors

  5. Update permission set (AGENTDEMO.permissionset.al):

    • Parse existing Permissions section
    • Add tabledata "BCS CDS {Entity}"=RIMD, in tabledata section (alphabetical order)
    • Add table "BCS CDS {Entity}"=X, in table section (alphabetical order)
    • Maintain proper comma placement (last entry ends with ;)
  6. Confirm completion:

✅ {Entity} CDS table generated successfully!

Created: src/Table/BCSCDS{Entity}.Table.al
Table ID: {tableId}
Table Name: "BCS CDS {Entity}"

✅ Cleaned up: Deleted {originalFile} from project root
✅ Updated: AGENTDEMO.permissionset.al with table permissions

Next steps:
- Review the generated table structure
- Build project: Ctrl+Shift+P → AL: Build
- Test integration with Dataverse environment

Configuration: Sensitive Variables

Scripts contain environment-specific and sensitive values in Generate-Entity.ps1:

VariableTypePurposeHow to Find
$ServiceUriENVIRONMENTDataverse environment URLPower Platform Admin Center > Environments > Environment URL
$ClientIdSECRETAzure AD App Registration client IDAzure Portal > App Registrations > Application (client) ID
$RedirectUriSECRETOAuth redirect URI (auto-generated from ClientId)Format: msal{ClientId}://auth
$AltpgenPathENVIRONMENTPath to ALTPGen.exe (version-specific)VS Code extensions folder (agent can auto-detect)

See script comments for detailed configuration instructions.

Common Entity Names

EntityDescription
accountCustomer/company
contactPerson
leadPotential customer
opportunitySales opportunity
quotePrice quote
salesorderSales order
invoiceCustomer invoice
productProduct/service

Troubleshooting

Error: "ALTPGen tool not found"

Auto-fix: Agent searches for ALTPGen.exe, updates path, re-executes

Error: "Authentication failed"

  • Verify $ClientId is correct
  • Check redirect URI in Azure: msal{ClientId}://auth
  • Ensure user has Dataverse access
  • Check API permissions: Dynamics CRM > user_impersonation

Error: "Entity not found"

  • Verify entity exists in Dataverse
  • Use lowercase schema name (e.g., account, not Account)

Error: "Duplicate table ID" or "Duplicate object"

Auto-fix (ID): Agent rescans for next available ID, re-executes Fix (duplicate object): Check for leftover files in project root; agent should delete automatically

Permission Set Update Details

File structure: namespace AGENTDEMO; permissionset 70000 AGENTDEMO { Assignable = true; Permissions = ... }

Sections order: tabledata → table → codeunit → page

Format:

al
Permissions = 
    tabledata "BCS CDS Account"=RIMD,
    tabledata "BCS CDS Contact"=RIMD,
    table "BCS CDS Account"=X,
    table "BCS CDS Contact"=X,
    codeunit "BCS ..."=X,
    page "BCS ..."=X;

Rules:

  • Maintain alphabetical order within each section
  • Each entry ends with , except the last entry (ends with ;)
  • Use proper spacing and indentation

Quick Reference

Navigate to Scripts

powershell
cd .github\skills\bc-dataverse-entity-generator\scripts

Generate Single Entity (Manual)

powershell
powershell -ExecutionPolicy Bypass -File ".\Generate-Entity.ps1" -Entity "account" -BaseId 70004

Find Next Table ID (Manual)

powershell
Get-ChildItem ..\..\..\..\src\Table\*.al | 
  ForEach-Object { if ((Get-Content $_.FullName -Raw) -match 'table\s+(\d+)') { [int]$matches[1] } } | 
  Sort-Object | Select-Object -Last 1

Script Locations

.github/skills/bc-dataverse-entity-generator/
├── SKILL.md                          # This file
├── scripts/
│   ├── Generate-Entity.ps1           # Single entity generator (with sensitive variable documentation)
│   └── Generate-Entity-List.ps1      # Batch entity generator

External Resources

Agent Workflow Summary

  1. ✅ Check terminal tools available (STOP if not)
  2. ✅ Extract entity name, determine next table ID
  3. ✅ Execute PowerShell script via terminal
  4. ✅ Monitor output, auto-fix errors (ALTPGen path, base path)
  5. ✅ Locate generated file in project root
  6. ✅ Apply BCS prefix, create file in src/Table/
  7. ✅ Delete original file from project root
  8. ✅ Update AGENTDEMO.permissionset.al automatically
  9. ✅ Confirm completion with file paths and next steps

Matgeliwwert Fichieren

De Modell liest dës Dateie bei Bedarf, wärend de Skill gelueden ass. Si ginn als liesbar Dateie bereetgestallt a ginn ni ausgeféiert.

Heefeg gestallte Froen

Wat mécht de KI-Skill Bc Dataverse Entity Generator?

Generates AL CDS integration table objects from Dataverse entities using ALTPGen with PowerShell automation scripts. REQUIRES terminal tools. Automatically determines next available table ID, EXECUTES the generation script via terminal, monitors for errors (especially ALTPGen path issues), auto-fixes configuration problems, handles post-generation file organization to src/Table/ with BCS prefix naming convention, DELETES original generated file to prevent duplicates, and UPDATES permission set automatically. FULLY AUTOMATED workflow - agent executes all commands directly. If terminal tools...

Firwat Bc Dataverse Entity Generator op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Bc Dataverse Entity Generator besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt amplaz vun engem Abonnement pro Benotzerplaz. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Bc Dataverse Entity Generator an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/fernandoartalf/AL-Copilot-Skills-Collection/tree/main/skills/bc-dataverse-entity-generator an. TypingMind liest d'Datei SKILL.md, bündelt déi zougehéiereg Dateien an installéiert dat Ganzt als Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Bc Dataverse Entity Generator benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Bc Dataverse Entity Generator benotzen?

Esou vill Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Bc Dataverse Entity Generator domat benotzen – GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama a méi – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Bc Dataverse Entity Generator gratis?

Jo. De Skill gëtt vum fernandoartalf ënner der Lizenz MIT op GitHub publizéiert. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbaart Pak vun Instruktiounen, dat engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt en nokënnt a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a keng Lafzäitëmfeld a funktionéiere mat all Modell.

All weisen

Elo Ären eegene KI-Workspace ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇