Reusing logic with a custom function

Objectives

After completing this lesson, you will be able to:

  • Create a custom function

Custom Function Scripting

If the built-in functions that are provided by Data Services do not meet your requirements, you can create your own custom functions using the Data Services scripting language.

Create your own functions by writing script functions in the Data Services scripting language using the Smart Editor.

Saved custom functions appear under the Custom Functions category in the Function Wizard and the Smart Editor. Custom functions are also displayed on the Custom Functions tab of the Local Object Library.

You can edit and delete custom functions from the Local Object Library.

Custom Function Guidelines

Consider these guidelines when you create your own functions:

  • Functions return a value. The return value is predefined to be Return.
  • Functions can have parameters for input, output, or both.
  • You must know the input, output and return values and data types before you create a custom function.
  • Functions can call other functions.
  • Functions cannot call themselves.
  • Functions can not participate in a cycle of recursive calls, for example, function A can not call function B if function B calls function A.

Let's Try It

Let me guide you through the creation of a custom function:

Log in to track your progress & complete quizzes