On Link Change

Fires the flowchart logic when relationships between Sugar records are changed. This is the Start Element of the flowchart.

A relationship is changed means that relationship is either added between two records or removed. Works for many-to-many and one-to-many relationship types.

On link change isn’t fired for related fields or flex relate type of fields


Use this operator whenever it is needed to implement logic when a record is added or removed on a subpanel (the new one is created or the existing one is linked/unlinked) or when a related field from a one-to-many relationship is filled or changed.

inputs:

Object Module – select from the list module of the record, to which a relationship is added or removed

  • Required: yes

Subject Module – select from the list module of the record at the other side of the added or removed relationship

  • Required: yes

Link name – select from the list, which appears once both object and subject modules are selected, relationship name between two selected modules.

  • Required: yes

Event Type – select when flowchart logic runs before or after a relationship has been added or removed

  • Required: yes

outputs:

object entity – a primary record of the relationship. Usually followed by Get Entity Attributes or Set Entity Attributes.

subject entity – a related record. Usually followed by Get Entity Attributes or Set Entity Attributes.

Note to one-to-many relationships and On Link Change

The one-to-many relationship is represented as a field on a ‘child’ record and as a subpanel in a ‘parent’ record.

When the ‘child’ record is added/removed to/from the ‘parent’ record through subpanel, Sugar executes on_link_change hooks, which implements with On Link Change operator.

Any changes made to the subject or object entity in such flowchart must be saved with Save Entity.

However, when the ‘parent’ record is added/removed through the related field on a child record, Sugar executes on_link_change hooks and then saves the ‘child’ entity itself. This means that any changes made to ‘child’ entity within the flowchart will be saved regardless Save Entity operator.

In the example below when Contact is added to Account, the flowchart updates Contact description, but there is no Save Entity after Set Entity Attributes:

This flowchart works as follows:

  • when Contact is added or created on ‘Contacts’ subpanel, Description field is not updated
  • when Account is specified in the Account field on Contact recordview, Description field is updated
Click to rate this post!
[Total: 0 Average: 0]

Leave a Reply

Your email address will not be published. Required fields are marked *