# Method

## Overview

The `ScriptMethod` class represents a script method in the Servoy environment, offering functionality for defining, managing, and inspecting script methods. It provides various properties for checking the visibility of the method, such as whether it should appear in the menu with the `getShowInMenu()` method.

Additionally, the class allows for setting and retrieving details about the method, including its `name`, `scopeName`, and `declaration`, which can be managed through the `setName()`, `setScopeName()`, and `setDeclaration()` methods.

The class also includes features for determining the accessibility and type of the method. For example, it can check if the method is a `constructor` using the `isConstructor()` method. It provides flexibility for generating the method signature with `getScriptMethodSignature()`, which constructs a string representation of the method’s parameters, types, and return type.

Overall, the `ScriptMethod` class is allowing to define and managing methods in the Servoy environment, with a focus on method visibility, signatures, and associated metadata like scope and constructor status.

## Properties Summarized

| Type                                                       | Name                        | Summary                                                                              |
| ---------------------------------------------------------- | --------------------------- | ------------------------------------------------------------------------------------ |
| [String](/reference/servoycore/dev-api/js-lib/string.md)   | [declaration](#declaration) | The full source code of this method (including doc and function declaration).        |
| [String](/reference/servoycore/dev-api/js-lib/string.md)   | [name](#name)               | The name of the method.                                                              |
| [String](/reference/servoycore/dev-api/js-lib/string.md)   | [scopeName](#scopename)     | The name of the scope.                                                               |
| [Boolean](/reference/servoycore/dev-api/js-lib/boolean.md) | [showInMenu](#showinmenu)   | Flag that tells if the method appears or not in the "Methods" menu of Servoy Client. |

## Properties Detailed

### declaration

The full source code of this method (including doc and function declaration).

**Type**\
[String](/reference/servoycore/dev-api/js-lib/string.md)

### name

The name of the method.

**Type**\
[String](/reference/servoycore/dev-api/js-lib/string.md)

### scopeName

The name of the scope.

**Type**\
[String](/reference/servoycore/dev-api/js-lib/string.md)

### showInMenu

Flag that tells if the method appears or not in the "Methods" menu of Servoy Client.

**Type**\
[Boolean](/reference/servoycore/dev-api/js-lib/boolean.md)

***


---

# 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.servoy.com/reference/servoycore/object-model/solution/method.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.
