How to clear the variable value (Empty the variable value) in the workflow using Runscript
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-18-2018 06:10 AM
Hi Team,
I have requirement where i need to clear two date fields with in the workflow, please let me know how we can achieve this.
Let me give more details on this in my form i have field named Uat_Completion_date which needs to be filled by the requester, but after the request submission in the middle of the workflow i need to clear what ever date (value) we have in the Uat_completion_date field, as i need to make a re entry for that particular field if the UAT fails.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2018 08:31 AM
This should work, i tried and it did for me.
Can you paste your script?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2018 06:48 AM
Did it work for you?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-28-2018 02:17 AM
Can you please mark the correct answer for this post? Not sure why it was unmarked even after responding to multiple queries?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-18-2018 08:57 AM
Thanks Alikutty, thanks for your quick help.
Just have one more query is there any script or way we can make attachment mandatory while closing a task?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-18-2018 09:06 AM
You can write a before insert/update business rule on your task table with condition as:
State changes to Closed and Script as
var att = new GlideAggregate('sys_attachment');
att.addAggregate('COUNT');
att.addQuery('table_name', current.getTableName());
att.addQuery('table_sys_id', current.sys_id);
att.query();
var count = 0;
if (att.next()) {
count = att.getAggregate('COUNT');
if (count<1) {
gs.addInfoMessage("Please attach Attachment");
current.setAbortAction(true);
}
}