NW CRM Project — Manual

NW CRM Project

Integración Business Central ↔ Dataverse (Dynamics 365 Sales) — niccoweb.com

BC 26.0 + Dataverse
📋 Información general
PublicadorNiccoWeb
Versión26.0.0.0
Runtime AL15.0
Rango de ID50130–50149
DependenciasNinguna
IntegraciónCDS / Dataverse
ℹ️ ¿Qué hace este proyecto?
NW CRM Project no es un CRM construido desde cero: es una personalización del conector nativo de Business Central hacia Microsoft Dataverse (el motor que usa BC para integrarse con Dynamics 365 Sales). El proyecto define tablas proxy (CDS) que reflejan entidades de Dataverse —estándar (Account, Team, SystemUser) y a medida (Project, Vendedor, Resource, Default Dimension)— y registra 4 Integration Table Mappings para que Business Central sincronice Jobs, Vendedores, Recursos y Dimensiones por Defecto con esas entidades, usando el motor de sincronización y la cola de trabajos (Job Queue) que ya trae BC de fábrica.

🗄️ Tabla BCJob · Resource · Salesperson · Default Dimension
🧩 Integration Table MappingMotor nativo de BC
📦 Tabla CDS (proxy AL)Generada con altpgen
☁️ DataverseDynamics 365 Sales
💡 La dirección varía por entidad: Proyectos, Vendedores y Recursos sincronizan en un solo sentido (BC → Dataverse); las Dimensiones por Defecto sincronizan en ambos sentidos.
Funciones principales
📦

Tablas proxy CDS

Reflejan entidades estándar (Account, Team, SystemUser) y a medida (mac_Project, cr743_Vendedor, cr743_Resource, cr743_newtable) generadas con el AL Table Proxy Generator.

🔗

4 mapeos listos

Project, DimensionDefault, Vendedor y Resource se registran automáticamente al ejecutar "Reset Configuration" en BC.

🖱️

Acoplamiento por registro

Acciones "Set Up Coupling", "Synchronize", "Synchronization Log" y "Delete Coupling" añadidas a Job List/Card, Default Dimensions y Resource List.

⏱️

Sincronización programada

Cada mapeo crea su propia entrada de Job Queue: cada 2 min para Proyectos, cada 30 min para Dimensiones, Vendedores y Recursos.

🗑️

Borrado en cascada

Al eliminar un Job en BC, se elimina automáticamente el Proyecto de Dataverse acoplado.

↔️

Dirección configurable

Las Dimensiones por Defecto sincronizan en ambos sentidos; Proyectos, Vendedores y Recursos solo de BC hacia Dataverse.

🔢

Enum de ejemplo

Un campo Enum ("Test": a/b) en Job muestra cómo mapear opciones de BC a columnas de elección en Dataverse.

🛠️

Framework nativo de Microsoft

Todo se apoya en el conector CDS/Dataverse soportado por Microsoft: sin middleware ni API externas.

⚙️ Configuración inicial
  • 1
    En el entorno de Dataverse, crea las entidades a medida (mac_Project, cr743_newtable, cr743_Vendedor, cr743_Resource) con las columnas necesarias.
  • 2
    Ejecuta el AL Table Proxy Generator (altpgen, incluido con la extensión AL de VS Code) contra ese entorno para (re)generar las tablas CDS proxy.
  • 3
    Publica esta extensión en BC y configura la conexión en la página estándar de Dataverse Connection Setup (URL del entorno y credenciales).
  • 4
    Ejecuta Reset Configuration en la configuración de Dataverse: esto crea los 4 Integration Table Mappings y sus tareas de Job Queue automáticamente.
🚀 Uso diario
  • 1
    Abre un Job, Resource o Default Dimension en Business Central.
  • 2
    Usa el nuevo grupo de acciones Dataverse → Set Up Coupling para enlazarlo con la fila correspondiente (o crearla).
  • 3
    Pulsa Synchronize para enviar/recibir los cambios al instante, o deja que la tarea programada lo haga sola.
  • 4
    Revisa Synchronization Log para ver el historial de sincronización de cada registro.
  • 5
    Al borrar un Job acoplado, su Proyecto en Dataverse se elimina automáticamente.
