Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Default Fill based on Login

Featured Replies

I currently have a field that the users use to select their respective names when entering records. The drop down list has names and a respective district, for example: Sarah - DAL. This is for Sarah the coordinator and DAL for Dallas. There are several names in the drop down. A request by the users was to have this coordinator field auto populate when they open the file. My guess is this should be fairly simple.

I am guessing that if I add security and have the users login to the database I will have the identity of the user portion solved. How do I easily take that idea and use my existing drop down list to auto populate the coordinator field?

I am thinking through some ideas now, but I was hoping to get a simple answer instead of the multi-step thoughts running through my mind.

Any help would be appreciated.

Thanks.

You can make the "coordinator" to be an auto-enter calculation (text) and use the Get ( AccountName ) to auto-enter the logged in account name or the Get ( UserName ) if you want the user's name as defined on the computer. The account name is safer, because that's the FileMaker account name.

  • Author

Thanks. It seems like I would have to have an interim step. Meaning, user logs in; therefore account name is captured.

When the user goes to create a new record, the get account name grabs the name from the account, then must look up the table to then auto populate the coordinator field with the Sarah - DAL.

For example, Sarah logs in. She creates new. The coordinator field would then have to get account name (Sarah), and because account name = Sarah it would auto fill with Sarah-DAL.

I know, you are probably asking why Sarah-DAL, there is a bit of a crazy reason as to why, which can be argued. But, in reality, I am working off what had previously been designed and it works.

Thanks again.

bbud, then use this for your auto-enter:

Get ( AccountName ) & " - " & "DAL"

This will do it in the same step. Although, I can't tell if you want the spaces around the dash or not, because you wrote it in two different ways in your post. If you want no spaces, then take the spaces out in the calculation.

  • Author

thank you so much, now here comes the part that you say, well, if I knew your whole problem, I could help you in one shot.

I failed to mention. What if Sarah, needs to be able to enter a record for a different area she is responsible for? For example, she logs in, but instead of having to create a record for DAL, she has to create one for HOU. In the latter case it would need to say Sarah-HOU.

So, what I was hoping to do with the account name lookup was default the name to Sarah-DAL, but still give the drop down functionality so she could use to select Sarah-HOU.

Other users, for example, Sally could log on, and get the coordinator field to default to Sally-CHI.

Thanks for the help. I wish I had the time to actually work on this... fighting other fires at the moment.

Ok, then forget the auto-enter.

In that case you need a script and a trigger attached to your area field:

Create a script that will:

Step 1: capture the field content to a variable ($_area)

Step 2: set the "created by" field with the Get ( AccountName ) & "-" & $_area

Then attach the OnObjectModify trigger to your area field to trigger your script.

It does help if you fully explain what you are trying to get done, so you can get the best possible advice.

If you need me to build a demo file, let me know.

What if Sarah, needs to be able to enter a record for a different area she is responsible for? For example, she logs in, but instead of having to create a record for DAL, she has to create one for HOU. In the latter case it would need to say Sarah-HOU.

Sarah should choose the area for the new record, and this should go into a separate field.

  • Author

yes she should, I don't disagree with you. In reality, the name and the - location should be separated, but it is what I am dealing with in the current design. Even still, the users would want to the location to default to their typical location. I want to be able to provide that with auto-fill, but still give them the opportunity to change from the default as needed.

the users would want to the location to default to their typical location.

This could be done easily by auto-entering the user's default location into the Location field. However, it doesn't seem likely that users should also be given the opportunity to change their identity...

  • Author

It may not be as clean as it could be, but I have it working in a test file.

created a field

coordinator field uses validation from a managed list, while also allowing the user to override during data entry. This allows me to pick the alternate location for the username.

the managed list has the users - location as described in previous posts. I agree it was the best design, but it is what I inherited.

the coordinator field also uses the Calculated value selected on the Auto-Enter. The calculation basic makes use of the user field as shown here:

If(user= "x"; "x - loc1"; If(user = "y"; "y - loc2"))

A user field was also used and auto populates by getting the UserAccount information using the following:

Get ( AccountName )

The user account information is captured by making use of the security feature of FM and requiring users to login with security to access the file.

Thanks for all the suggestions.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.