Share via


Function methods

Functions provide the following method:

  • Invoke()

Invoke()

The Invoke() method is used to run the specified function. The parameters for this method will depend on the procedure that is being run. The following table lists the types of parameters for functions:

Type

Description

in

Parameters of type "in" are used only to pass values into the function.

out

Parameters of type "out" are used only to pass values out of the function.

inout

Parameters of type "inout" are used to pass values into the function, and to pass values out of the function.

The Invoke() method will have a return value to which the return value of the function will be returned.

Hint: The IntelliSense in Visual Studio will tell you the type of each parameter and the return value for a function. It will also tell you the datatype of each parameter and the return value, such as decimal or string.

For example, the following C# code calls the GetCurrentDirectory global function. This procedure has no parameters and returns a string value.

string currentDirectory;
currentDirectory = Dynamics.Functions.GetCurrentDirectory.Invoke();

You can refer to the Microsoft Dynamics GP SDK for details about the functions available to invoke. Some functions in Microsoft Dynamics GP have optional parameters defined. Visual Studio Tools does not support optional parameters. You must supply all parameters for a function when you invoke it from Visual Studio Tools.