Just set the layout field object to disallow entry (in the Inspector palette). This setting doesn't affect script functionality.
Provided you use (as you should) the "Set Field" script step and not one of the "Insert" script steps.
Thank you for the fast response.
Now I'em pretty new to Filemaker Pro, so the proper way is to "Set Filed" in the Button Setup and assigned Get ( CurrentTime )?
erolst do you mean the "Prohibit modification of value during data entry" in the "Options For Field"?
Write a script and assign the button to execute the script. Inside the script, use the Set Field script step to assign the appropriate value to the desired field.
In the Inspector (Data tab), uncheck the box that says "Browse Mode" under "Field Entry".
So what is the difference between your option with unchecking the "Browse Mode" and checking the "Prohibit modification of value during data entry" in the "Options For Field"?
They both seem to work.
The script won't be able to alter the value if you use "Prohibit during data entry".
Correction: I'm wrong.
Either one will still be editable through a script. The difference is that "Prohibit during data entry" works at the schema (field definition) level, so it applies anywhere in the database (i.e., on any layout). Deselecting the "Browse Mode" option on the layout object only applies to that particular instance of that field. So it could still be edited on any other layout, or even on another copy of the field on the same layout.
Sorry for the bad information.
so the proper way is to "Set Filed" in the Button Setup and assigned Get ( CurrentTime )?
Seeing as you want to insert the user name, that would rather be Get ( UserName ).
As Mike suggested, you can write a script and attach it to the button by selecting Perform Script in the Button Setup dialog, or you could just create a single-step button by selecting Set Field  directly. Disadvantage of this latter method is that you're limited to one step.
You also wrote in the original post…
I have a button object set to enter the user name
What did that button do to set the user name?
And lastly, Prohibit Field Modification will let you enter the field, then throw up an alert on a modification attempt; disabling field entry won't simply let you enter the field, so that attempt can't even be made. If you want to deliver a good user experience, and make sure that the value cannot be changed “through the back door” (same field on another layout), combine the two methods.
Correction: I'm wrong.
Happens to the best.