Display current logged in user in Form Field

Is it possible to display and then insert the current logged in user in a Form Application? Example: in the form I have a field called “user” I would like to show the logged in user name when a new record is being added and then saved in that field when the record is saved.

1 Like

Are you using security of scriptcase? there is a global variable: [usr_login]
You can verify the variable in app login.

1 Like

Yes I am using the security module, however I need the username to appear in the field as they are adding it but not allow them to change it.

1 Like
  1. In the form, go the Fields section and set the field for user to Label if you don’t want anyone to be able to change the value.
  2. go to Edit Fields and locate the field for user and make the following modifications.
    a. change DB Value (Insert) and DB Value (Update) to Defined Value
    b. place [usr_login] in the box box that now appears to the right of the DB Value boxes.
    c. place a check in the “Force this Value” checkbox.
    d. Save the form and run it to test.

Now when someone adds a record it will capture their username, and when they update it, it will overwrite the existing username with the new one.

You might consider a second field for createdby and make the adjustments to the above settings per field.

DB Value (Insert) for created by
DB Value (Update ) for updated by.

Will D.

1 Like

Will, this works perfect except it doesn’t display the Username in the form until after the form has been saved. Is there a way to display it as the record is being added? Or, is there a way to hide the field on Add but display it on view/print?

1 Like

use [usr_login] in the default Value of your field

1 Like

Jens - Perfect! Thank you so much!!!