garlapati
16th December 2015, 18:07
I have a custom table
on top of that i have built a maintain session
for first record when i am trying to insert
for index fields by default it comes as ZZZ on form.
i tried initializing it at DAL before.new.object, program script field level but still its coming as ZZZ

how can get rid of it?

Regards
Sunil

benito
16th December 2015, 22:48
bring your form into "edit" mode and check if you have default/initial value.

garlapati
16th December 2015, 23:47
i checked that too as well but its grey out (table field)
form field is not greyed out. but its a table field.

mark_h
17th December 2015, 15:57
See if there is an initial value on the table field itself. Maybe clear it out if it is set there.

garlapati
17th December 2015, 16:45
there is no initial value on table field. its blank.
Infact i tried giving EMPTY constant too but it comes up as "empty" on screen.
i tried giving space on initial value but its in vain.
so much normal stuff to handle but nothing working.

benito
17th December 2015, 17:05
go to Tools, User mgmt, Misc, Remove User Defaults.

garlapati
17th December 2015, 22:35
that would work for me . but what happens when functional guy tests it?
will it work still?

benito
17th December 2015, 23:16
Remove User Defaults wide open for all users. Make sure your type of script is UI Script for Print/Processing session.

garlapati
18th December 2015, 05:33
ha ha
remove defaults wide open for all users?
that wont be a good option and dont think its the choice.

But still i removed it & tried no good result. :mad:

NPRao
19th December 2015, 01:04
Check if your program script has -

form.1:
init.form:
get.screen.defaults()

-OR-

form.1:
init.form:
set.fields.default()


or have any - set.max() or set.fmax() function calls.

garlapati
21st December 2015, 15:58
I have get.screen.defaults
i removed it & tried
same result. zzz repeats
no set.max functions used or set on form.

NPRao
22nd December 2015, 03:51
Check the initial value in the Table field definitions (ttadv4122s000).

OmeLuuk
22nd December 2015, 18:37
And check your form definition, formfield should have no default as well.
If you compile your script in debug mode and put a breakpoint on your variable, you may be can tell which statement will get the value: table field definition, DAL, session script (before new.object, field section, related field sections or programming code, possibly even within a DLL), formfield, user default. I think it was in this sequence. If you can compile in debug (have source code) it would be helpful. If you still cannot tell also the "standard 4GL behaviour" can do it based on the above sequence, without a specific section is executed. Debugger will stop as soon as you are back in your code with the changed value. In that case you can add extra 4GL sections with dummy code (like if 1 = 2 then endif) and the debugger will stop there too.

OmeLuuk
22nd December 2015, 18:39
ha ha
remove defaults wide open for all users?
that wont be a good option and dont think its the choice.

But still i removed it & tried no good result. :mad:Wide open for all users yes, but for your session alone would be ok...?

garlapati
29th December 2015, 02:12
i tried in debug.
but at any point it is not showing the 'ZZZ' value in field.
at form init level
or field sections too.
looks like in standard also it works same.

OmeLuuk
29th December 2015, 15:35
Try thisfield.<field name>:
init.field:
if <field name> = "ZZZ" then
mess("tcgenstring", 1, "init.field")
endif
before.field:
if <field name> = "ZZZ" then
mess("tcgenstring", 1, "before.field")
endif
before.input:
if <field name> = "ZZZ" then
mess("tcgenstring", 1, "before.input")
endif
before.display:
if <field name> = "ZZZ" then
mess("tcgenstring", 1, "before.display")
endif
before.checks:
if <field name> = "ZZZ" then
mess("tcgenstring", 1, "before.checks")
endif
check.input:
if <field name> = "ZZZ" then
mess("tcgenstring", 1, "check.input")
endif
on.input:
if <field name> = "ZZZ" then
mess("tcgenstring", 1, "on.input")
endif
when.field.changes:
if <field name> = "ZZZ" then
mess("tcgenstring", 1, "when.field.changes")
endif
after.input:
if <field name> = "ZZZ" then
mess("tcgenstring", 1, "after.input")
endif
after.display:
if <field name> = "ZZZ" then
mess("tcgenstring", 1, "after.display")
endif
after.field:
if <field name> = "ZZZ" then
mess("tcgenstring", 1, "after.field")
endif and see what message(s) pops up...