> For the complete documentation index, see [llms.txt](https://docs.greytrix.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.greytrix.com/sage-crm-add-ons/crm-resource-planner/installation-+-setup/custom-right-click-calendar-context-menu.md).

# Custom Right-Click Calendar Context Menu

Resource Planner allows administrators to customize the **right-click context menu** displayed within the Resource Planner calendar. This menu provides quick access to actions that can be performed on a calendar entry or an empty calendar space. Custom menu items can be added to support organization-specific requirements.

#### Adding a Custom Context Menu Item

To add a custom right-click menu option:

1. Navigate to **Administration → Advanced Customization → System Menus**.
2. Locate and open the **RP\_CustContextMenu** menu.
3. Add the required menu item.
4. Set the action to **Custom File**.
5. Specify the callback function that will handle the custom action.

<figure><img src="https://794987320-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MCRVg-TYx3gVa2Tqtf_%2Fuploads%2FPPEC9ocIOwnz4R3rmfFt%2FMenu.png?alt=media&amp;token=e9fffcad-4a04-4e93-8e5f-ccb317e1ce2d" alt=""><figcaption></figcaption></figure>

For the custom menu item to function correctly, it must be linked to the **RP\_CustContextMenuCallbacks.js** file. The corresponding JavaScript function must also be implemented within this file to execute the required action when the menu item is selected.

#### Example

The documentation includes an example where a custom menu item named **Hello World** is created.

In this example:

* The menu item is named **Hello World**.
* The action type is set to **Custom File**.
* The custom file is specified as **helloworld**.
* A corresponding function is implemented in **RP\_CustContextMenuCallbacks.js** to handle the menu action.

<figure><img src="https://794987320-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MCRVg-TYx3gVa2Tqtf_%2Fuploads%2FH6IXUif4QI6sp7j1ydEJ%2Fproperties.png?alt=media&amp;token=7c2fa30b-40a7-4029-9524-d7318632a3e5" alt=""><figcaption></figcaption></figure>

This approach allows developers to extend the Resource Planner calendar by adding custom actions that integrate with their organization's business processes.

### Custom Right-Click Functions – `RP_CustContextMenuCallbacks.js`

All custom functions used by the Resource Planner **right-click context menu** must be defined in the **RP\_CustContextMenuCallbacks.js** file.

This file is located in:

`/CustomPages/Enbu/ResourcePlanner`

<figure><img src="https://794987320-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MCRVg-TYx3gVa2Tqtf_%2Fuploads%2FAfr2AMh4WHzokFfmZIFA%2FCustom.png?alt=media&amp;token=54a35bfb-267f-4cb0-a6f7-57b5ec6125b2" alt=""><figcaption></figcaption></figure>

Each custom menu item created in **RP\_CustContextMenu** must have a corresponding JavaScript function with the same name defined in this file. When the menu item is selected, the associated function is executed.

#### Example

In the previous section, a custom context menu item named **Hello World** was created with the custom file name **helloworld**.

To implement this menu item:

1. Open the **RP\_CustContextMenuCallbacks.js** file.
2. Create a function named **helloworld**.
3. Add the required JavaScript logic inside the function.

In the example provided, a simple JavaScript **alert** statement is used to display a message when the menu item is selected.

#### Testing the Custom Function

After saving the JavaScript function:

1. Open the **Resource Planner**.
2. Right-click anywhere within the Resource Planner grid.
3. Select the **Hello World** menu option.

<figure><img src="https://794987320-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MCRVg-TYx3gVa2Tqtf_%2Fuploads%2FgmpuZFLWkrfcVMyveuxm%2FHello%20World.png?alt=media&amp;token=35dc1b5c-c082-4ced-8d6c-9c8199ffe308" alt=""><figcaption></figcaption></figure>

If the function has been implemented correctly, the configured JavaScript alert message is displayed, confirming that the custom context menu item is working successfully.
