{"id":778,"date":"2022-01-13T11:44:38","date_gmt":"2022-01-13T11:44:38","guid":{"rendered":"https:\/\/logicbuilder.integroscrm.com\/help\/?page_id=778"},"modified":"2022-08-03T17:30:01","modified_gmt":"2022-08-03T17:30:01","slug":"on-link-change","status":"publish","type":"page","link":"https:\/\/logicbuilder.integroscrm.com\/help\/on-link-change\/","title":{"rendered":"On Link Change"},"content":{"rendered":"\n<p><a name=\"abstract\"><\/a>Fires the flowchart logic when relationships between Sugar records are changed. This is the Start Element of the flowchart.<\/p>\n\n\n\n<p>A relationship is changed means that&nbsp;relationship is either added between two records or removed. Works for many-to-many and one-to-many relationship types.<\/p>\n\n\n<div style=\"background-color: #ddeaff; border-left: 6px solid #0072b3; padding: 12px;\">\n<p>On link change isn\u2019t fired for related fields or flex relate type of fields<\/p>\n<\/div>\n\n\n<p><br>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.<\/p>\n\n\n\n<p><strong>inputs:<\/strong><\/p>\n\n\n\n<p><span style=\"color:#9ed267;\">Object Module<\/span> \u2013 select from the list module of the record, to which a relationship is added or removed<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Required: yes<\/li><\/ul>\n\n\n\n<p><span style=\"color:#9ed267;\">Subject Module<\/span> \u2013 select from the list module of the record at the other side of the added or removed relationship<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Required: yes<\/li><\/ul>\n\n\n\n<p><span style=\"color:#9ed267;\">Link name<\/span> \u2013 select from the list, which appears once both object and subject modules are selected, relationship name between two selected modules.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Required: yes<\/li><\/ul>\n\n\n\n<p><span style=\"color:#9ed267;\">Event Type<\/span> \u2013 select when flowchart logic runs before or after a relationship has been added or removed<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Required: yes<\/li><\/ul>\n\n\n\n<p><strong>outputs<\/strong>:<\/p>\n\n\n\n<p><span style=\"color:#ef6950;\">object entity<\/span> &#8211; a primary record of the relationship. Usually followed by <a href=\"https:\/\/logicbuilder.integroscrm.com\/help\/get-entity-attributes\/\">Get Entity Attributes<\/a> or <a href=\"https:\/\/logicbuilder.integroscrm.com\/help\/set-entity-attributes\/\">Set Entity Attributes<\/a>.<\/p>\n\n\n\n<p><span style=\"color:#ef6950;\">subject entity<\/span> &#8211; a related record. Usually followed by <a href=\"https:\/\/logicbuilder.integroscrm.com\/help\/get-entity-attributes\/\">Get Entity Attributes<\/a> or <a href=\"https:\/\/logicbuilder.integroscrm.com\/help\/set-entity-attributes\/\">Set Entity Attributes<\/a>.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/logicbuilder.integroscrm.com\/help\/wp-content\/uploads\/2022\/01\/img-94-d0accdd6408e4b05b6a87259114717e8-1024x284.png\" alt=\"\" class=\"wp-image-781\" width=\"994\" height=\"276\" srcset=\"https:\/\/logicbuilder.integroscrm.com\/help\/wp-content\/uploads\/2022\/01\/img-94-d0accdd6408e4b05b6a87259114717e8-1024x284.png 1024w, https:\/\/logicbuilder.integroscrm.com\/help\/wp-content\/uploads\/2022\/01\/img-94-d0accdd6408e4b05b6a87259114717e8-300x83.png 300w, https:\/\/logicbuilder.integroscrm.com\/help\/wp-content\/uploads\/2022\/01\/img-94-d0accdd6408e4b05b6a87259114717e8-768x213.png 768w, https:\/\/logicbuilder.integroscrm.com\/help\/wp-content\/uploads\/2022\/01\/img-94-d0accdd6408e4b05b6a87259114717e8-1536x425.png 1536w, https:\/\/logicbuilder.integroscrm.com\/help\/wp-content\/uploads\/2022\/01\/img-94-d0accdd6408e4b05b6a87259114717e8.png 1596w\" sizes=\"auto, (max-width: 994px) 100vw, 994px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/logicbuilder.integroscrm.com\/help\/wp-content\/uploads\/2022\/01\/img-94-bdf4c8822bb54f0baa2073be6d1e1b04-1024x450.png\" alt=\"\" class=\"wp-image-780\" width=\"806\" height=\"354\" srcset=\"https:\/\/logicbuilder.integroscrm.com\/help\/wp-content\/uploads\/2022\/01\/img-94-bdf4c8822bb54f0baa2073be6d1e1b04-1024x450.png 1024w, https:\/\/logicbuilder.integroscrm.com\/help\/wp-content\/uploads\/2022\/01\/img-94-bdf4c8822bb54f0baa2073be6d1e1b04-300x132.png 300w, https:\/\/logicbuilder.integroscrm.com\/help\/wp-content\/uploads\/2022\/01\/img-94-bdf4c8822bb54f0baa2073be6d1e1b04-768x338.png 768w, https:\/\/logicbuilder.integroscrm.com\/help\/wp-content\/uploads\/2022\/01\/img-94-bdf4c8822bb54f0baa2073be6d1e1b04.png 1438w\" sizes=\"auto, (max-width: 806px) 100vw, 806px\" \/><\/figure>\n\n\n<div style=\"background-color: #ddeaff; border-left: 6px solid #0072b3; padding: 12px;\">\n<p>Note to one-to-many relationships and On Link Change<\/p>\n<p>The one-to-many relationship is represented as a field on a &#8216;child&#8217; record and as a subpanel in a &#8216;parent&#8217; record.<\/p>\n<p>When the &#8216;child&#8217; record is added\/removed to\/from the &#8216;parent&#8217; record through subpanel, Sugar executes on_link_change hooks, which implements with On Link Change operator.<\/p>\n<p>Any changes made to the subject or object entity in such flowchart must be saved with <a href=\"https:\/\/logicbuilder.integroscrm.com\/help\/save-entity\/\">Save Entity<\/a>.<\/p>\n<p>However, when the &#8216;parent&#8217; record is added\/removed through the related field on a child record, Sugar executes on_link_change hooks and then saves the &#8216;child&#8217; entity itself. This means that any changes made to &#8216;child&#8217; entity within the flowchart will be saved regardless <a href=\"https:\/\/logicbuilder.integroscrm.com\/help\/save-entity\/\">Save Entity<\/a> operator.<\/p>\n<p>In the example below when Contact is added to Account, the flowchart updates Contact description, but there is no <a href=\"https:\/\/logicbuilder.integroscrm.com\/help\/save-entity\/\">Save Entity<\/a> after <a href=\"https:\/\/logicbuilder.integroscrm.com\/help\/set-entity-attributes\/\">Set Entity Attributes<\/a>:<\/p>\n<p><a href=\"https:\/\/logicbuilder.integroscrm.com\/help\/wp-content\/uploads\/2022\/01\/img-94-dd3963bd248f4d039c94cda85e96de0a.png\" rel=\"prettyPhoto\"><img decoding=\"async\" src=\"https:\/\/logicbuilder.integroscrm.com\/help\/wp-content\/uploads\/2022\/01\/img-94-dd3963bd248f4d039c94cda85e96de0a-1024x339.png\" alt=\"\" class=\"wp-image-378\"><\/a><\/p>\n<p>This flowchart works as follows:<\/p>\n<ul>\n<li>when Contact is added or created on &#8216;Contacts&#8217; subpanel, Description field is not updated<\/li>\n<li>when Account is specified in the Account field on Contact recordview, Description field is updated<\/li>\n<\/ul>\n<\/div><div style=\"text-align:left\" class=\"yasr-auto-insert-visitor\"><!--Yasr Visitor Votes Shortcode--><div id='yasr_visitor_votes_778' class='yasr-visitor-votes'><div class=\"yasr-custom-text-vv-before yasr-custom-text-vv-before-778\">Click to rate this post!<\/div><div id='yasr-vv-second-row-container-09845fab67dbe' \n                                        class='yasr-vv-second-row-container'><div id='yasr-visitor-votes-rater-09845fab67dbe'\n                                      class='yasr-rater-stars-vv'\n                                      data-rater-postid='778' \n                                      data-rating='0'\n                                      data-rater-starsize='24'\n                                      data-rater-readonly='false'\n                                      data-rater-nonce='fa81b01ba5' \n                                      data-issingular='false'\n                                    ><\/div><div class=\"yasr-vv-stats-text-container\" id=\"yasr-vv-stats-text-container-09845fab67dbe\"><svg xmlns=\"https:\/\/www.w3.org\/2000\/svg\" width=\"20\" height=\"20\" \n                               class=\"yasr-dashicons-visitor-stats\"\n                               data-postid=\"778\" \n                               id=\"yasr-stats-dashicon-09845fab67dbe\">\n                            <path d=\"M18 18v-16h-4v16h4zM12 18v-11h-4v11h4zM6 18v-8h-4v8h4z\"><\/path>\n                          <\/svg><span id=\"yasr-vv-text-container-09845fab67dbe\" class=\"yasr-vv-text-container\">[Total: <span id=\"yasr-vv-votes-number-container-09845fab67dbe\">0<\/span>  Average: <span id=\"yasr-vv-average-container-09845fab67dbe\">0<\/span>]<\/span><\/div><div id='yasr-vv-loader-09845fab67dbe' class='yasr-vv-container-loader'><\/div><\/div><div id='yasr-vv-bottom-container-09845fab67dbe' class='yasr-vv-bottom-container'><\/div><\/div><!--End Yasr Visitor Votes Shortcode--><\/div>","protected":false},"excerpt":{"rendered":"<p>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&nbsp;relationship is either added between two records or removed. Works for many-to-many and one-to-many relationship types. On link change isn\u2019t fired for related fields or flex relate type of fields Use &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"\" href=\"https:\/\/logicbuilder.integroscrm.com\/help\/on-link-change\/\"> <span class=\"screen-reader-text\">On Link Change<\/span> Read More &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"yasr_overall_rating":0,"yasr_post_is_review":"","yasr_auto_insert_disabled":"","yasr_review_type":"","footnotes":""},"tags":[],"class_list":["post-778","page","type-page","status-publish","hentry"],"yasr_visitor_votes":{"number_of_votes":0,"sum_votes":0,"stars_attributes":{"read_only":false,"span_bottom":false}},"_links":{"self":[{"href":"https:\/\/logicbuilder.integroscrm.com\/help\/wp-json\/wp\/v2\/pages\/778","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/logicbuilder.integroscrm.com\/help\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/logicbuilder.integroscrm.com\/help\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/logicbuilder.integroscrm.com\/help\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/logicbuilder.integroscrm.com\/help\/wp-json\/wp\/v2\/comments?post=778"}],"version-history":[{"count":4,"href":"https:\/\/logicbuilder.integroscrm.com\/help\/wp-json\/wp\/v2\/pages\/778\/revisions"}],"predecessor-version":[{"id":2068,"href":"https:\/\/logicbuilder.integroscrm.com\/help\/wp-json\/wp\/v2\/pages\/778\/revisions\/2068"}],"wp:attachment":[{"href":"https:\/\/logicbuilder.integroscrm.com\/help\/wp-json\/wp\/v2\/media?parent=778"}],"wp:term":[{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/logicbuilder.integroscrm.com\/help\/wp-json\/wp\/v2\/tags?post=778"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}