NW Buttonable — Manual

NW Buttonable

Extensión para Microsoft Dynamics 365 Business Central — niccoweb.com

v27.0.0.0
📋 Información general
Publicadorniccoweb.com
Versión27.0.0.0
Runtime AL16.0
BC mínimov27.0
Rango de ID50600–50625
Tipo de interfazControl Add-In
ℹ️ ¿Qué hace esta extensión?
NW Buttonable añade una cuadrícula de botones rápidos directamente debajo de las líneas de un Pedido de venta, mediante un Control Add-In. Cada artículo marcado como Buttonable aparece como una tarjeta táctil con su número, descripción y la cantidad ya presente en el pedido. Tocar la tarjeta añade una unidad al instante; no hace falta abrir el subformulario de líneas ni teclear nada para los artículos más habituales.

👤 Usuario de BC
📄 Pedido de ventaPágina extendida
🧩 Control Add-InCuadrícula de botones
⚙️ Buttonable Items Mgt.Codeunit 50600
🗄️ Línea de ventaBase de datos BC

WIDGET001Premium Widget2
🎯GADGET05Electric Gadget3
SERVICE1Install Service0
🔒PART-123Replacement Part1
💡 Cada tarjeta es independiente del artículo. Mantener pulsada una tarjeta activa el modo foco (se agranda y las demás se difuminan) para poder restar unidades tocando de nuevo.
Funciones principales
👆

Tocar para sumar

Un toque añade 1 unidad al pedido y muestra una animación flotante "+1".

🎯

Modo foco para restar

Mantén pulsado ~1s para entrar en modo foco; vuelve a tocar la misma tarjeta para restar 1 unidad.

✏️

Editar cantidad exacta

Doble clic (o doble toque) sobre el número para escribir la cantidad deseada directamente.

🖱️

Menú contextual

Clic derecho (o mantener pulsado ~2s): Reset a 0, Establecer valor, Duplicar ×2 o Bloquear/Desbloquear.

🔒

Bloqueo por tarjeta

Bloquea una tarjeta para evitar cambios accidentales mientras revisas el pedido.

🔄

Sincronización en vivo

El contador de cada tarjeta refleja la cantidad real ya presente en las líneas del pedido.

🧹

Limpieza de duplicados

Si existían líneas duplicadas del mismo artículo, se consolidan en una sola al editar la cantidad.

⚙️

Comportamiento configurable

Elige si cada toque crea una línea nueva o incrementa la línea existente del artículo.

⚙️ Configuración inicial
  • 1
    Asigna el conjunto de permisos Buttonable a los usuarios de la extensión.
  • 2
    Abre la página Buttonable Setup y decide el modo Item per line: activado crea una línea nueva en cada toque; desactivado incrementa la cantidad de la línea existente.
  • 3
    En el Ficha de artículo o Lista de artículos, marca la casilla Buttonable en los artículos que quieras como botón rápido (deben estar sin bloquear).
  • 4
    Abre cualquier Pedido de venta: la cuadrícula de botones aparece automáticamente debajo de las líneas.
🚀 Cómo usar la cuadrícula
  • 1
    Toca una tarjeta para añadir 1 unidad del artículo al pedido.
  • 2
    Mantén pulsada la tarjeta (~1s) para activar el modo foco y poder restar tocándola de nuevo.
  • 3
    Doble clic sobre el número para escribir una cantidad exacta; déjalo en 0 para eliminar la línea.
  • 4
    Clic derecho (o pulsación larga ~2s) abre el menú: Reset, Establecer valor, Duplicar o Bloquear.
  • 5
    Todos los cambios se guardan al instante en la línea de venta correspondiente.
