# 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:

&#x20;      1\. Opening a **Custom Page** or **Entity Form** when a card is dragged.

&#x20;      2\. Preventing movement based on field values or business logic.

* **Return:**

  &#x20;1\. `false` → Cancels the card movement.

  &#x20;2\. `true` → Allows the movement to proceed.
* **Parameter (Object):**\
  An object with the following properties:<br>

  ```
  {
  ```

  ```
    recordId: <ID of the dragged record>,
  ```

  ```
    entityLogicalName: <Entity logical name>,
  ```

  ```
    sourceLaneName: <Details of current lane in object>,
  ```

  ```
    targetLaneName: < Details of source lane in object >
  ```

  ```
  }
  ```

  &#x20;

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

* **Purpose:**\
  Useful for executing actions such as:

&#x20;      1\. Logging movement history.

&#x20;      2\. Displaying success notifications.

&#x20;      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);
    });
};

```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.inogic.com/kanban-board/configuration/configuration-for-custom-events-integration.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
