Validated multi-row Excel-to-BC paste for journals and master data lists.

  • Current version: v0.1.1.0
  • AL prefix: AMPMA
  • Object range: 80300-80399
  • Business Central: 26.0.0.0
  • Publisher: Amplio Solutions

AMP Mass Journal Paste (Power Paste / Excel Power-Edit)

Validated multi-row Excel-to-BC paste experience that bypasses the standard 50-row paste cap and the single-row paste error.
Property Value
Publisher Amplio Solutions
App ID b8e7c4d1-9a52-4f36-bc89-1d4e5a6b7c8d
Version 0.1.0.0
BC App / Platform target 26.0.0.0 / 26.0.0.0
Object range 80300..80399
Object prefix AMP
Country GB (en-GB)

What it does

When a user selects rows in Excel and pastes into a journal or list in Business Central today, two things break:

  1. The web client silently caps the paste at 50 rows.
  2. Pasting into a single cell sometimes errors out with the "values cannot be pasted into the cell" message because BC tries to parse the rich HTML payload directly.

Power Paste routes the paste through a dedicated control add-in:

  1. The user opens the Power Paste page (action on the journal/list).
  2. The JS add-in captures both the HTML and the TSV payloads from the clipboard via the standard paste event.
  3. AL receives them through the standard Microsoft.Dynamics.NAV.InvokeExtensibilityMethod event protocol.
  4. Rows are written to a generic 16-column staging table.
  5. The validator builds a RecordRef for the target table and runs FieldRef.Validate(...) for every captured cell, row by row, using [TryFunction]s so the standard BC field triggers fire (and their errors are captured per row/column rather than aborting).
  6. Errors are surfaced inline in the staged-rows grid AND highlighted on the JS preview by row/column.
  7. Only when the user confirms the commit do staged rows get inserted into the real target table via Insert(true).

Object map

Type ID Name
Enum 80350 AMP Power Paste Target
Table 80300 AMP Power Paste Session
Table 80301 AMP Power Paste Line (16-col staging)
Page 80310 AMP Power Paste (Card, hosts the control add-in)
Page 80311 AMP Power Paste Lines (ListPart subpage)
PageExt 80330 AMP Gen. Jnl. Power Paste (extends General Journal)
PageExt 80331 AMP Item Jnl. Power Paste (extends Item Journal)
PageExt 80332 AMP Customer Power Paste (extends Customer List)
PageExt 80333 AMP Vendor Power Paste (extends Vendor List)
PageExt 80334 AMP Dim. Value Power Paste (extends Dimension Values)
Codeunit 80340 AMP Power Paste Parser
Codeunit 80341 AMP Power Paste Validation
Codeunit 80342 AMP Power Paste Mgt
ControlAddIn (named) AMP Power Paste AddIn
PermissionSet 80360 AMP Power Paste
09-Mass-Journal-Paste/
├── app.json
├── README.md
├── .editorconfig
├── .gitignore
├── .vscode/launch.json
├── ControlAddIn/
│   ├── PowerPasteAddIn.js
│   └── PowerPasteAddIn.css
└── src/
    ├── ControlAddIn/PowerPasteAddIn.ControlAddIn.al
    ├── Enum/PowerPasteTarget.Enum.al
    ├── Table/
    │   ├── PowerPasteSession.Table.al
    │   └── PowerPasteLine.Table.al
    ├── Page/
    │   ├── PowerPaste.Page.al
    │   └── PowerPasteLines.Page.al
    ├── PageExtensions/
    │   ├── GenJournalPowerPaste.PageExt.al
    │   ├── ItemJournalPowerPaste.PageExt.al
    │   ├── CustomerListPowerPaste.PageExt.al
    │   ├── VendorListPowerPaste.PageExt.al
    │   └── DimensionValuesPowerPaste.PageExt.al
    ├── Codeunit/
    │   ├── PowerPasteParser.Codeunit.al
    │   ├── PowerPasteValidation.Codeunit.al
    │   └── PowerPasteMgt.Codeunit.al
    └── PermissionSet/
        └── PowerPaste.PermissionSet.al

