Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Quickstart Guide

Build a support case board for the Account page in one Lightning Web Component: a query, a mapping, and an avonni-dd-kanban tag. No Apex.

A Kanban board on a record page is a classic request, and a costly one to build from scratch: an Apex controller and its test class, the SOQL, the columns, the drag and drop, the search, the counts. With the LWC Components package, all of that lives in one tag.

In the next 15 minutes you will build caseBoard, a Lightning Web Component that shows an account's support cases by status, lets your agents drag a case to its next status, and saves the change.

On the left, the 16-line caseBoard.html template with an avonni-dd-kanban tag; on the right, the Lakeshore Cold Chain account page showing a Support cases board with New, On Hold, Escalated and Closed columns, a search box and a count on each column
What you write, and what your users get: the board on a real Account page, reading that account's cases.

Before you start

  • The package is installed and your user has a license: see Installation & Licenses Management.

  • You have a Salesforce DX project in VS Code, authorized to that org, with the Salesforce CLI (sf).

  • An Account with a few Cases, to see something on the board.


Build the case board

1

Create the component

From the root of your project:

You get the usual three files: caseBoard.html, caseBoard.js and caseBoard.js-meta.xml.

2

Drop the Kanban into the template

Replace caseBoard.html with:

avonni-dd-kanban is the Data Driven Kanban from the package. Like any avonni-* tag, it needs no import: reference it and set its attributes in kebab-case. group-field-name="Status" makes one column per value of the Status picklist, in the picklist's order.

3

Tell it which records to read

Replace caseBoard.js with:

Three properties do the work:

  • query is the SOQL, as an object: the object, a WHERE filter, a sort and a limit. It is a getter so the filter can use recordId, which Salesforce sets on a record page.

  • mapping turns each record into a card. {{Record.Subject}} inserts a field value, and linkify makes the title a link to the case.

  • fields adds field values under each card, here the Priority.

No Apex and no wire adapter: the component runs the query itself.

4

Save what the user drops

The board moves a card as soon as it is dropped, then fires itemdrop with the record and the column it landed in. Saving the change is yours, which is what handleItemDrop above does with updateRecord, the standard Lightning Data Service call: it writes the new Status, then shows a toast.

If the save fails (a validation rule, a missing permission), the handler shows the error and calls refresh(true) on the board, which reloads it from the database so the card goes back to its saved column.

5

Expose it on record pages

Replace caseBoard.js-meta.xml with:

masterLabel is the name you will see in Lightning App Builder, and the target makes the component available on Account record pages.

6

Deploy it

7

Add it to the Account page

  1. Open any Account, click the Setup gear, then Edit Page.

  2. In the Components panel, search for Case Board. It is listed under Custom.

  3. Drag it onto the page. The board already shows that account's cases, right in the builder.

  4. Click Save, then Activation if the page is not assigned yet.

Lightning App Builder with the Components panel searched for Case Board, listed under Custom (1), and the Case Board selected on the Account page, showing its four status columns
Case Board in Lightning App Builder, already reading the account's cases.
8

Try it

Open the Account and drag a case from New to On Hold. The column counts change, the toast confirms, and the case's Status is saved: reload the page and it stays where you put it.

The Lakeshore Cold Chain account page after a drop: a success toast reads Add a second contact for delivery alerts is now On Hold, and the On Hold column now counts four cases
One drop, one saved Status. We checked this one in the database.

What you did not write

From scratch, you would write

With avonni-dd-kanban

An Apex controller with the SOQL, and its test class

A query object in your JavaScript

The columns, from the picklist values

group-field-name="Status"

Drag and drop between columns, and the card that moves

Built in. You handle itemdrop to save

A search box, and the count on each column

search-fields and show-item-count

Updates and fixes when Salesforce changes

Shipped in the package, with each release

Your component stays at about 60 lines of HTML and JavaScript, and the rest is maintained by Avonni. The Maintenance Advantage explains why that matters over time.

If something looks wrong

What you see
Likely cause
Fix

avonni-dd-kanban is an unknown tag when you deploy

The package is not installed in the target org

The board is empty

The account has no cases, or recordId is not set

Add the component to a record page, where Salesforce sets recordId

A dropped card comes back after a reload

itemdrop is not handled, or the save failed

Save in handleItemDrop as in step 3, and check the error toast

Case Board is not in Lightning App Builder

isExposed is false, or the target does not include the object

Check caseBoard.js-meta.xml as in step 5

Keep going

Last updated

Was this helpful?