Skip to content

Relation picker behavior

The relation picker is the field which shows a relation to another lime type. For example, the Responsible field on a Company or Ticket type on a Ticket.

You can configure the behavior to suit the specific purpose. Sometimes you might want the user to be able to search anywhere in CRM and sometimes you might want to limit the options to a few. The Search is good for the previous and Option Queries are good for the latter. More on that below.

An example where both Suggestions and Search results are presented.

Suggestions

The Suggestions feature is always turned on. Suggestions can either be:

  • Built-in
  • Defined by an Option Query

Suggestions show up as soon as the user clicks the relation picker.

Built-in suggestions

The built-in suggestions work with no configuration. For most applications, this works well.

CRM will provide built-in suggestions according to this logic:

  1. If the current form or the relations in the current form has a connected company, the desired relation (the field to get suggestions for) of that connected company will be returned. For axample: “on a history card, only show persons connected to the same company as the history note. If the history card doesn’t have a company relation but a deal relation with a connected company, show persons connected to that company relation.”

  2. If no connected company is found, the suggested relations are based on the currently logged in coworker. The desired relation of the logged in coworker will be returned. For example: suggest companies where I am responsible.

  3. If none of the above conditions are met, the last created objects of the desired relation will be returned.

  4. We also always show the logged in user if the field holds Coworkers.

Option queries

Option queries are suggestions that are explicitely defined. They are the go-to thing when the built-in suggestions do not meet your requirements.

One example of a common option query is:

As a sales rep I can only connect the customer contact for a certain deal to the customer contacts that are connected to the customer that the deal is connected to.

Configuration

Option queries are configured by administrators in Lime Admin ➡ Card view configuration ➡ {desired field} ➡ Query

Option queries in Lime CRM Web Client uses Filters, which is a part of Lime Query to achieve the wanted behavior. The easist way to create a filter is by creating the filter in he Global Explorer, open the Filter editor, and copy the json from there.

Note

Besides defining a filter, you also need to provide the name of the desired limetype.

Examples
  1. Suggesting only active coworkers

    Wanted behavior: The user should get suggestions for active coworkers when connecting responsible salesperson to a deal.

    {
      "key": "inactive",
      "op": "=",
      "exp": false
    }
    

    limetype: coworker

  2. Suggesting active persons to deal

    Wanted behavior: The user should get suggestions for active persons connected to the same company as the deal.

    {
      "op": "AND", 
      "exp": [
        {
          "key": "inactive",
          "op": "=",
          "exp": false
    
        },
        {
          "key": "company",
          "op": "=",
          "exp": "%activeObject%.company"
        }
      ]
    }
    

    limetype: person

  3. Main helpdesktype

    Wanted behavior: The user should get suggestions for active, main helpdesktype when categorizing a helpdesk ticket.

    {
      "op": "AND",
      "exp": [
        {
          "key": "inactive",
          "op": "=",
          "exp": false
        },
        {
          "key": "mainhelpdesktype",
          "op": "=",
          "exp": null
        }
      ]
    }
    

    limetype: helpdesktype

  4. Sub helpdesktype

    Wanted behavior: Setting sub helpdesktype when working with tickets. The user should get suggestions for a subhelpdesktype that is active and that is connected to the same helpdesktype as “main helpdesktype” on the active object.

    {
      "op": "AND",
      "exp": [
        {
          "key": "inactive",
          "op": "=",
          "exp": false
        },
        {
          "key": "mainhelpdesktype",
          "op": "=",
          "exp": "%activeObject%.helpdesktype"
        }
      ]
    }
    

    limetype: helpdesktype

Search results

It is possible to also get search results, below the suggestions, in the relation picker. Search results complement the Suggestions when they fail to suggest the record the user is looking for.

Search results can either be on or off by using the setting Allow Global Search.

If the field is meant to "imitate" an option list, this setting should be turned off. Otherwise, it is recommended to have this setting turned on.

Search results use Elastic Search.