<?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>question current.setWorkflow(false); in Developer forum</title>
    <link>https://www.servicenow.com/community/developer-forum/current-setworkflow-false/m-p/1980075#M637001</link>
    <description>&lt;P&gt;can anyone explain me why using current.setWorkflow(false) should not be followed or is it an unethical way?&lt;/P&gt;
&lt;P&gt;and if i use would it be a&amp;nbsp; wrong method for a developer&amp;nbsp;&lt;/P&gt;
&lt;P&gt;curious to know just for knowledge&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;thanks&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 06 Dec 2019 08:55:55 GMT</pubDate>
    <dc:creator>Servicenow10</dc:creator>
    <dc:date>2019-12-06T08:55:55Z</dc:date>
    <item>
      <title>current.setWorkflow(false);</title>
      <link>https://www.servicenow.com/community/developer-forum/current-setworkflow-false/m-p/1980075#M637001</link>
      <description>&lt;P&gt;can anyone explain me why using current.setWorkflow(false) should not be followed or is it an unethical way?&lt;/P&gt;
&lt;P&gt;and if i use would it be a&amp;nbsp; wrong method for a developer&amp;nbsp;&lt;/P&gt;
&lt;P&gt;curious to know just for knowledge&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;thanks&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Dec 2019 08:55:55 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/current-setworkflow-false/m-p/1980075#M637001</guid>
      <dc:creator>Servicenow10</dc:creator>
      <dc:date>2019-12-06T08:55:55Z</dc:date>
    </item>
    <item>
      <title>Re: current.setWorkflow(false);</title>
      <link>https://www.servicenow.com/community/developer-forum/current-setworkflow-false/m-p/1980076#M637002</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;
&lt;P&gt;Completetly up to your situation/need. It can be valid to use setWorkflow(false) sometimes. For example, if you are updating records and don't want Business rules or Workflows to be triggered.&lt;/P&gt;
&lt;P&gt;It would be different if you would always use this. That would be odd &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; Though it really depends on your situation if it's useable or not.&lt;/P&gt;
&lt;P&gt;For the usage, see:&lt;BR /&gt;&lt;A href="https://developer.servicenow.com/app.do#!/api_doc?v=newyork&amp;amp;id=r_GlideRecord-setWorkFlow_Boolean" rel="nofollow"&gt;https://developer.servicenow.com/app.do#!/api_doc?v=newyork&amp;amp;id=r_GlideRecord-setWorkFlow_Boolean&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;If my answer helped you in any way, please then mark it as helpful.&lt;/P&gt;
&lt;P&gt;Kind regards,&lt;BR /&gt;Mark&lt;/P&gt;
&lt;P&gt;---&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.linkedin.com/in/markroethof/" target="_blank" rel="noopener noreferrer nofollow"&gt;LinkedIn&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://drive.google.com/file/d/1mIO_Ml5wabhyF-fJypCuFEwRQb-6uKca/view" target="_blank" rel="noopener noreferrer nofollow"&gt;Community article list&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Dec 2019 08:59:28 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/current-setworkflow-false/m-p/1980076#M637002</guid>
      <dc:creator>Mark Roethof</dc:creator>
      <dc:date>2019-12-06T08:59:28Z</dc:date>
    </item>
    <item>
      <title>Re: current.setWorkflow(false);</title>
      <link>https://www.servicenow.com/community/developer-forum/current-setworkflow-false/m-p/1980077#M637003</link>
      <description>&lt;P&gt;hi mark,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Am using this in my change request workflow where i set the value false so is it right way to proceed&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Dec 2019 09:21:26 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/current-setworkflow-false/m-p/1980077#M637003</guid>
      <dc:creator>admin1</dc:creator>
      <dc:date>2019-12-06T09:21:26Z</dc:date>
    </item>
    <item>
      <title>Re: current.setWorkflow(false);</title>
      <link>https://www.servicenow.com/community/developer-forum/current-setworkflow-false/m-p/1980078#M637004</link>
      <description>&lt;P&gt;The question: what is the need for your query?&amp;nbsp;Just for every GlideRecord query... absolutely not! If it's for a valid reason, like on purpose you don't want Business rules to execute, oke fine.&lt;/P&gt;
