- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2015 05:40 AM
Looking for some assistance with a Script that doesn't appear to be working. What we are trying to do is display the current value of a select box variable in the short description of a task that is generated from a request as well as display the name of the person it is requested for. The end result is that the short description of the task would read the selection that was made from the drop down along with the client's name i.e. "Fulfill SAS Report for John Doe"
var perm = current.request.requested_for.name;
var tempvendor = current.request.u_temp_vendor_name;
var fulfill = 'Fulfill ' + current.variables.type_report + 'Report for ';
if (perm.nil()){
task.short_description = fulfill + tempvendor;
} else {
task.short_description = fulfill + perm;
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-30-2015 07:33 AM
Thanks Berny. Sorry I didn't reply sooner but I was away on vacation after the 19th. I actually got this to work by making a minor change. I needed to use a double apostrophe instead of a single on the below line and now the code works as expected. We're still on Dublin, no sure if that makes a difference.
var fulfill = "Fulfill " + current.variables.type_report + " Report for ";
Thanks again.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2015 04:54 PM
Bryan Campbell Scott Simon, one thing to note is that the script included before will work OK even if the variable type_report is not included in the selected list of the Variables on task form at the task activity within the workflow.
Thanks,
Berny
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2015 05:05 PM
Bryan Campbell I just found another small error. Use JSUtil.nil(variable) instead of variable.nil(). Here goes the final code you can use:
var perm = current.request.requested_for.name;
var tempvendor = current.request.u_temp_vendor_name;
var fulfill = 'Fulfill ' + current.variables.type_report + ' Report for ';
if (JSUtil.nil(perm)){
task.short_description = fulfill + tempvendor;
} else {
task.short_description = fulfill + perm;
}
I hope you find this helpful!
Thanks,
Berny
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-30-2015 07:33 AM
Thanks Berny. Sorry I didn't reply sooner but I was away on vacation after the 19th. I actually got this to work by making a minor change. I needed to use a double apostrophe instead of a single on the below line and now the code works as expected. We're still on Dublin, no sure if that makes a difference.
var fulfill = "Fulfill " + current.variables.type_report + " Report for ";
Thanks again.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-30-2015 07:38 AM
Hi Bryan, you're welcome.
It's interesting! It should also work with single quotes.
var fulfill = 'Fulfill ' + current.variables.type_report + ' Report for ';
It will be great if you could give it a try with single quotes... just for the sake of science
Thanks,
Berny

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-21-2015 07:45 AM
Good catch, Berny!