📦 Objetos AL
TipoIDNombreDescripción
Tabla50600NW Buttonable SetupTabla singleton con la opción Item per line
TablaExt50600NW ItemAñade el campo Buttonable (Boolean) a Item
Página50600NW Button PartPágina ListPart que aloja el Control Add-In y enlaza con el registro origen
Página50601NW Buttonable SetupPágina Card para configurar el comportamiento de inserción
PáginaExt50600NW Sales OrderInserta el Button Part debajo de las líneas del pedido
PáginaExt50601NW Item CardAñade el campo Buttonable tras Blocked
PáginaExt50602NW Item ListAñade el campo Buttonable con tooltip en la lista
PáginaExt50603NW Sales Order SubformRefresca el subformulario al validar Cantidad / Cant. a enviar / Cant. a facturar
Codeunit50600NW Buttonable Items MgtJSON de artículos, inserción/actualización de líneas y limpieza de duplicados
CtrlAddInButtonable Items AddinCuadrícula JavaScript/HTML/CSS con gestos táctiles avanzados
PermSet50600ButtonablePermisos para los objetos propios de la extensión
🗂️ Modelo de datos
Tabla — NW Buttonable Setup (50600)
CampoTipoDescripción
Primary KeyCode[10]Clave del registro singleton
Item per lineBooleanSi está activo, cada toque crea una línea de venta nueva en vez de incrementar la existente
Extensión de tabla — Item
CampoTipoDescripción
Buttonable (50600)BooleanMarca el artículo para que aparezca como botón rápido (solo si no está bloqueado)
🧩 Arquitectura del Control Add-In
El Control Add-In Buttonable Items Addin está construido con HTML, CSS y JavaScript sin frameworks (Pointer Events). La página NW Button Part recibe el registro origen mediante SetSource(Variant), lo que permite reutilizar el mismo Add-In en otros documentos en el futuro (hoy solo está conectado a Pedido de venta).

DirecciónNombreParámetrosDescripción
JS → BCControlReadySeñal de carga; dispara la primera petición del JSON de artículos
JS → BCItemButtonClickeditemNoEvento heredado para insertar una línea; el flujo actual usa ItemQuantityChanged
JS → BCItemQuantityChangeditemNo, quantitySe dispara con cada toque, edición o acción del menú; ajusta o borra la línea correspondiente
BC → JSLoadItemsitemsJsonReconstruye la cuadrícula completa con artículos y cantidades actuales
BC → JSShowMessagemessageProcedimiento disponible para mostrar avisos en el Add-In
📁 Archivos del Add-In: startup.js (señal inicial) · ButtonableItems.js (gestos táctiles, contador y menú contextual) · ButtonableItems.css (estilos y animaciones)
🛡️ Permisos
El conjunto de permisos Buttonable debe asignarse a todos los usuarios de la extensión:
📊 Datos de tabla — NW Buttonable SetupRIMD
🗄️ Tabla — NW Buttonable SetupEjecutar
⚙️ Codeunit — NW Buttonable Items MgtEjecutar
📄 Página — NW Button PartEjecutar
⚠️ Los permisos sobre la extensión de tabla Item y las páginas estándar (Pedido de venta, Ficha/Lista de artículo) los aporta el conjunto de permisos base de Business Central.
📝 Requisitos previos
  • Business Central versión 27.0 o posterior.
  • Un navegador compatible con la API de Pointer Events (todos los navegadores modernos).
  • El conjunto de permisos Buttonable asignado al usuario.
  • No se requieren dependencias externas ni API de terceros.

NW Buttonable

Extension for Microsoft Dynamics 365 Business Central — niccoweb.com

v27.0.0.0
📋 General Information
Publisherniccoweb.com
Version27.0.0.0
AL Runtime16.0
Min. BCv27.0
ID Range50600–50625
UI TypeControl Add-In
ℹ️ What does this extension do?
NW Buttonable adds a grid of quick-add tiles directly below the lines of a Sales Order, through a Control Add-In. Every item flagged as Buttonable shows up as a tactile tile with its number, description and the quantity already on the order. Tapping a tile adds one unit instantly — no need to open the lines subform or type anything for your most common items.

👤 BC User
📄 Sales OrderExtended Page
🧩 Control Add-InTile grid
⚙️ Buttonable Items Mgt.Codeunit 50600
🗄️ Sales LineBC Database

WIDGET001Premium Widget2
🎯GADGET05Electric Gadget3
SERVICE1Install Service0
🔒PART-123Replacement Part1
💡 Every tile tracks one item. Press and hold a tile to enter spotlight mode (it scales up and the others blur) so tapping it again subtracts a unit instead of adding one.
Key Features
👆

Tap to add

A single tap adds 1 unit to the order and shows a floating "+1" animation.

🎯

Spotlight mode to remove

Press and hold (~1s) to enter spotlight mode, then tap the same tile again to subtract 1 unit.

✏️

Edit exact quantity

Double-click (or double-tap) the number to type the exact quantity you want.

🖱️

Context menu

Right-click (or long-press ~2s): Reset to 0, Set value, Duplicate ×2, or Lock/Unlock.