📦 Objetos AL
TipoNombreDescripción
Tabla CDSCDS mac_ProjectProxy de la entidad a medida de Proyectos en Dataverse
Tabla CDSCDS SystemUserProxy de usuarios de Dataverse (entidad estándar)
Tabla CDSCDS TeamProxy de equipos de Dataverse (entidad estándar)
Tabla CDSCDS AccountProxy de cuentas/clientes de Dataverse (entidad estándar)
Tabla CDSCDS cr743_ResourceProxy de la entidad a medida de Recursos
Tabla CDSCDS cr743_newtableProxy de la entidad a medida de Dimensiones por Defecto
Tabla CDSCDS cr743_VendedorProxy de la entidad a medida de Vendedores
TablaExtJob (50130)Añade "Coupled to Dataverse" (FlowField) y "Enum Test"; borra el Proyecto acoplado al eliminar el Job
TablaExtDefault DimensionAñade el FlowField "Coupled to Dataverse"
PáginaCDS Project ListLista de solo lectura de Proyectos en Dataverse, con acción "Create in Business Central"
PáginaCDS Dimension Default ListLista de solo lectura de Dimensiones por Defecto en Dataverse
PáginaCDS Vendedor ListLista de solo lectura de Vendedores en Dataverse
PáginaCDS Resource ListLista de solo lectura de Recursos en Dataverse
PáginaExtJob ListAñade el campo Enum Test y el grupo de acciones "Dataverse" (acoplar, sincronizar, log)
PáginaExtJob CardAñade el campo Enum Test a la ficha del Job
PáginaExtDefault DimensionsAñade el estado de acoplamiento y el grupo de acciones "Dataverse" con coincidencia automática
PáginaExtResource ListAñade el estado de acoplamiento y el grupo de acciones "Dataverse"
EnumTestValores de ejemplo (a / b) para demostrar el mapeo de opciones BC ↔ Dataverse
CodeunitCDSDataverseEventSuscriptor de eventos que registra las tablas CDS y crea los 4 Integration Table Mappings
⚠️ Esta extensión no incluye un conjunto de permisos propio: concede acceso mediante SUPER o un permission set personalizado que cubra los objetos anteriores.
🗂️ Entidades a medida en Dataverse
Las tablas CDS estándar (Account, Team, SystemUser) replican el esquema completo de Dataverse —decenas de campos de contacto, direcciones, auditoría y clasificación—. Las cuatro entidades a medida son las que de verdad importan para esta integración:

Entidad DataverseTabla CDS (AL)Campos clave
mac_projectCDS mac_Projectmac_Name, mac_SearchDescription, mac_Description(2), mac_StartingDate, mac_EndingDate, cr743_EnumTest, cr743_SelltoCustomerNo, cr743_customerName (lookup a Account)
cr743_newtableCDS cr743_newtablecr743_Newcolumn, cr743_No, cr743_DimensionCode, cr743_DimensionValueCode
cr743_vendedorCDS cr743_Vendedorcr743_Code, cr743_Name
cr743_resourceCDS cr743_Resourcecr743_No, cr743_ResourceType (Persona/Máquina), cr743_Address
El prefijo cr743_ / mac_ es el prefijo de solución autogenerado por el entorno de Dataverse usado para crear estas entidades; cada entorno tiene el suyo propio.
🔁 Integration Table Mappings
El codeunit CDSDataverseEvent se suscribe a OnAfterResetConfiguration de "CDS Setup Defaults" y crea estos cuatro mapeos automáticamente:

MapeoTabla BCTabla DataverseDirecciónIntervalo
ProjectJobCDS mac_ProjectBC → Dataverse2 min
DimensionDefaultDefault DimensionCDS cr743_newtableBidireccional30 min
VendedorSalesperson/PurchaserCDS cr743_VendedorBC → Dataverse30 min
ResourceResourceCDS cr743_ResourceBC → Dataverse30 min
📌 Mapeo de campos — Job: No.→mac_Name, Search Description→mac_SearchDescription, Description(2)→mac_Description(2), Starting/Ending Date→mac_StartingDate/EndingDate, Enum Test→cr743_EnumTest, Sell-to Customer No.→cr743_SelltoCustomerNo/cr743_customerName. 📌 Default Dimension: Table ID↔cr743_Newcolumn, No.↔cr743_No, Dimension Code↔cr743_DimensionCode, Dimension Value Code↔cr743_DimensionValueCode. 📌 Salesperson/Purchaser: Code→cr743_Code, Name→cr743_Name. · Resource: No.→cr743_No, Type→cr743_ResourceType, Address→cr743_Address. ⏱️ Cada mapeo crea su propia entrada de Job Queue (codeunit "Integration Synch. Job Runner") con hasta 10 reintentos y un tiempo de inactividad de 720 minutos.
📝 Requisitos previos
  • Business Central versión 26.0 o posterior.
  • Un entorno de Dynamics 365 Sales / Dataverse activo, con las entidades a medida ya creadas.
  • La conexión CDS/Dataverse habilitada y configurada en BC (Azure AD + URL del entorno).
  • El AL Table Proxy Generator (altpgen) para regenerar las tablas proxy si cambian las entidades en Dataverse.

