How to send via formOutput the automatically set date(today)

1
0
-1

Hey guys,
I'm new to bonity and have trouble with a date picker. I have a form with a date picker, which is set to read-only because I want to just set the date automatically.

So at this time my value of the date picker is set to "formInput.bvar_ManuskriptEinsendenInput.eingereichtAm", which is of course wrong, because I dont want the client to choose the date. "eingereichtAm" is my date-variable:
https://image.ibb.co/bApEao/d3w2.png

So I tried to set this variable in my formOutput, but its of course wrong:
https://image.ibb.co/cJVbo8/dascsadf.png

Is there a way to set and pass the variable "eingereichtAm" through formOutput?

Can sb. help me, dont know how to set it automatically :/

Comments

Submitted by Dibyajit.Roy on Tue, 05/22/2018 - 19:49

Hello
I may have misunderstood your question ,
But here is a solution that I would use.
In your UI designer, Select create Variable.
the type should be java script expression.
use "return new Date(); to get current date and time.
Now you can do formInput.variable = javascriptVariable
and in your widget, set value as javascriptVariable

This would assign Current Date to your widget.

Regards

Submitted by Silkroad_Online... on Tue, 05/22/2018 - 21:20

This is totally embarrassing.... I assumed that this would not work.
Thanks alot! It works now.
I had two mistakes. 1. I tried something like: formInput.variable = $javascriptVariable. But its like u said, without the $ and 2. I wrote return Date.now(); and this also didnt work, only return new Date();
Thank you very much!

No answers yet.
Notifications