Install / build (sandbox)

  1. Open the folder in VS Code with the AL Language extension.
  2. Ctrl+Shift+PAL: Download symbols (BC 26.0 sandbox).
  3. Ctrl+Shift+PAL: Package.
  4. F5 to publish + launch.
    • The Local Sandbox (Docker) config targets http://bcserver, instance BC — adjust to your container.
    • The Cloud Sandbox config targets Sandbox.
  5. After publish, search the role centre for Power Paste or open any of the 5 target lists and click the new Power Paste action.

MVP status — what's complete

  • End-to-end flow for General Journal + Item Journal + Customer, Vendor, Dimension Value via the staging-and-validate pipeline.
  • JS control add-in captures both HTML and TSV payloads, posts back via Microsoft.Dynamics.NAV.InvokeExtensibilityMethod.
  • Validator runs standard BC field triggers (so posting groups, dimensions, currency exchange, etc. all behave as native paste).
  • Inline error grid + per-cell highlight in the JS preview.
  • Insert(true) only after explicit user confirmation (Confirm Management.GetResponseOrDefault).
  • Promoted Power Paste action on all 5 target pages.
  • Custom permission set AMP Power Paste.
  • app.json declares deps on Base + System Application 26.0.0.0.

What Lee needs to do to ship

  1. Replace the placeholder GUID in app.json. The current value b8e7c4d1-9a52-4f36-bc89-1d4e5a6b7c8d was generated during scaffolding — regenerate one for the published app and pin it before the first AppSource/PartnerSource publish (it must never change again).
  2. Verify the launch.json server / instance. The local profile currently points at http://bcserver with instance BC — change to match your Docker container name. The cloud profile targets a sandbox literally named Sandbox.
  3. Download symbols and confirm a clean compile. The [TryFunction]-based validator is built against BC 26.x APIs (RecordRef.Field(), FieldRef.Validate(), GetLastErrorText, ClearLastError) — all stable, but you should confirm a clean AL: Package against your downloaded symbols.
  4. Translate strings. All user-visible labels are Label literals in en-GB. Run AL: Generate XLIFF and translate Translations/AMP Mass Journal Paste.g.xlf if you need additional locales (the manifest currently lists only en-GB).
  5. Test the commit path against your real templates/batches. The commit helpers CommitToGenJournal / CommitToItemJournal use the session header's Journal Template Name + Journal Batch Name and Insert(true) — verify with a dry-run batch before turning users loose, especially on production companies.
  6. Decide on telemetry. Nothing is logged at the moment. Consider wiring Session.LogMessage calls in HandlePasteCaptured and CommitSession for ops visibility before GA.
  7. Write smoke tests. A small Test Codeunit per target — paste 3 rows, mutate one cell to invalidate, re-validate, then commit — would catch field-rename regressions when symbols update.
  8. Optional polish before GA:
    • Larger UoM/Bin lookups in the JS preview (currently TSV-only).
    • Toast notification with row count after a successful commit (currently a Message).
    • Friendly column headers per target — the staging table is generic Col 01..16; the AddIn is told the headers via a pipe-delimited Initialize(...) call but the AL list-part still shows generic captions.

Deferred to v2 (explicitly out of MVP)

  • AI-assisted column auto-mapping (currently column order is fixed per target, see BuildColumnHeaders on page 80310).
  • Rich-cell HTML parsing (formulas, hyperlinks, formatting). The JS already captures the text/html payload but AL only consumes the text/plain TSV.
  • Per-target bespoke staging tables with strongly-typed columns (current MVP uses one shared 16-column buffer — fine for paste, but not as nice for editing).
  • Additional targets (Sales/Purchase Header + Lines, Item, FA Card, Job Journal).

Conventions

  • All AL object names use the AMP prefix.
  • All object IDs land inside 80300..80399.
  • Country / locale: GB / en-GB only.
  • No with blocks (NoImplicitWith feature flag is enabled in app.json).