BaBernd
24th February 2016, 15:06
Hello to All,

can I change a date field in the form editor to a "year"-field?
When I have a date field in the DFE (domain tcdate or tsmdm.date) then during runtime I the possibility to select a date in a calender view as shown in the attached screenshots.
But I only need the year-Values for a selection field. So how can I change that? Is it possible to change only the domain for that field from tcdate to tcyear. Will I get then a pull down list with only year-numbers during runtime for the selection field?.

Best Regards
Bernd

mark_h
24th February 2016, 17:51
This might not be relevant to your version of baan. So you might want to wait for a better answer. On 4c4 I can have a tcyrno (4 digit year) - but I would have to handle calling the calendar using something like this http://www.baanboard.com/baanboard/showthread.php?t=56395&highlight=calendar. Now typically I just let them type in a year - so I am really not what happens in your ln version.

BaBernd
4th March 2016, 16:28
Hello Mark,

thanks a lot for your help. Meanwhile I found a better way to control the input for a year number. I predefined the fields with the utc.num() function in the before.display-section of the form and in the when.field.changes-section I automatically fills the second field with a one year later value.

with before.display the insert values on the selection mask looks like:
Year from: [actual year minus 2] Year to: [actual year minus 1]

with when.field.changes-section:
Year from: [manual value for year] Year to: [automatic "year from" plus 1]

In that way I've minimized manual or mouse input.

Best Regards Bernd

Ajesh
5th March 2016, 05:26
Hi Bernd

The Calender Option is a standard session. Not sure whether other standard session just for selecting a Year is There.

However, What you can do is in


field.year:
before.zoom:
return.date.field = attr.zoomreturn$

|Reading what is there in the Zoom Return field through the Predefined variable,attr.zoomreturn$(18),

after.zoom:
year = sprintf$("%D(%04Y)",return.date.field)

|Extracting year from the return field after zoom..



What will happen in the code is that after zooming,irrespective of selecting any date , the corresponding year Number will be returned.

BaBernd
7th March 2016, 18:02
Hi Ajesh,

thanks for that hint. I will discuss this option also with the users.

Best Regards Bernd

vamsi_gujjula
7th March 2016, 19:30
i am not sure how it can be handled on standard session.

On custom i guess you can populate the drop down list with year values.

Regards,
Vamsi.

BaBernd
8th March 2016, 10:41
Hi Vamsi,

I don't understand what you like to say with difference between standard and custom session?
Yes, I'd like to create a custom session where I wanted to integrate a pull down list with year numbers, but meanwhile I found another solution.

Best Regards Bernd

vamsi_gujjula
8th March 2016, 13:04
.....................................................................