NW CRM Project
Integración Business Central ↔ Dataverse (Dynamics 365 Sales) — niccoweb.com
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.
- 1En el entorno de Dataverse, crea las entidades a medida (mac_Project, cr743_newtable, cr743_Vendedor, cr743_Resource) con las columnas necesarias.
- 2Ejecuta 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.
- 3Publica 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).
- 4Ejecuta Reset Configuration en la configuración de Dataverse: esto crea los 4 Integration Table Mappings y sus tareas de Job Queue automáticamente.
- 1Abre un Job, Resource o Default Dimension en Business Central.
- 2Usa el nuevo grupo de acciones Dataverse → Set Up Coupling para enlazarlo con la fila correspondiente (o crearla).
- 3Pulsa Synchronize para enviar/recibir los cambios al instante, o deja que la tarea programada lo haga sola.
- 4Revisa Synchronization Log para ver el historial de sincronización de cada registro.
- 5Al borrar un Job acoplado, su Proyecto en Dataverse se elimina automáticamente.
| Tipo | Nombre | Descripción |
|---|---|---|
| Tabla CDS | CDS mac_Project | Proxy de la entidad a medida de Proyectos en Dataverse |
| Tabla CDS | CDS SystemUser | Proxy de usuarios de Dataverse (entidad estándar) |
| Tabla CDS | CDS Team | Proxy de equipos de Dataverse (entidad estándar) |
| Tabla CDS | CDS Account | Proxy de cuentas/clientes de Dataverse (entidad estándar) |
| Tabla CDS | CDS cr743_Resource | Proxy de la entidad a medida de Recursos |
| Tabla CDS | CDS cr743_newtable | Proxy de la entidad a medida de Dimensiones por Defecto |
| Tabla CDS | CDS cr743_Vendedor | Proxy de la entidad a medida de Vendedores |
| TablaExt | Job (50130) | Añade "Coupled to Dataverse" (FlowField) y "Enum Test"; borra el Proyecto acoplado al eliminar el Job |
| TablaExt | Default Dimension | Añade el FlowField "Coupled to Dataverse" |
| Página | CDS Project List | Lista de solo lectura de Proyectos en Dataverse, con acción "Create in Business Central" |
| Página | CDS Dimension Default List | Lista de solo lectura de Dimensiones por Defecto en Dataverse |
| Página | CDS Vendedor List | Lista de solo lectura de Vendedores en Dataverse |
| Página | CDS Resource List | Lista de solo lectura de Recursos en Dataverse |
| PáginaExt | Job List | Añade el campo Enum Test y el grupo de acciones "Dataverse" (acoplar, sincronizar, log) |
| PáginaExt | Job Card | Añade el campo Enum Test a la ficha del Job |
| PáginaExt | Default Dimensions | Añade el estado de acoplamiento y el grupo de acciones "Dataverse" con coincidencia automática |
| PáginaExt | Resource List | Añade el estado de acoplamiento y el grupo de acciones "Dataverse" |
| Enum | Test | Valores de ejemplo (a / b) para demostrar el mapeo de opciones BC ↔ Dataverse |
| Codeunit | CDSDataverseEvent | Suscriptor de eventos que registra las tablas CDS y crea los 4 Integration Table Mappings |
| Entidad Dataverse | Tabla CDS (AL) | Campos clave |
|---|---|---|
mac_project | CDS mac_Project | mac_Name, mac_SearchDescription, mac_Description(2), mac_StartingDate, mac_EndingDate, cr743_EnumTest, cr743_SelltoCustomerNo, cr743_customerName (lookup a Account) |
cr743_newtable | CDS cr743_newtable | cr743_Newcolumn, cr743_No, cr743_DimensionCode, cr743_DimensionValueCode |
cr743_vendedor | CDS cr743_Vendedor | cr743_Code, cr743_Name |
cr743_resource | CDS cr743_Resource | cr743_No, cr743_ResourceType (Persona/Máquina), cr743_Address |
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.
| Mapeo | Tabla BC | Tabla Dataverse | Dirección | Intervalo |
|---|---|---|---|---|
Project | Job | CDS mac_Project | BC → Dataverse | 2 min |
DimensionDefault | Default Dimension | CDS cr743_newtable | Bidireccional | 30 min |
Vendedor | Salesperson/Purchaser | CDS cr743_Vendedor | BC → Dataverse | 30 min |
Resource | Resource | CDS cr743_Resource | BC → Dataverse | 30 min |
- ✓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
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.
- 1In the Dataverse environment, create the custom entities (mac_Project, cr743_newtable, cr743_Vendedor, cr743_Resource) with the required columns.
- 2Run the AL Table Proxy Generator (altpgen, shipped with the AL extension for VS Code) against that environment to (re)generate the CDS proxy tables.
- 3Publish this extension in BC and configure the connection on the standard Dataverse Connection Setup page (environment URL and credentials).
- 4Run Reset Configuration on the Dataverse setup page — this creates the 4 Integration Table Mappings and their Job Queue entries automatically.
- 1Open a Job, Resource or Default Dimension in Business Central.
- 2Use the new Dataverse → Set Up Coupling action group to link it to (or create) the matching Dataverse row.
- 3Click Synchronize to push/pull changes immediately, or let the scheduled job handle it.
- 4Check Synchronization Log to review a record's sync history.
- 5Deleting a coupled Job automatically deletes its linked Dataverse Project.
| Type | Name | Description |
|---|---|---|
| CDS Table | CDS mac_Project | Proxy for the custom Project entity in Dataverse |
| CDS Table | CDS SystemUser | Proxy for Dataverse users (standard entity) |
| CDS Table | CDS Team | Proxy for Dataverse teams (standard entity) |
| CDS Table | CDS Account | Proxy for Dataverse accounts/customers (standard entity) |
| CDS Table | CDS cr743_Resource | Proxy for the custom Resource entity |
| CDS Table | CDS cr743_newtable | Proxy for the custom Default Dimension entity |
| CDS Table | CDS cr743_Vendedor | Proxy for the custom Salesperson entity |
| TableExt | Job (50130) | Adds "Coupled to Dataverse" (FlowField) and "Enum Test"; deletes the coupled Project when the Job is deleted |
| TableExt | Default Dimension | Adds the "Coupled to Dataverse" FlowField |
| Page | CDS Project List | Read-only list of Dataverse Projects, with a "Create in Business Central" action |
| Page | CDS Dimension Default List | Read-only list of Dataverse Default Dimensions |
| Page | CDS Vendedor List | Read-only list of Dataverse Salespeople |
| Page | CDS Resource List | Read-only list of Dataverse Resources |
| PageExt | Job List | Adds the Enum Test field and the "Dataverse" action group (couple, sync, log) |
| PageExt | Job Card | Adds the Enum Test field to the Job card |
| PageExt | Default Dimensions | Adds the coupling status and the "Dataverse" action group with match-based coupling |
| PageExt | Resource List | Adds the coupling status and the "Dataverse" action group |
| Enum | Test | Sample values (a / b) demonstrating BC ↔ Dataverse option mapping |
| Codeunit | CDSDataverseEvent | Event subscriber that registers the CDS tables and creates the 4 Integration Table Mappings |
| Dataverse Entity | CDS Table (AL) | Key Fields |
|---|---|---|
mac_project | CDS mac_Project | mac_Name, mac_SearchDescription, mac_Description(2), mac_StartingDate, mac_EndingDate, cr743_EnumTest, cr743_SelltoCustomerNo, cr743_customerName (lookup to Account) |
cr743_newtable | CDS cr743_newtable | cr743_Newcolumn, cr743_No, cr743_DimensionCode, cr743_DimensionValueCode |
cr743_vendedor | CDS cr743_Vendedor | cr743_Code, cr743_Name |
cr743_resource | CDS cr743_Resource | cr743_No, cr743_ResourceType (Person/Machine), cr743_Address |
cr743_ / mac_ prefix is the auto-generated solution prefix of the Dataverse environment used to create these entities; every environment has its own.
| Mapping | BC Table | Dataverse Table | Direction | Interval |
|---|---|---|---|---|
Project | Job | CDS mac_Project | BC → Dataverse | 2 min |
DimensionDefault | Default Dimension | CDS cr743_newtable | Bidirectional | 30 min |
Vendedor | Salesperson/Purchaser | CDS cr743_Vendedor | BC → Dataverse | 30 min |
Resource | Resource | CDS cr743_Resource | BC → Dataverse | 30 min |
- ✓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
Publicar un comentario