Using Custom CRM Variables

The Custom Properties of the developer console allow you to create CRM Variables that are helpful in a variety of situations depending on your business requirements.

CRM Variables are pseudo-module fields that store static and reusable data in your Bigin account. You can use CRM Variables in email templates, and they can also be utilized as reusable authentication parameters in custom functions, APIs, webhooks, custom links and buttons.

The Custom Properties section allows you to do the following:

  • Create a new CRM variable
  • Set up a custom function for the CRM variable
  • Manage the CRM variables
Note

Only users with administrative privileges can create and manage the CRM variables.

Create a new CRM variable

To create a new CRM variable, follow these steps:

  1. In your developer console, navigate to the Custom Properties section.
  2. Click the Create New Variable button.
  3. On the Create CRM Variable page, do the following:
    1. In the Variable Name field, type a name for the CRM variable.
    2. In the API Name field, type a name for API.
    3. In the Description field, type a description for the CRM variable.
    4. From the Variable Type drop-down list, select Single Line, which is a default value.
    5. For the Variable Status drop-down list, select a status for the CRM variable.
    6. In the Value field, type an initial value for the CRM variable.
  4. Click Save.

The CRM variable uses the Single Line data type by default. The Single Line data type offers one line that displays information to the user or lets the user provide information in the form of text, numbers, or special characters.

Also, the CRM variable is associated with a variable status that defines the usage of the variable and restricts the users from accessing it. While creating a new CRM variable, you can assign one of the following variable statuses depending on your business needs:

  • Read Only - Users are not allowed to change the values of the CRM variables with Read Only status. The Read Only variables only display information.
  • Hidden - These variables are abstracted from the user but can change the functionality of a feature as needed.

Set up a custom function for the CRM variable

After you create a new CRM variable, you can now set up a custom function. When a user or system edits the value of the variable, the custom function is invoked to update the value of the variable.

You can configure custom function for only Hidden and Read Only variables.

To configure the custom function, from the list of CRM Variables, under Field Value - On Change, click the Write Script link for the CRM variable you want to customize. The Deluge Script editor appears.

In the custom function, you can use variableMap to obtain old and new values of the custom variable. The syntax for obtaining old and new values of the custom variable using variableMap looks as shown below:

To get the old value, use the following:

<oldvalue> = input.variableMap.get("oldvalue");

To get the new value, use the following:

<newvalue> = input.variableMap.get("newvalue");

Manage the CRM variables

After setting up a custom function for a CRM variable, you can also further manage the list of CRM variables directly from the Custom Properties section. You can update the variable and its associated custom function as needed, moreover, you can remove the variable if not required.

On the CRM Variable page, from the list of CRM variables, hover over the variable you want to update, and then next to Variable Name, click the Pencil icon. When the Edit CRM Variable page appears, update the details as needed.

When you update a CRM variable, you can only edit the following field values:

  • Variable Name
  • Description
  • Variable Status for Hidden and Read Only variables
  • Value

To update the custom function, from the list of CRM Variables, under Field Value - On Change, click the Edit Script link of a CRM variable. When the Deluge Script editor appears, update the script of custom function as needed, and click Save.

On the CRM Variable page, from the list of CRM variables, hover over the variable you want to remove, and then next to Variable Name, click the Delete icon. When the confirmation window appears, click the Delete button.

If the CRM variable is added to any of the places, such as email templates, custom functions or webhooks, you must disassociate them before deleting from the CRM Variables section.