Configuration for Custom Events Integration

Enhance your Dynamics 365 CRM Kanban Board with Custom Events Integration and take complete control of your workflow automation. Trigger pre- or post-card move actions to enforce business rules, log updates, send notifications, or open custom pages—making your processes fully dynamic and aligned with your team’s goals. Reduce manual effort, improve task tracking, and create an interactive, intelligent Kanban experience. Perfect for teams looking to boost productivity in Dynamics 365, streamline workflows, and ensure every card movement supports their CRM strategy.

Follow the steps below to configure custom events in Dynamics 365 CRM Kanban Board:

Web Resource Configuration

Web Resource Name (Mandatory): The web resource name must contain the following name: Inogic/KanbanBoard/CustomEvent.js Namespace (Mandatory): CustomKanbanBoardEvents

Functional Configuration

preUpdate(parameter): This function is triggered before a card is moved to a different lane.

  • Purpose: Use this to apply conditional logic, such as:

1. Opening a Custom Page or Entity Form when a card is dragged.

2. Preventing movement based on field values or business logic.

  • Return:

    1. false → Cancels the card movement.

    2. true → Allows the movement to proceed.

  • Parameter (Object): An object with the following properties:

    {
      recordId: <ID of the dragged record>,
      entityLogicalName: <Entity logical name>,
      sourceLaneName: <Details of current lane in object>,
      targetLaneName: < Details of source lane in object >
    }

postUpdate(): Triggered after the card has been successfully moved and the record update is completed.

  • Purpose: Useful for executing actions such as:

1. Logging movement history.

2. Displaying success notifications.

3. Launching additional workflows or dialogs

Sample Script

self["CustomKanbanBoardEvents"] = self["CustomKanbanBoardEvents"] || {};

/**
 * PRE-UPDATE Event
 */
self["CustomKanbanBoardEvents"].preUpdate = function (parameter) {
    return new Promise(function (resolve) {
        try {
            if (!parameter || !parameter.recordId || !parameter.entityLogicalName) {
                console.error("Missing required parameters.");
                resolve(false);
                return;
            }

            const { recordId, entityLogicalName } = parameter;

            if (typeof Xrm === "undefined" || !Xrm.Navigation) {
                console.error("Xrm.Navigation not available");
                resolve(false);
                return;
            }

            // Open the entity form in a modal dialog
            const pageInput = {
                pageType: "entityrecord", //recordform
                entityName: entityLogicalName,
                entityId: recordId
               
            };

            const navigationOptions = {
                target: 2, // Dialog
                position: 1, // Center
                width: { value: 800, unit: "px" },
                height: { value: 800, unit: "px" },
                title: "Edit Record"
            };
            
            Xrm.Navigation.navigateTo(pageInput, navigationOptions)
                .then(function () {
                    resolve(true); // Always allow after closing
                })
                .catch(function (err) {
                    console.error("Error opening form dialog:", err.message);
                    resolve(false);
                });

        } catch (e) {
            console.error("preUpdate error:", e.message);
            resolve(false);
        }
    });
};

 /**
 * POST-UPDATE Event
 */
self["CustomKanbanBoardEvents"].postUpdate = function () {
    console.log("postUpdate: Status updated successfully.");
    Xrm.App?.addGlobalNotification?.({
        type: 1,
        level: 1,
        message: `Status updated!`,
        showCloseButton: true
    }).catch(error => {
        console.warn("Notification error:", error.message);
    });
};

Last updated

Was this helpful?