Configure a field to link items of two apps

The Field for linking option allows you to create a link between two apps to automatically synchronize related items.

Let's say you have the Requests and Clients apps. You want them to work as follows:

  1. An employee adds a request to the system and specifies the client who has sent the request. A link to this request is automatically added to the client's page.
  2. If the employee changes the client in the request, for example, to correct an error, the data about the related requests in the client pages is updated.
  3. The employee can attach the request to the client from their page. After this, the client is also automatically added to the request field.

 

To do this, it is required to add links in both apps using App-type properties. The Field for linking option is enabled by default for these apps. If field values must be filled in manually without automatic synchronization, you can cancel the link.

How the Field for linking option works:

  • It doesn't matter in which app settings you enable the option: data is updated in both directions.
  • You can only configure or cancel a link between apps when adding a field.
  • Once created, a link cannot be edited or deleted, as it is added at the database level. To configure a link through a different field or to disable automatic updates, you must add a new pair of fields to the apps and configure different settings for them.
  • Added links are validated when importing the exported app. If the field already exists in the target company and another link has been added for it, the app cannot be imported.

For more information on other available settings for the App-type field, see System data types.

Configure or cancel a link between apps

Let's look at how to configure or cancel a link when adding fields using two apps as an example:

  • Requests. Stores clients’ requests to fix problems and errors.
  • Clients. Stores the supported companies.

 

The client page has a field for recording all of their requests, and the Requests app has two fields with links to the Clients app:

 

  • All affected clients. All companies that encountered the error described in the request. Manually completed by employees, this field helps prioritize the issue.
  • Primary client. The author of the request. Links to all of their requests should be automatically saved to the author’s page.

 

To configure these fields:

 

  1. Go to the form settings of the Clients app. Add a field of the App type and specify the Requests app. Select the Many subtype, as this field stores all of the client's requests.
    field-for-linking-1
  2. Click Save.
  3. Open the Requests app and go to the form settings.
  4. Create a field of the App type with a link to the Clients app and name it All affected clients. Select the Many option, as this field will contain links to multiple clients.
     
    This field will store additional clients with the same issue, so the request should not be saved to their pages. Cancel synchronization of related items by selecting <New Field> next to the Field for linking option.
    field-for-linking-2
  5. Add another field of the App type with the link to the Clients app and name it Primary client. Select the One subtype, as the request always has one author.
     
    When a client is specified as the primary client in a request, a link to this request should be automatically added to their page. Therefore, the Field for linking option should be left blank.
    field-for-linking-3
  6. Save the form.

For the specified Requests field from the Clients app, the Field for linking option will be enabled automatically.

How the link works when creating an app item

When an employee adds information about a request to the system, they specify the client who applied.

field-for-linking-4

After saving, the link to the request is automatically added to the selected client's page in the Request field that was specified as the field for linking.

field-for-linking-5

How the link works when changing a field value

 

When apps are linked, you can update the list of related items after editing data.

 

Suppose, when adding a request, in the Primary client field, an employee selected the wrong client with a similar name. The link to the request was added to their page. To correct the data, a user with permission to edit app items in the Requests app must:

  1. Open the request page.
  2. Click Edit.
  3. Replace the item in the Primary client field.
  4. Click Save.

 

There's no need to edit any items of the Clients app. The request will be automatically removed from the incorrect client's page and added to the new one's page.