This is supposed to be something really basic, but a search with google and on this forum did neither bring up any explanation nor an example. So this forum is - again - my last hope.
I would like to enter something into a textfield. If this text is hard-coded it is really simple:
But now I want to name the value to be something different each time. I can use javascript for that, where I replace the "PlainValue" with a "JS" as follows:
with the javascript expression as follows:
"Testtask_" + Math.floor((Math.random() * 1000000) + 1)
So far so good. But now I am trying to replace the single javascript statement with something more complex, like the following:
var currentdate = new Date();
var datetime = currentdate.getFullYear() + (currentdate.getMonth()+1) + currentdate.getDate() + "_"
+ currentdate.getHours()
+ currentdate.getMinutes()
+ currentdate.getSeconds();
return "Testtask-"+datetime;
But now when running this TruClient Script I get the following error:
** 4: Call Function SRG.action_search_task ** was aborted due to an error in the called function
Is the javascript in a wrong format? How to change the javascript-script so that the text-input field is populated with the desired date-output? Is there a way to get a more 'informative' error message?
I want a solution for the case when I have a multi-line javasvript-script! >>> Not just my script in a single line!! << I want a general solution for all the other multiline-cases I might encounter in future!!