Creating a Custom Method

Follow these steps to create a custom method:

  1. From the Setup Home page of your application, select Custom Methods from the ribbon.

    Or From the Application Setup page of your application, select Custom Methods.

    The page scrolls to the Custom Method section:

  2. Click New Custom Method.
    The New Custom Method page opens:

  3. Enter the following information:
    • Define Custom Method:
      • Name: Add a descriptive name for the custom method.
      • Description: Add a description for the custom method.
      • End Point: Unique name for the custom method which add up to the URL.
    • Define HTTP methods:
      • Template Helper - Use the Template Helper and formula editor to create and validate the custom method.

      • HTTP Verb - Script to be executed when any of the HTTP verb (GET, POST, PUT or DELETE) call is initiated with the above mentioned endpoint.

      • Hosted Files - Provision to attach hosted files to a script (can be chosen for each HTTP verb). Hosted files can be used to combine javascript code that can be commonly used in different custom methods. These files are resolved as regular javascript files.

        Click on the magnifier icon and select any Hosted File as shown in the following screen.

  4. Validate Formula : Click Validate Formula for quick validation of the formula's syntax.
    Note: Formula validation only checks JavaScript syntax validity.
  5. Log: Click to view the debug log file.
  6. Permissions: You can manage permissions across all the HTTP verbs (GET, POST, PUT & DELETE) either to a specific role or an individual user.
  7. Save: Click Save. The saved custom method appears in the Custom Methods page.