<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>post Business Rule not working in ITSM articles</title>
    <link>https://www.servicenow.com/community/itsm-articles/business-rule-not-working/ta-p/2303711</link>
    <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have wriiten a BR as below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;When to run: after update&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;on table: communication(Parent table)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Conditions: NA or status is 'Deliverable approval'&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;CODE:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var prev_status = previous.u_status;&lt;/P&gt;&lt;P&gt;var event_deliverable = current.u_event_type;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(event_deliverable == 'Paper'){&lt;/P&gt;&lt;P&gt;if((prev_status != 'Deliverable Approval') &amp;amp;&amp;amp; (current.u_attachment_added.changes() || current.u_attachment_added == true)){&lt;/P&gt;&lt;P&gt;var gr_paper = new GlideRecord('u_paper_event');&lt;/P&gt;&lt;P&gt;gr_paper.addQuery('u_case_id_ref',current.sys_id);&lt;/P&gt;&lt;P&gt;gr_paper.query();&lt;/P&gt;&lt;P&gt;while(gr_paper.next()){&lt;/P&gt;&lt;P&gt;gr_paper.u_paper_last_email_date = gs.nowDateTime();&lt;/P&gt;&lt;P&gt;gr_paper.update();&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;else{&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The above business run should run when an attachment is attached.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kindly guide me on this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sachin&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;one quick question about &lt;SPAN style="color: #666666; font-family: arial, sans-serif;"&gt;u_attachment_added.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #666666; font-family: arial, sans-serif;"&gt;what kind of field is this? Boolean type?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #666666; font-family: arial, sans-serif;"&gt;can you put some log in your business rule to check which if block is working or not..&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hi Harsh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;u_attachment_added is a boolean type.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The BR itself is not getting triggered when the attachment is attached.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NOTE: the form does not re-load / update when attachment is added.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sachin&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if i am not wrong when ever you attach some file on your form then Boolean type field get updated?&lt;/P&gt;&lt;P&gt;or some other mechanism you have establish to check the attachment on your form?&lt;/P&gt;&lt;P&gt;kindly elaborate your business requirement. &amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hi Harsh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes 'u_attached_added' field is getting updated because in another BR i am doing as below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;When an attachment is attached:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;(current.u_attachment_added.changes() &amp;amp;&amp;amp; current.u_attachment_added == true)&lt;/P&gt;&lt;P&gt;and triggering an event&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sachin&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This document was generated from the following discussion: &lt;A title="Business Rule not working" __default_attr="295355" __jive_macro_name="thread" class="jive_macro_thread jive_macro" data-orig-content="Business Rule not working" data-renderedposition="1417_386.1875_184_16" href="https://www.servicenow.com/community?id=community_question&amp;amp;sys_id=39b447e9dbd8dbc01dcaf3231f9619b6"&gt;Business Rule not working&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 27 Dec 2017 10:04:50 GMT</pubDate>
    <dc:creator>Narayana RC</dc:creator>
    <dc:date>2017-12-27T10:04:50Z</dc:date>
    <item>
      <title>Business Rule not working</title>
      <link>https://www.servicenow.com/community/itsm-articles/business-rule-not-working/ta-p/2303711</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have wriiten a BR as below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;When to run: after update&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;on table: communication(Parent table)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Conditions: NA or status is 'Deliverable approval'&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;CODE:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var prev_status = previous.u_status;&lt;/P&gt;&lt;P&gt;var event_deliverable = current.u_event_type;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(event_deliverable == 'Paper'){&lt;/P&gt;&lt;P&gt;if((prev_status != 'Deliverable Approval') &amp;amp;&amp;amp; (current.u_attachment_added.changes() || current.u_attachment_added == true)){&lt;/P&gt;&lt;P&gt;var gr_paper = new GlideRecord('u_paper_event');&lt;/P&gt;&lt;P&gt;gr_paper.addQuery('u_case_id_ref',current.sys_id);&lt;/P&gt;&lt;P&gt;gr_paper.query();&lt;/P&gt;&lt;P&gt;while(gr_paper.next()){&lt;/P&gt;&lt;P&gt;gr_paper.u_paper_last_email_date = gs.nowDateTime();&lt;/P&gt;&lt;P&gt;gr_paper.update();&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;else{&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The above business run should run when an attachment is attached.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kindly guide me on this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sachin&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;one quick question about &lt;SPAN style="color: #666666; font-family: arial, sans-serif;"&gt;u_attachment_added.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #666666; font-family: arial, sans-serif;"&gt;what kind of field is this? Boolean type?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #666666; font-family: arial, sans-serif;"&gt;can you put some log in your business rule to check which if block is working or not..&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hi Harsh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;u_attachment_added is a boolean type.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The BR itself is not getting triggered when the attachment is attached.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NOTE: the form does not re-load / update when attachment is added.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sachin&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if i am not wrong when ever you attach some file on your form then Boolean type field get updated?&lt;/P&gt;&lt;P&gt;or some other mechanism you have establish to check the attachment on your form?&lt;/P&gt;&lt;P&gt;kindly elaborate your business requirement. &amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hi Harsh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes 'u_attached_added' field is getting updated because in another BR i am doing as below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;When an attachment is attached:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;(current.u_attachment_added.changes() &amp;amp;&amp;amp; current.u_attachment_added == true)&lt;/P&gt;&lt;P&gt;and triggering an event&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sachin&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This document was generated from the following discussion: &lt;A title="Business Rule not working" __default_attr="295355" __jive_macro_name="thread" class="jive_macro_thread jive_macro" data-orig-content="Business Rule not working" data-renderedposition="1417_386.1875_184_16" href="https://www.servicenow.com/community?id=community_question&amp;amp;sys_id=39b447e9dbd8dbc01dcaf3231f9619b6"&gt;Business Rule not working&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Dec 2017 10:04:50 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-articles/business-rule-not-working/ta-p/2303711</guid>
      <dc:creator>Narayana RC</dc:creator>
      <dc:date>2017-12-27T10:04:50Z</dc:date>
    </item>
  </channel>
</rss>

