Discussions
Categories
Choose a Product
THRUST SERVICES
CORE APPS
CE PRODUCTS
...
Quick Links
POPULAR
HELPFUL TIPS
Groups
My Links
FOR SIGNED IN MEMBERS:
Back to website
Home
Designing Analytics Reports
How to set date element value from variable from script?
Migrateduser
<p>Hi, so in OnCreate scripts, I'm doing computations and assign a date to a variable. Later on, in a data element OnCreate script, I'm trying to assign the value of the date variable to the current element. </p>
<p> </p>
<p>So if I have in the OnCreate script of the data element:</p>
<p><em>this.setDisplayValue(vars["out_start"]); </em> I get as output: <em>org.mozilla.javascript.NativeDate@87dbe2a</em></p>
<p> </p>
<p>If I try to set the data element type as date and use the following:</p>
<p><em>this.setDisplayValue(vars["out_start"].getTime()); </em> I get as output: <em>1383326333000</em></p>
<p> </p>
<p>And while trying to find how, I did a mistake and entered:</p>
<p><em>this.setDisplayValue(vars["out_start"]getTime())</em> and I got as output: <em>1 nov. 2013 14:56</em> </p>
<p>which is exactly what I'm trying to get! But I'm also got an error message at the bottom of the page.. <em>UnhandledScriptError ... Missing ')' after an argument list .. </em></p>
<p> </p>
<p>So I'm quite puzzled as to why the invalid line gives the the dates exactly like I want! :blink: Although with the exception it displays at the end of the report, that sadly isn't viable... So it appears like I'm really close, but nothing I've tried works 100% so far..</p>
<p> </p>
<p>Thanks!</p>
Find more posts tagged with
Comments
There are no comments yet