- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-06-2019 12:55 AM
can anyone explain me why using current.setWorkflow(false) should not be followed or is it an unethical way?
and if i use would it be a wrong method for a developer
curious to know just for knowledge
thanks
Solved! Go to Solution.
- Labels:
-
Team Development

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-18-2019 03:23 AM
Hi,
In this current case, where the requirement is to have CR state to be closed (instead of cancelled) When it is rejected.
The OOB BR restricts the change of state.
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.
Kindly mark the comment as a correct answer and helpful if it helps.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-06-2019 03:18 AM
So what customization makes the state go to Closed? Why not have a look at that?
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.
So in my opinion, not a valid use of setWorkflow(false).
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
---
LinkedIn
Community article list
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-06-2019 03:56 AM
then what should be the approach

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-06-2019 03:57 AM
Like I mentioned:
So what customization makes the state go to Closed? Why not have a look at that?
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
---
LinkedIn
Community article list
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-06-2019 04:12 AM
I have wrote a code in my run activity script:
current.close_notes = "rejected ";
current.close_code = "unsuccessful";
current.state = 3;
can you please help me to achieve this through script include

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-08-2019 11:58 AM
Hi,
In this current case, where the requirement is to have CR state to be closed (instead of cancelled) When it is rejected.
The OOB BR restricts the change of state.
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.