Creating Functions

This section provides information about how to create a function that triggers from any of the workflows to achieve the specified functionality.

Based on the usage of functions, you can create two types of functions:

Create Normal Functions

You can invoke the normal functions from the components such as Custom Workflow Functions, Custom Buttons, Related Lists, or Schedules.

To create a normal function, follow these steps:

  1. Open Bigin Developer Console.
  2. Go to Automate > Functions.

    The Functions page appears.

  3. To create a new function, click New Function.
  4. On the Create Function page, do the following:
    • For Function Name, type the name of the function.

      Based on the name of the topping, the Namespace field is automatically generated.

    • For Invoke as REST API, select No.
    • From the Return Type drop-down, select the return type.
    • For Arguments, click the Add Arguments link, type the name of the argument, and then from the drop-down, select the argument type.
  5. Click Next.

    The Deluge Script Editor appears.

  6. Add the custom code as per your requirement, and then click Save & Close.

The new normal function is created.

Create REST API Functions

You can invoke the REST API functions from within a function of a topping or from a third-party application. You can also invoke the REST API function similar to the Normal function.

To create a REST API function, follow these steps:

  1. Open Bigin Developer Console.
  2. Go to Automate > Functions.

    The Functions page appears.

  3. To create a new function, click New Function.
  4. On the Create Function page, do the following:
    • For Function Name, type the name of the function.

      Based on the name of the topping, the Namespace field is automatically generated.

    • For Invoke as REST API, select Yes.

      The Return Type is string by default.

      The argument of REST API is named as crmAPIRequest and classified under the Map type.

  5. Click Next.

    The Deluge Script Editor appears.

  6. Add the custom code as per your requirement, and then click Save & Close.

The new REST API function is created.