reddevill47 Posted November 10, 2006 Share Posted November 10, 2006 Hello, Very new to this. I'm trying to have a text field display a certain value list based on the name of the user. What I've tried so far: text field: address script step: if user = "usera" set field address value list item "usera address" if user = "userb" set field address value list item "userb address" I'm not sure if this is the proper approach. If it is, how should I set the field behavior for the text field address? Pop up list with value list "unknown"? Thank you in advance for any help on this Link to comment Share on other sites More sharing options...
AHunter3 Posted November 10, 2006 Share Posted November 10, 2006 :confused: Are you saying you've got usernames and addresses (together, so that Joe Smith's name and Joe Smith's address are on the same record) and then you are also entering a person's username somewhere ELSE and want the address field to auto-fill the relevant person's address? E.g., the "Mail Parcel To" field in the Shipping table, and when you enter "Joe Smith" you want Joe Smith's address to auto-fill in the Shipping Address field of the Shipping table record? AND / OR.... By "user", do you mean the FileMaker user who is using the database? Did that person log in using an Account (with password) where their name is their Account name? Or is "user" simply a field in a table somewhere? Link to comment Share on other sites More sharing options...
reddevill47 Posted November 12, 2006 Author Share Posted November 12, 2006 Yes (ahunter3) by user I mean person logged on and using the database at that time. Thanks Link to comment Share on other sites More sharing options...
AHunter3 Posted November 13, 2006 Share Posted November 13, 2006 You need a) a table of Users, with one record for each Account Name b) in each User record, their address (and any other info you may wish to store) c) a global field that you set, in a script that automatically runs on file open, to Get(AccountName) d) a relationship between that global and the local UserName field in the Users table; your script could do a Go to Related Record using that relationship and at that point load up some $$Variables with the address (and other info if you wish); OR you can simply define a calc field, CurrentUser, text, = Global2LocalUserName::Address (and similar calc fields for other user info if you wish). Either strategy works; e) For your auto-enter address field, assuming it's a local field in various records (e.g., you want to auto-enter the address of the person who created a record and have it remain in that record permanently, etc), you just set the $$Variable or the CurrentUser calculated field value as the value to auto-enter, using auto-enter calculation. If, on the other hand, your auto-enter field is just for display purposes (e.g., display the address of the current user in the footer of each layout or something like that), it's not really an auto-enter at all. You could just put the global field itself on those layouts. Hope that was clear enough to follow. Link to comment Share on other sites More sharing options...
reddevill47 Posted November 13, 2006 Author Share Posted November 13, 2006 Ahunter3 I really appreciate your help on this. Your reply is a little over my head but I am in the process of trying it. I want to explain in detail what I'm trying to accomplish. This is a database for a delivery company. It will have a web interface so clients can log on and place orders / track shipments. When a customer places an order I want to save the details of the shipment so when they return, they can select that info from a pop up list. There are about 15 different accounts that will use this. I know the easy (ugly) way could be to create a layout for each account that contains a field with a pop up list with their info. I was hoping there was a way to have 1 layout with 1 field that can be assigned a valuelist based on who the user is. So, on the back end, when Smith company logs on and goes through the process of entering a new order, it will save that info as a text string in a field called smithco_add. when they log back on the next time and choose to select an address already stored, on the main menu they will click "order" the script will say: goto order layout. if case getuser = "smithco" setfield "addresses" "main" smithco value list; getuser = "jonesco" setfield "addresses" "main" jonesco value list. So theres 1 field 1 layout but depending on who has logged on it will display their saved list of addresses. Sorry for being longwinded. Again I appreciate you sharing your knowledge and time. Link to comment Share on other sites More sharing options...
AHunter3 Posted November 13, 2006 Share Posted November 13, 2006 When a customer places an order I want to save the details of the shipment so when they return, they can select that info from a pop up list. Or, I assume, manually enter a new & different address, which will be added to the pop-up list when they return NEXT time and so on? So rather than a Users table with a single address per user, you simply need to auto-enter the global textfield g.CurrentUser into a CreatedBy field on each shipment record (or auto-enter the calcuation Get(AccountName) which would be the exact same string); you make a relationship between g.CurrentUser and the local field CreatedBy in your shipments, — that will prompt you to name a new Table Occurrence of Shipments, let's call it "CurrentUserShipments" — then define a value list to consist of the values of ShipTo Address, related values via CurrentUserShipments only, from the standpoing of . Link to comment Share on other sites More sharing options...
reddevill47 Posted November 13, 2006 Author Share Posted November 13, 2006 Okay, I think I understand. There will be 1 value list. That will be conditional. Showing only customera's shipments due to the related values. That makes sense. Hey, thanks for your help on this. If you ever need advice on how to attract women with personality disorders or whar not to do after drinking, look me up I'd be happy to return the favor. Link to comment Share on other sites More sharing options...
AHunter3 Posted November 13, 2006 Share Posted November 13, 2006 I do have trouble finding the nice warped schizzy girls! Link to comment Share on other sites More sharing options...
Recommended Posts