krobinson98
18th September 2008, 23:44
I want to set a field in a session to the current user using logname$ when a new record is added. If I use the below field It defaults all the fields to the current user. So the pre-existing fields and the new field all have the same value. How do you just default the new field? I tried putting an if statement around the below code to just default if the value = "" but that did not work.
before.display:
tcibd910.user = logname
pramod
18th September 2008, 23:58
Update your field in after.write section instead of before.display.
NPRao
19th September 2008, 00:02
If I use the below field It defaults all the fields to the current user. So the pre-existing fields and the new field all have the same value.
That is incorrect usage to reassign a table field in the before display section.
How do you just default the new field?
before.new.object:
Use this section to program actions that must be executed once before the input of the first field of the new created record. It is used for setting the default values of the record fields.
So you have to code as:
before.new.object:
zmmig200.reqid = 0
zmmig200.reby = logname$