NW CRM Project

Business Central ↔ Dataverse (Dynamics 365 Sales) integration — niccoweb.com

BC 26.0 + Dataverse
📋 General Information
PublisherNiccoWeb
Version26.0.0.0
AL Runtime15.0
ID Range50130–50149
DependenciesNone
IntegrationCDS / Dataverse
ℹ️ What does this project do?
NW CRM Project is not a CRM built from scratch — it's a customization of Business Central's native connector to Microsoft Dataverse (the engine BC uses to integrate with Dynamics 365 Sales). The project defines CDS proxy tables that mirror Dataverse entities — standard ones (Account, Team, SystemUser) and custom ones (Project, Vendedor, Resource, Default Dimension) — and registers 4 Integration Table Mappings so Business Central synchronizes Jobs, Salespeople, Resources and Default Dimensions with those entities, using BC's own built-in synchronization engine and Job Queue.

🗄️ BC TableJob · Resource · Salesperson · Default Dimension
🧩 Integration Table MappingBC's native engine
📦 CDS Table (AL proxy)Generated with altpgen
☁️ DataverseDynamics 365 Sales
💡 Direction varies by entity: Projects, Salespeople and Resources sync one-way (BC → Dataverse); Default Dimensions sync both ways.
Key Features
📦

CDS proxy tables

Mirror standard entities (Account, Team, SystemUser) and custom ones (mac_Project, cr743_Vendedor, cr743_Resource, cr743_newtable) generated with the AL Table Proxy Generator.

🔗

4 ready-made mappings

Project, DimensionDefault, Vendedor and Resource are registered automatically when running "Reset Configuration" in BC.

🖱️

Per-record coupling

"Set Up Coupling", "Synchronize", "Synchronization Log" and "Delete Coupling" actions added to Job List/Card, Default Dimensions and Resource List.

⏱️

Scheduled synchronization

Each mapping creates its own Job Queue entry: every 2 min for Projects, every 30 min for Dimensions, Salespeople and Resources.

🗑️

Cascade delete

Deleting a Job in BC automatically deletes its coupled Dataverse Project.

↔️

Configurable direction

Default Dimensions sync both ways; Projects, Salespeople and Resources only flow from BC to Dataverse.

🔢

Sample enum

An example Enum ("Test": a/b) on Job shows how to map BC option fields to Dataverse choice columns.

🛠️

Native Microsoft framework

Everything rides on the supported CDS/Dataverse connector: no middleware or external APIs.

⚙️ Initial Setup
  • 1
    In the Dataverse environment, create the custom entities (mac_Project, cr743_newtable, cr743_Vendedor, cr743_Resource) with the required columns.
  • 2
    Run the AL Table Proxy Generator (altpgen, shipped with the AL extension for VS Code) against that environment to (re)generate the CDS proxy tables.
  • 3
    Publish this extension in BC and configure the connection on the standard Dataverse Connection Setup page (environment URL and credentials).
  • 4
    Run Reset Configuration on the Dataverse setup page — this creates the 4 Integration Table Mappings and their Job Queue entries automatically.
🚀 Day-to-Day Usage
  • 1
    Open a Job, Resource or Default Dimension in Business Central.
  • 2
    Use the new Dataverse → Set Up Coupling action group to link it to (or create) the matching Dataverse row.
  • 3
    Click Synchronize to push/pull changes immediately, or let the scheduled job handle it.
  • 4
    Check Synchronization Log to review a record's sync history.
  • 5
    Deleting a coupled Job automatically deletes its linked Dataverse Project.