&lt;P&gt;So again, why do you want to use setWorkflow(false)? What is your need? Or is it just because someone told you about this option and your thinking that could be nice? Though actually there's no reason for applying it?&lt;/P&gt;
&lt;P class="ng-scope"&gt;If my answer helped you in any way, please then mark it as helpful.&lt;/P&gt;
&lt;P class="ng-scope"&gt;Kind regards,&lt;BR /&gt;Mark&lt;/P&gt;
&lt;P class="ng-scope"&gt;---&lt;/P&gt;
&lt;P class="ng-scope"&gt;&lt;A href="https://www.linkedin.com/in/markroethof/" target="_blank" rel="noopener noreferrer nofollow"&gt;LinkedIn&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://drive.google.com/file/d/1mIO_Ml5wabhyF-fJypCuFEwRQb-6uKca/view" target="_blank" rel="noopener noreferrer nofollow"&gt;Community article list&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Dec 2019 09:42:27 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/current-setworkflow-false/m-p/1980078#M637004</guid>
      <dc:creator>Mark Roethof</dc:creator>
      <dc:date>2019-12-06T09:42:27Z</dc:date>
    </item>
    <item>
      <title>Re: current.setWorkflow(false);</title>
      <link>https://www.servicenow.com/community/developer-forum/current-setworkflow-false/m-p/1980079#M637005</link>
      <description>&lt;P&gt;I have customized change request&amp;nbsp; workflow where after approver's rejection it goes new state ideally but customization it goes to closed state.&lt;/P&gt;
&lt;P&gt;however, i used current.setworkflow(false) in my wf&lt;/P&gt;
&lt;P&gt;so is this the correct way&lt;/P&gt;</description>
      <pubDate>Fri, 06 Dec 2019 11:00:19 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/current-setworkflow-false/m-p/1980079#M637005</guid>
      <dc:creator>Servicenow10</dc:creator>
      <dc:date>2019-12-06T11:00:19Z</dc:date>
    </item>
    <item>
      <title>Re: current.setWorkflow(false);</title>
      <link>https://www.servicenow.com/community/developer-forum/current-setworkflow-false/m-p/1980080#M637006</link>
      <description>&lt;P&gt;So what customization makes the state go to Closed? Why not have a look at that?&lt;/P&gt;
&lt;P&gt;Just applying setWorkflow(false) for this feels like a quick escape / easy workaround. Will work, though have a look at the actual issue instead of working around it.&lt;/P&gt;
&lt;P&gt;So in my opinion, not a valid use of setWorkflow(false).&lt;/P&gt;
&lt;P class="ng-scope"&gt;If my answer helped you in any way, please then mark it as helpful.&lt;/P&gt;
&lt;P class="ng-scope"&gt;Kind regards,&lt;BR /&gt;Mark&lt;/P&gt;
&lt;P class="ng-scope"&gt;---&lt;/P&gt;
&lt;P class="ng-scope"&gt;&lt;A href="https://www.linkedin.com/in/markroethof/" target="_blank" rel="noopener noreferrer nofollow"&gt;LinkedIn&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://drive.google.com/file/d/1mIO_Ml5wabhyF-fJypCuFEwRQb-6uKca/view" target="_blank" rel="noopener noreferrer nofollow"&gt;Community article list&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Dec 2019 11:18:24 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/current-setworkflow-false/m-p/1980080#M637006</guid>
      <dc:creator>Mark Roethof</dc:creator>
      <dc:date>2019-12-06T11:18:24Z</dc:date>
    </item>
    <item>
      <title>Re: current.setWorkflow(false);</title>
      <link>https://www.servicenow.com/community/developer-forum/current-setworkflow-false/m-p/1980081#M637007</link>
      <description>&lt;P&gt;then what should be the approach&lt;/P&gt;</description>
      <pubDate>Fri, 06 Dec 2019 11:56:14 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/current-setworkflow-false/m-p/1980081#M637007</guid>
      <dc:creator>Servicenow10</dc:creator>
      <dc:date>2019-12-06T11:56:14Z</dc:date>
    </item>
    <item>
      <title>Re: current.setWorkflow(false);</title>
      <link>https://www.servicenow.com/community/developer-forum/current-setworkflow-false/m-p/1980082#M637008</link>
      <description>&lt;P&gt;Like I mentioned:&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;So what customization makes the state go to Closed? Why not have a look at that?&lt;/EM&gt;&lt;/P&gt;
