{"id":497,"date":"2017-05-05T16:26:41","date_gmt":"2017-05-05T20:26:41","guid":{"rendered":"https:\/\/www.ccrossan.com\/blog\/?p=497"},"modified":"2017-05-05T16:29:50","modified_gmt":"2017-05-05T20:29:50","slug":"infopath-notify-specific-changed-fields","status":"publish","type":"post","link":"https:\/\/crossan007.dev\/blog\/infopath\/infopath-notify-specific-changed-fields\/","title":{"rendered":"InfoPath Notify on Specific Changed Fields"},"content":{"rendered":"\n<div class=\"twitter-share\"><a href=\"https:\/\/twitter.com\/intent\/tweet?via=crossan007\" class=\"twitter-share-button\">Tweet<\/a><\/div>\n<h1>Scenario:<\/h1>\n<ul>\n<li>Notify specific users upon the change of any field in an infopath form excluding a limited number of fields.<\/li>\n<li>InfoPath Full Trust Form<\/li>\n<li>SharePoint designer Workflows<\/li>\n<\/ul>\n<p>I&#8217;ve seen lots of people ask for this, with a lot of \u00a0the same general response:<\/p>\n<blockquote><p>it&#8217;s not really possible to maintain field-specific change history, or field-specific alerting<\/p><\/blockquote>\n<p>I think that Solution 2 below could address this.<\/p>\n<h1>Solution 1:<\/h1>\n<p>set up rules on every field in the form to set &#8220;NotifyParticipatns&#8221; to 1 on change.<\/p>\n<p>Pros:<\/p>\n<ul>\n<li>No code required<\/li>\n<\/ul>\n<p>Cons:<\/p>\n<ul>\n<li>Lots of rules and room for error<\/li>\n<\/ul>\n<h2>Solution 2:<\/h2>\n<p>Global event listener for all xml fields. \u00a0Note the XPath selector used for registering the Changed event handler:<\/p>\n<pre>\"\/my:myFields\/*\"<\/pre>\n<p>Conditional for which fields should be included \/ excluded from the alert.<\/p>\n<p>Set the &#8220;NotifyParticipants&#8221; based on conditional result.<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n\r\n public void InternalStartup()\r\n {\r\n EventManager.FormEvents.Loading += new LoadingEventHandler(FormEvents_Loading);\r\n EventManager.XmlEvents[&quot;\/my:myFields\/*&quot;].Changed += new XmlChangedEventHandler(Form_Changed);\r\n }\r\n\r\n&lt;br data-mce-bogus=&quot;1&quot;&gt;\r\n\r\npublic void Form_Changed(object sender, XmlEventArgs e)\r\n {\r\n \/\/ Write your code here to change the main data source.\r\n List&amp;lt;string&amp;gt; AlertableFields = new List&amp;lt;string&amp;gt;();\r\n string ModifiedField = e.Site.Name.ToString();\r\n AlertableFields.Add(&quot;my:Street&quot;);\r\n if( AlertableFields.Contains(ModifiedField))\r\n {\r\n Debug.WriteLine(&quot;Alerting on &quot; + ModifiedField );\r\n }\r\n else{\r\n Debug.WriteLine(&quot;Not alerting on &quot; + ModifiedField );\r\n }\r\n \r\n }\r\n\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p>Pros:<\/p>\n<ul>\n<li>Much cleaner solution<\/li>\n<\/ul>\n<p>Cons:<\/p>\n<ul>\n<li>Code.<\/li>\n<li>Full Trust<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Scenario: Notify specific users upon the change of any field in an infopath form excluding a limited number of fields. InfoPath Full Trust Form SharePoint designer Workflows I&#8217;ve seen lots of people ask for this, with a lot of \u00a0the same general response: it&#8217;s not really possible to maintain field-specific change history, or field-specific alerting &hellip; <a href=\"https:\/\/crossan007.dev\/blog\/infopath\/infopath-notify-specific-changed-fields\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">InfoPath Notify on Specific Changed Fields<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[128],"tags":[129,130,207,15],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v17.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/crossan007.dev\/blog\/infopath\/infopath-notify-specific-changed-fields\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"InfoPath Notify on Specific Changed Fields - Charles&#039; Blog\" \/>\n<meta property=\"og:description\" content=\"Scenario: Notify specific users upon the change of any field in an infopath form excluding a limited number of fields. InfoPath Full Trust Form SharePoint designer Workflows I&#8217;ve seen lots of people ask for this, with a lot of \u00a0the same general response: it&#8217;s not really possible to maintain field-specific change history, or field-specific alerting &hellip; Continue reading InfoPath Notify on Specific Changed Fields &rarr;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/crossan007.dev\/blog\/infopath\/infopath-notify-specific-changed-fields\/\" \/>\n<meta property=\"og:site_name\" content=\"Charles&#039; Blog\" \/>\n<meta property=\"article:published_time\" content=\"2017-05-05T20:26:41+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2017-05-05T20:29:50+00:00\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"crossan007\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/crossan007.dev\/blog\/#website\",\"url\":\"https:\/\/crossan007.dev\/blog\/\",\"name\":\"Charles&#039; Blog\",\"description\":\"SharePoint | PowerShell | Exchange | SCCM | Ubuntu | PHP | JavaScript | A\/V Live Production | More...\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/crossan007.dev\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/crossan007.dev\/blog\/infopath\/infopath-notify-specific-changed-fields\/#webpage\",\"url\":\"https:\/\/crossan007.dev\/blog\/infopath\/infopath-notify-specific-changed-fields\/\",\"name\":\"InfoPath Notify on Specific Changed Fields - Charles&#039; Blog\",\"isPartOf\":{\"@id\":\"https:\/\/crossan007.dev\/blog\/#website\"},\"datePublished\":\"2017-05-05T20:26:41+00:00\",\"dateModified\":\"2017-05-05T20:29:50+00:00\",\"author\":{\"@id\":\"https:\/\/crossan007.dev\/blog\/#\/schema\/person\/bd99569cd81332c8fd866d023848b979\"},\"breadcrumb\":{\"@id\":\"https:\/\/crossan007.dev\/blog\/infopath\/infopath-notify-specific-changed-fields\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/crossan007.dev\/blog\/infopath\/infopath-notify-specific-changed-fields\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/crossan007.dev\/blog\/infopath\/infopath-notify-specific-changed-fields\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/crossan007.dev\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"InfoPath Notify on Specific Changed Fields\"}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/crossan007.dev\/blog\/#\/schema\/person\/bd99569cd81332c8fd866d023848b979\",\"name\":\"crossan007\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/crossan007.dev\/blog\/#personlogo\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/fff72c74fb6a0da29accf0db83ad4b4b?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/fff72c74fb6a0da29accf0db83ad4b4b?s=96&d=mm&r=g\",\"caption\":\"crossan007\"},\"url\":\"https:\/\/crossan007.dev\/blog\/author\/crossan007\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/crossan007.dev\/blog\/infopath\/infopath-notify-specific-changed-fields\/","og_locale":"en_US","og_type":"article","og_title":"InfoPath Notify on Specific Changed Fields - Charles&#039; Blog","og_description":"Scenario: Notify specific users upon the change of any field in an infopath form excluding a limited number of fields. InfoPath Full Trust Form SharePoint designer Workflows I&#8217;ve seen lots of people ask for this, with a lot of \u00a0the same general response: it&#8217;s not really possible to maintain field-specific change history, or field-specific alerting &hellip; Continue reading InfoPath Notify on Specific Changed Fields &rarr;","og_url":"https:\/\/crossan007.dev\/blog\/infopath\/infopath-notify-specific-changed-fields\/","og_site_name":"Charles&#039; Blog","article_published_time":"2017-05-05T20:26:41+00:00","article_modified_time":"2017-05-05T20:29:50+00:00","twitter_misc":{"Written by":"crossan007","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebSite","@id":"https:\/\/crossan007.dev\/blog\/#website","url":"https:\/\/crossan007.dev\/blog\/","name":"Charles&#039; Blog","description":"SharePoint | PowerShell | Exchange | SCCM | Ubuntu | PHP | JavaScript | A\/V Live Production | More...","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/crossan007.dev\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/crossan007.dev\/blog\/infopath\/infopath-notify-specific-changed-fields\/#webpage","url":"https:\/\/crossan007.dev\/blog\/infopath\/infopath-notify-specific-changed-fields\/","name":"InfoPath Notify on Specific Changed Fields - Charles&#039; Blog","isPartOf":{"@id":"https:\/\/crossan007.dev\/blog\/#website"},"datePublished":"2017-05-05T20:26:41+00:00","dateModified":"2017-05-05T20:29:50+00:00","author":{"@id":"https:\/\/crossan007.dev\/blog\/#\/schema\/person\/bd99569cd81332c8fd866d023848b979"},"breadcrumb":{"@id":"https:\/\/crossan007.dev\/blog\/infopath\/infopath-notify-specific-changed-fields\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/crossan007.dev\/blog\/infopath\/infopath-notify-specific-changed-fields\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/crossan007.dev\/blog\/infopath\/infopath-notify-specific-changed-fields\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/crossan007.dev\/blog\/"},{"@type":"ListItem","position":2,"name":"InfoPath Notify on Specific Changed Fields"}]},{"@type":"Person","@id":"https:\/\/crossan007.dev\/blog\/#\/schema\/person\/bd99569cd81332c8fd866d023848b979","name":"crossan007","image":{"@type":"ImageObject","@id":"https:\/\/crossan007.dev\/blog\/#personlogo","inLanguage":"en-US","url":"https:\/\/secure.gravatar.com\/avatar\/fff72c74fb6a0da29accf0db83ad4b4b?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/fff72c74fb6a0da29accf0db83ad4b4b?s=96&d=mm&r=g","caption":"crossan007"},"url":"https:\/\/crossan007.dev\/blog\/author\/crossan007\/"}]}},"_links":{"self":[{"href":"https:\/\/crossan007.dev\/blog\/wp-json\/wp\/v2\/posts\/497"}],"collection":[{"href":"https:\/\/crossan007.dev\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/crossan007.dev\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/crossan007.dev\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/crossan007.dev\/blog\/wp-json\/wp\/v2\/comments?post=497"}],"version-history":[{"count":2,"href":"https:\/\/crossan007.dev\/blog\/wp-json\/wp\/v2\/posts\/497\/revisions"}],"predecessor-version":[{"id":499,"href":"https:\/\/crossan007.dev\/blog\/wp-json\/wp\/v2\/posts\/497\/revisions\/499"}],"wp:attachment":[{"href":"https:\/\/crossan007.dev\/blog\/wp-json\/wp\/v2\/media?parent=497"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/crossan007.dev\/blog\/wp-json\/wp\/v2\/categories?post=497"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/crossan007.dev\/blog\/wp-json\/wp\/v2\/tags?post=497"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}