tnzabo
20th September 2004, 17:31
I'm trying to get my form field defaults to display on opening of a session. It's a customized session that has four fields, two sets of from/to fields. I have the to fields set to have a default. I did this in the form design by checking the box for default and putting what I wanted as the default in the field beside the checkbox.
In my session script I have this:
form.1:
init.form:
get.screen.defaults()
My fields come up blank. What am I missing? I've even put commands after this one like display.all() or refresh() and what's funny is my defaults display after the get.screen.defaults() command then when the other one is executed they disappear. If I only have the get.screen.defaults() command - nothing happens. :confused:
thanks - tnzabo
andrew_br
20th September 2004, 17:49
If I understood it, you want bring the same default to all users, right?
So, default is for "each" user.
sorry if I didn't answer your question.
mark_h
20th September 2004, 17:53
Try deleting your defaults for the session using ttstpdeldeflt. Sometimes while doing development the defaults and the form get out of sync.
Mark
tnzabo
20th September 2004, 17:53
Yes - I want the same defaults for everyone unless of course they change it to be something else. Just like a normal baan session works. When you first open a session that you haven't manually set the defaults to something you prefer it usually comes up with the max order number in the to field for order number or today's date in the to field for a date. Mine now come up blank..
thanks
tnzabo
20th September 2004, 17:55
mark_h - I ran that session for deleting defaults - I had found a previous posting from you about this. It didn't solve my problem.
tnzabo
tools123
20th September 2004, 18:07
have you tried dumping the form and logged back in again after defaults
have been set?
what kind of data type are the fields and whats the default set to?
if the above dump does not work try
1.Remove the get.defaults code, dump form and retry after login
or
2. Save defaults from the form taskbar and retry for multiple users.
usually this is a onetime/user procedure.
mark_h
20th September 2004, 18:16
Been reading the initial post - all you should need is the following:
form.1:
init.form:
get.screen.defaults()
Refresh, display.all() is not required. You mentioned that after the get.screen.defaults you see the correct defaults for the fields - then when it executes the other command they disappear. Are you talking the refresh, display.all commands? Is there anything else in the script that may effect these fields?
Mark
tnzabo
20th September 2004, 18:31
mark_h - currently that is all I have in my init.form: section - Nothing shows up - just blanks. I was just messing around and by putting any command after the get.screen.defaults() the defaults would show then go away once the form.1: section executed. If only get.screen.defaults() is in the section nothing happens.
tools123 - I've dumped the form. Logged out and back in. Ran the session, manually got the defaults from the menu, saved defaults manually from the menu. Save & Exit out of the session logged out and back in to Baan. Ran the session - blank fields.
I do have this code in the field section :
form.1:
init.form:
get.screen.defaults()
|****************************** field section *********************************
field.cprj.zoom.f:
after.input:
cprj.zoom.t = cprj.zoom.f
field.date.zoom.f:
after.input:
date.zoom.t = date.zoom.f
I've changed the after.input to when.field.changes with no change in results.
What's up??
mark_h
20th September 2004, 19:39
Do you have the save defaults and get defaults checked on the standard options for the form? What you last posted looks like most of reporting type forms.
Mark
tools123
20th September 2004, 19:42
Make sure you have the "defaults" fields checked under form properties.
also, what is your session type, form type?
and what have you set the default values to? fmax$() ?
try attaching a std print session form to this session and see if those defaults come up or bulid a new form a try.
Good luck
tnzabo
20th September 2004, 21:35
:) Mark_h - yes I have the save and get defaults checked in the standard options for the form.
I've compared a std form to mine as far as what Standard Opt. are checked and changed mine to be the same. I've been able to get one of my default fields to display now - Yay! However my date() default will not come up at all anymore, even if I manually go to Get Defaults through the menu.
tools123 - Where do I check the form properties that you are talking about? Do you mean the standard options button? My session type is Update, my form Type has been 1 or 4 I've been bouncing back and forth it's at 4 currently. My defaults are fmax($#) for the cprj.t field and date() for the date.t field.
Thanks for all your help!
tnzabo :)
tools123
20th September 2004, 21:51
I meant the same.standard options.sorry did not have access for the right term.
some times date fields are tricky.
try other options in default value using help. again, i do not have access
rt now.may be dat.num() or dte() etc.
one of them should work.
mark_h
20th September 2004, 22:24
Well - date() is what I use for default dates. Do you have any clue as to what made the one field start working?
Mark
tnzabo
20th September 2004, 23:02
I'm not exactly sure but here is what I've done to get both fields to work. I've had other users start the session with the defaults coming up okay.
Both the script type and form type I changed to be be type 4. I then change the option set for the form to P4.F It seems to all be working now. I did so many different things that I'm not exactly sure what fixed it.
I've never paid much attention to those types for the forms or script - I guess I will now.
Thanks
tnzabo