📦 AL Objects
TypeNameDescription
CDS TableCDS mac_ProjectProxy for the custom Project entity in Dataverse
CDS TableCDS SystemUserProxy for Dataverse users (standard entity)
CDS TableCDS TeamProxy for Dataverse teams (standard entity)
CDS TableCDS AccountProxy for Dataverse accounts/customers (standard entity)
CDS TableCDS cr743_ResourceProxy for the custom Resource entity
CDS TableCDS cr743_newtableProxy for the custom Default Dimension entity
CDS TableCDS cr743_VendedorProxy for the custom Salesperson entity
TableExtJob (50130)Adds "Coupled to Dataverse" (FlowField) and "Enum Test"; deletes the coupled Project when the Job is deleted
TableExtDefault DimensionAdds the "Coupled to Dataverse" FlowField
PageCDS Project ListRead-only list of Dataverse Projects, with a "Create in Business Central" action
PageCDS Dimension Default ListRead-only list of Dataverse Default Dimensions
PageCDS Vendedor ListRead-only list of Dataverse Salespeople
PageCDS Resource ListRead-only list of Dataverse Resources
PageExtJob ListAdds the Enum Test field and the "Dataverse" action group (couple, sync, log)
PageExtJob CardAdds the Enum Test field to the Job card
PageExtDefault DimensionsAdds the coupling status and the "Dataverse" action group with match-based coupling
PageExtResource ListAdds the coupling status and the "Dataverse" action group
EnumTestSample values (a / b) demonstrating BC ↔ Dataverse option mapping
CodeunitCDSDataverseEventEvent subscriber that registers the CDS tables and creates the 4 Integration Table Mappings
⚠️ This extension ships without its own permission set: grant access via SUPER or a custom permission set covering the objects above.
🗂️ Custom Dataverse Entities
The standard CDS tables (Account, Team, SystemUser) mirror Dataverse's full schema — dozens of contact, address, audit and classification fields. The four custom entities are what actually matter for this integration:

Dataverse EntityCDS Table (AL)Key Fields
mac_projectCDS mac_Projectmac_Name, mac_SearchDescription, mac_Description(2), mac_StartingDate, mac_EndingDate, cr743_EnumTest, cr743_SelltoCustomerNo, cr743_customerName (lookup to Account)
cr743_newtableCDS cr743_newtablecr743_Newcolumn, cr743_No, cr743_DimensionCode, cr743_DimensionValueCode
cr743_vendedorCDS cr743_Vendedorcr743_Code, cr743_Name
cr743_resourceCDS cr743_Resourcecr743_No, cr743_ResourceType (Person/Machine), cr743_Address
The cr743_ / mac_ prefix is the auto-generated solution prefix of the Dataverse environment used to create these entities; every environment has its own.
🔁 Integration Table Mappings
The CDSDataverseEvent codeunit subscribes to OnAfterResetConfiguration on "CDS Setup Defaults" and creates these four mappings automatically:

MappingBC TableDataverse TableDirectionInterval
ProjectJobCDS mac_ProjectBC → Dataverse2 min
DimensionDefaultDefault DimensionCDS cr743_newtableBidirectional30 min
VendedorSalesperson/PurchaserCDS cr743_VendedorBC → Dataverse30 min
ResourceResourceCDS cr743_ResourceBC → Dataverse30 min
📌 Job field mapping: No.→mac_Name, Search Description→mac_SearchDescription, Description(2)→mac_Description(2), Starting/Ending Date→mac_StartingDate/EndingDate, Enum Test→cr743_EnumTest, Sell-to Customer No.→cr743_SelltoCustomerNo/cr743_customerName. 📌 Default Dimension: Table ID↔cr743_Newcolumn, No.↔cr743_No, Dimension Code↔cr743_DimensionCode, Dimension Value Code↔cr743_DimensionValueCode. 📌 Salesperson/Purchaser: Code→cr743_Code, Name→cr743_Name. · Resource: No.→cr743_No, Type→cr743_ResourceType, Address→cr743_Address. ⏱️ Each mapping creates its own Job Queue entry (codeunit "Integration Synch. Job Runner") with up to 10 retry attempts and a 720-minute inactivity timeout.
📝 Prerequisites
  • Business Central version 26.0 or higher.
  • An active Dynamics 365 Sales / Dataverse environment with the custom entities already created.
  • The CDS/Dataverse connection enabled and configured in BC (Azure AD + environment URL).
  • The AL Table Proxy Generator (altpgen) to regenerate proxy tables if the Dataverse entities change.

Comentarios