🔒

Per-tile locking

Lock a tile to prevent accidental changes while you review the order.

🔄

Live sync

Each tile's counter reflects the real quantity already present on the order lines.

🧹

Duplicate cleanup

If duplicate lines existed for the same item, editing the quantity consolidates them into one.

⚙️

Configurable behaviour

Choose whether each tap creates a new line or increments the existing line for that item.

⚙️ Initial Setup
  • 1
    Assign the Buttonable permission set to the users who will use this extension.
  • 2
    Open the Buttonable Setup page and decide the Item per line behaviour: enabled creates a new line on every tap; disabled increments the existing line for that item.
  • 3
    On the Item Card or Item List, check Buttonable for the items you want as quick-add tiles (they must not be blocked).
  • 4
    Open any Sales Order — the tile grid appears automatically below the lines.
🚀 How to Use the Grid
  • 1
    Tap a tile to add 1 unit of that item to the order.
  • 2
    Press and hold the tile (~1s) to enter spotlight mode, then tap again to subtract.
  • 3
    Double-click the number to type an exact quantity; set it to 0 to remove the line.
  • 4
    Right-click (or long-press ~2s) to open the menu: Reset, Set value, Duplicate, or Lock.
  • 5
    Every change is saved instantly to the corresponding sales line.
📦 AL Objects
TypeIDNameDescription
Table50600NW Buttonable SetupSingleton table holding the Item per line option
TableExt50600NW ItemAdds the Buttonable (Boolean) field to Item
Page50600NW Button PartListPart page hosting the Control Add-In and binding it to the source record
Page50601NW Buttonable SetupCard page to configure the insertion behaviour
PageExt50600NW Sales OrderEmbeds the Button Part below the sales lines
PageExt50601NW Item CardAdds the Buttonable field after Blocked
PageExt50602NW Item ListAdds the Buttonable field with a tooltip in the list
PageExt50603NW Sales Order SubformRefreshes the subform after validating Quantity / Qty. to Ship / Qty. to Invoice
Codeunit50600NW Buttonable Items MgtBuilds the items JSON, inserts/updates lines and cleans up duplicates
CtrlAddInButtonable Items AddinJavaScript/HTML/CSS tile grid with advanced pointer gestures
PermSet50600ButtonablePermissions for the extension's own objects
🗂️ Data Model
Table — NW Buttonable Setup (50600)
FieldTypeDescription
Primary KeyCode[10]Key of the singleton record
Item per lineBooleanWhen enabled, every tap creates a new sales line instead of incrementing the existing one
Table Extension — Item
FieldTypeDescription
Buttonable (50600)BooleanFlags the item to appear as a quick-add tile (only when not blocked)
🧩 Control Add-In Architecture
The Buttonable Items Addin Control Add-In is built with vanilla HTML, CSS, and JavaScript using the Pointer Events API. The NW Button Part page receives the source record through SetSource(Variant), which means the same Add-In can be wired into other documents in the future (today it is only connected to Sales Order).

DirectionNameParametersDescription
JS → BCControlReadyFired on load; triggers the first request for the items JSON
JS → BCItemButtonClickeditemNoLegacy event for inserting a line; the current UI flow uses ItemQuantityChanged instead
JS → BCItemQuantityChangeditemNo, quantityFired on every tap, manual edit or context-menu action; adjusts or deletes the matching line
BC → JSLoadItemsitemsJsonRebuilds the full tile grid with current items and quantities
BC → JSShowMessagemessageProcedure available to surface notifications inside the Add-In
📁 Add-In files: startup.js (initial ready signal) · ButtonableItems.js (pointer gestures, counters and context menu) · ButtonableItems.css (styles and animations)
🛡️ Permissions
The Buttonable permission set must be assigned to all users of this extension:
📊 Table Data — NW Buttonable SetupRIMD
🗄️ Table — NW Buttonable SetupExecute
⚙️ Codeunit — NW Buttonable Items MgtExecute
📄 Page — NW Button PartExecute
⚠️ Permissions on the Item table extension and the standard pages (Sales Order, Item Card/List) come from your base Business Central permission set.
📝 Prerequisites
  • Business Central version 27.0 or higher.
  • A browser that supports the Pointer Events API (all modern browsers qualify).
  • The Buttonable permission set assigned to the user.
  • No external dependencies or third-party APIs required.

Comentarios