> For the complete documentation index, see [llms.txt](https://docs.mashmatrix.com/mashmatrix-sheet/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mashmatrix.com/mashmatrix-sheet/customization/start_custom_apex_visualforce.md).

# Launching Custom Apex / Visualforce

By using the custom action function, it is also possible to call Apex code and Visualforce pages developed on Salesforce from Mashmatrix Sheet.

## Invoke Visualforce Page <a href="#invoke-visualforce-page" id="invoke-visualforce-page"></a>

To invoke a Visualforce page, enter the URL in the following format in the Page URL from the Open URL action.

`/apex/{Visualforce Page Name}`

If it has a namespace, such as a Visualforce page included in the management package, enter the URL in the following format:

`/apex/{Namespace Prefix}__{Visualforce Page Name}`

Specify the parameter name appropriately from the detail setting of the action. From the Apex controller of the Visualforce page, it is possible to get the parameter value with the following code.

```
ApexPages.currentPage().getParameters().get('id');
```

## Invoke Apex Code

If you want to invoke custom logic written in Apex from the Sheet, it is most effective to start it once via a flow. See "[Startup Flow](/mashmatrix-sheet/customization/start_visual_workflow.md)" for information on how to start a flow with a custom action.

To call Apex from a flow, you must have an Apex class with a static method that implements `@InvocableMethod`. For more information, please refer to Salesforce's help and developer documentation.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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.mashmatrix.com/mashmatrix-sheet/customization/start_custom_apex_visualforce.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.
