{"id":1175,"date":"2022-02-11T16:46:08","date_gmt":"2022-02-11T16:46:08","guid":{"rendered":"https:\/\/logicbuilder.integroscrm.com\/help\/?page_id=1175"},"modified":"2022-08-12T16:16:33","modified_gmt":"2022-08-12T16:16:33","slug":"on-validation","status":"publish","type":"page","link":"https:\/\/logicbuilder.integroscrm.com\/help\/on-validation\/","title":{"rendered":"On Validation"},"content":{"rendered":"\n<p><a name=\"abstract\"><\/a>Fires the flowchart before a record is saved and works directly on the form implementing validation rules. It is possible to check whether some field contains a particular value, whether a value complies with a format, or check related records to the current one. For example: check whether a Case is in an appropriate status prior to sending an email to a Client, or whether mobile phone in Lead corresponds to format, or whether parent Bug status is in an appropriate status to close related Case.<\/p>\n\n\n\n<p>Validation rules work in RecordView, on ListView, and subpanels in the Sugar Interface. Unlike <a href=\"https:\/\/logicbuilder.integroscrm.com\/help\/on-data-change\/\">On Data Change<\/a> or <a href=\"https:\/\/logicbuilder.integroscrm.com\/help\/on-link-change\/\">On Link Change<\/a>, On Validation doesn&#8217;t work when the record is saved on the server, e.g. through API. To implement rules for such save please see <a href=\"https:\/\/logicbuilder.integroscrm.com\/help\/throw-exception\/\">Throw Exception<\/a>.<\/p>\n\n\n\n<p>&nbsp;Each On Validation flowchart must contain operator <a href=\"https:\/\/logicbuilder.integroscrm.com\/help\/add-validation-violation\/\">Add Validation Violation<\/a>.<\/p>\n\n\n<div style=\"background-color: #ddeaff; border-left: 6px solid #0072b3; padding: 12px;\">\n<p>After the flowchart which starts from On Validation is deployed on the Sugar instance it is necessary to clean the browser cache so that implemented rule works.<\/p>\n<\/div>\n<p><!-- \/wp:post-content --><\/p>\n<p><!-- wp:paragraph --><\/p>\n<p><strong>inputs:<\/strong><\/p>\n<p><!-- \/wp:paragraph --><\/p>\n<p><!-- wp:paragraph --><\/p>\n<p>select from the list a module for which records validation rule is needed.<\/p>\n<p><!-- \/wp:paragraph --><\/p>\n<p><!-- wp:list --><\/p>\n<ul>\n<li>Required: yes<\/li>\n<\/ul>\n<p><!-- \/wp:list --><\/p>\n<p><!-- wp:paragraph --><\/p>\n<p><strong>outputs:<\/strong><\/p>\n<p><!-- \/wp:paragraph --><\/p>\n<p><!-- wp:paragraph --><\/p>\n<p><span style=\"color:#ef6950;\">entity<\/span> &#8211; a record which user is saving. Here entity is in the state as it a user saves it. Commonly followed by <a href=\"https:\/\/logicbuilder.integroscrm.com\/help\/get-entity-attributes\/\">Get Entity Attributes<\/a>.<\/p>\n<p><!-- \/wp:paragraph --><\/p>\n<p><!-- wp:paragraph --><\/p>\n<p><span style=\"color:#ef6950;\">previous values<\/span> &#8211; a record in a state of how it was before the most recent changes. Commonly followed by <a href=\"https:\/\/logicbuilder.integroscrm.com\/help\/get-entity-attributes\/\">Get Entity Attributes<\/a> and is compared with output from entity to check whether particular fields values were changed.<\/p>\n<p><!-- \/wp:paragraph --><\/p>\n<p><!-- wp:paragraph --><\/p>\n<p><span style=\"color:#deb7ca;\">is new<\/span> &#8211; contains true when the record is new or false when this is an update of the existing one<\/p>\n<p><!-- \/wp:paragraph --><\/p>\n<p><!-- wp:paragraph --><\/p>\n<p><span style=\"color:#9ed267;\">changed fields<\/span> &#8211; a collection of fields system names that were changed. Unlike similar output from <a href=\"https:\/\/logicbuilder.integroscrm.com\/help\/on-data-change\/\">On Data Change<\/a>, this port doesn&#8217;t contain fields like&nbsp;<em>date_modified<\/em>&nbsp;or&nbsp;<em>modified_by<\/em>&nbsp;as the record wasn&#8217;t saved yet<\/p>\n<p><!-- \/wp:paragraph --><\/p>\n<p><a href=\"https:\/\/logicbuilder.integroscrm.com\/help\/wp-content\/uploads\/2022\/02\/img-173-9d42ffc8e0484e1abad2a535f61dbe08.png\" rel=\"prettyPhoto\"><img decoding=\"async\" src=\"https:\/\/logicbuilder.integroscrm.com\/help\/wp-content\/uploads\/2022\/02\/img-173-9d42ffc8e0484e1abad2a535f61dbe08-1024x233.png\" alt=\"\" class=\"wp-image-378\"><\/a><\/p><div style=\"text-align:left\" class=\"yasr-auto-insert-visitor\"><!--Yasr Visitor Votes Shortcode--><div id='yasr_visitor_votes_1175' class='yasr-visitor-votes'><div class=\"yasr-custom-text-vv-before yasr-custom-text-vv-before-1175\">Click to rate this post!<\/div><div id='yasr-vv-second-row-container-09e5ac904006a' \n                                        class='yasr-vv-second-row-container'><div id='yasr-visitor-votes-rater-09e5ac904006a'\n                                      class='yasr-rater-stars-vv'\n                                      data-rater-postid='1175' \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-09e5ac904006a\"><svg xmlns=\"https:\/\/www.w3.org\/2000\/svg\" width=\"20\" height=\"20\" \n                               class=\"yasr-dashicons-visitor-stats\"\n                               data-postid=\"1175\" \n                               id=\"yasr-stats-dashicon-09e5ac904006a\">\n                            <path d=\"M18 18v-16h-4v16h4zM12 18v-11h-4v11h4zM6 18v-8h-4v8h4z\"><\/path>\n                          <\/svg><span id=\"yasr-vv-text-container-09e5ac904006a\" class=\"yasr-vv-text-container\">[Total: <span id=\"yasr-vv-votes-number-container-09e5ac904006a\">0<\/span>  Average: <span id=\"yasr-vv-average-container-09e5ac904006a\">0<\/span>]<\/span><\/div><div id='yasr-vv-loader-09e5ac904006a' class='yasr-vv-container-loader'><\/div><\/div><div id='yasr-vv-bottom-container-09e5ac904006a' class='yasr-vv-bottom-container'><\/div><\/div><!--End Yasr Visitor Votes Shortcode--><\/div>","protected":false},"excerpt":{"rendered":"<p>Fires the flowchart before a record is saved and works directly on the form implementing validation rules. It is possible to check whether some field contains a particular value, whether a value complies with a format, or check related records to the current one. For example: check whether a Case is in an appropriate status &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"\" href=\"https:\/\/logicbuilder.integroscrm.com\/help\/on-validation\/\"> <span class=\"screen-reader-text\">On Validation<\/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-1175","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\/1175","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=1175"}],"version-history":[{"count":4,"href":"https:\/\/logicbuilder.integroscrm.com\/help\/wp-json\/wp\/v2\/pages\/1175\/revisions"}],"predecessor-version":[{"id":2159,"href":"https:\/\/logicbuilder.integroscrm.com\/help\/wp-json\/wp\/v2\/pages\/1175\/revisions\/2159"}],"wp:attachment":[{"href":"https:\/\/logicbuilder.integroscrm.com\/help\/wp-json\/wp\/v2\/media?parent=1175"}],"wp:term":[{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/logicbuilder.integroscrm.com\/help\/wp-json\/wp\/v2\/tags?post=1175"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}