.NewRecord procedure issues

I want a Time Received field to be filled in automatically on each new record. I made a .NewRecord procedure with this content:
TimeReceived=timepattern(now(),"HH:MM am/pm")
Of course that stopped me from adding any new records, because I didn’t have anything in the procedure to do that.
So then I changed it to this:
addrecord
TimeReceived=timepattern(now(),"HH:MM am/pm")
That does create a new record, but the TimeReceived field remains empty. If I reverse the order of the statements, it doesn’t help.
What don’t I understand?

If you had a variable named TimeReceived, it would get the time instead of the field.

Try following the assignment with

message TimeReceived

to see if it appears in the message. If it does, check the various info( functions for “localvariables”, “windowvariables”, “filevariables”, and “globalvariables” to see if it’s on one of those lists.

Instead of that, try

message scopes("TimeReceived")

and it will immediately display the type of variable it is.

1 Like