&lt;P class="ng-scope"&gt;If my answer helped you in any way, please then mark it as helpful.&lt;/P&gt;
&lt;P class="ng-scope"&gt;Kind regards,&lt;BR /&gt;Mark&lt;/P&gt;
&lt;P class="ng-scope"&gt;---&lt;/P&gt;
&lt;P class="ng-scope"&gt;&lt;A href="https://www.linkedin.com/in/markroethof/" target="_blank" rel="noopener noreferrer nofollow"&gt;LinkedIn&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://drive.google.com/file/d/1mIO_Ml5wabhyF-fJypCuFEwRQb-6uKca/view" target="_blank" rel="noopener noreferrer nofollow"&gt;Community article list&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Dec 2019 11:57:08 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/current-setworkflow-false/m-p/1980082#M637008</guid>
      <dc:creator>Mark Roethof</dc:creator>
      <dc:date>2019-12-06T11:57:08Z</dc:date>
    </item>
    <item>
      <title>Re: current.setWorkflow(false);</title>
      <link>https://www.servicenow.com/community/developer-forum/current-setworkflow-false/m-p/1980083#M637009</link>
      <description>&lt;P&gt;I have wrote a code in my run activity script:&lt;/P&gt;
&lt;P&gt;current.close_notes = "rejected ";&lt;BR /&gt;current.close_code = "unsuccessful";&lt;BR /&gt;current.state = 3;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;can you please help me to achieve this through script include&lt;/P&gt;</description>
      <pubDate>Fri, 06 Dec 2019 12:12:44 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/current-setworkflow-false/m-p/1980083#M637009</guid>
      <dc:creator>Servicenow10</dc:creator>
      <dc:date>2019-12-06T12:12:44Z</dc:date>
    </item>
    <item>
      <title>Re: current.setWorkflow(false);</title>
      <link>https://www.servicenow.com/community/developer-forum/current-setworkflow-false/m-p/1980084#M637010</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;In this current case, where&amp;nbsp;the requirement is to have&amp;nbsp;CR&amp;nbsp;state to be closed (instead of cancelled) When it is rejected.&lt;/P&gt;
&lt;P&gt;The OOB BR restricts the change of state.&lt;/P&gt;
&lt;P&gt;Hence suggested to use setworkflow(false) in the run script so that the Br does not run on this record and the state is changed to closed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 08 Dec 2019 19:58:37 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/current-setworkflow-false/m-p/1980084#M637010</guid>
      <dc:creator>asifnoor</dc:creator>
      <dc:date>2019-12-08T19:58:37Z</dc:date>
    </item>
    <item>
      <title>Re: current.setWorkflow(false);</title>
      <link>https://www.servicenow.com/community/developer-forum/current-setworkflow-false/m-p/1980085#M637011</link>
      <description>&lt;P&gt;Prior to updating your task, add a call to&amp;nbsp;&lt;CODE class="ph codeph"&gt;setWorkflow(false)&lt;/CODE&gt;&amp;nbsp;on the GlideRecord object for the task within the business rule that is updating the task. This prevents the business rules from being processed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Dec 2019 06:14:40 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/current-setworkflow-false/m-p/1980085#M637011</guid>
      <dc:creator>sivaprince231</dc:creator>
      <dc:date>2019-12-09T06:14:40Z</dc:date>
    </item>
    <item>
      <title>Re: current.setWorkflow(false);</title>
      <link>https://www.servicenow.com/community/developer-forum/current-setworkflow-false/m-p/1980086#M637012</link>
      <description>&lt;P&gt;hi&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;according to you which br should be stop if i stop this&amp;nbsp;State model - Can change state? this will affect others too which i don't want&lt;/P&gt;</description>
      <pubDate>Mon, 09 Dec 2019 09:12:44 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/current-setworkflow-false/m-p/1980086#M637012</guid>
      <dc:creator>Servicenow10</dc:creator>
      <dc:date>2019-12-09T09:12:44Z</dc:date>
    </item>
    <item>
      <title>Re: current.setWorkflow(false);</title>
      <link>https://www.servicenow.com/community/developer-forum/current-setworkflow-false/m-p/1980087#M637013</link>
      <description>&lt;P class="ng-scope"&gt;Hi,&lt;/P&gt;
&lt;P class="ng-scope"&gt;In this current case, where&amp;nbsp;the requirement is to have&amp;nbsp;CR&amp;nbsp;state to be closed (instead of cancelled) When it is rejected.&lt;/P&gt;
&lt;P class="ng-scope"&gt;The OOB BR restricts the change of state.&lt;/P&gt;
&lt;P class="ng-scope"&gt;Hence suggested to use setworkflow(false) in the run script so that the Br does not run on this record and the state is changed to closed.&lt;/P&gt;
&lt;P class="ng-scope"&gt;Kindly mark the comment as a correct answer and helpful if it helps.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Dec 2019 11:23:04 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/current-setworkflow-false/m-p/1980087#M637013</guid>
      <dc:creator>asifnoor</dc:creator>
      <dc:date>2019-12-18T11:23:04Z</dc:date>
    </item>
  </channel>
</rss>

