Andrew Q Posted December 11, 2006 Posted December 11, 2006 Hello. I'm trying to do a calculation and can't seem to figure it out. My objective is to determine the state that the user is from when they logged in. I've created a global field using the get(accountname) function to get the current accountname.Next in the same table, I have created an accountname field and state field which holds the respective data. So once I have the current accountname that is logged in, how do i compare that with my database of accountname and get the state they are from?
Ender Posted December 11, 2006 Posted December 11, 2006 If you have a relationship from the global to the AccountName, you can use that to look at the related State.
Andrew Q Posted December 12, 2006 Author Posted December 12, 2006 hi ender. I do but how am I able to do in all in one calculation? What I'm trying to accomplish is have a lookup field based on the logged in user's city. Therefore a record will contain the user's name and city they are from but i just can't seem to have an idea on how to match that with the accoutname and then translate it into a city within a calculation and there are too many users to use a case function(i think)to do comparison.
Ender Posted December 12, 2006 Posted December 12, 2006 My objective is to determine the state that the user is from when they logged in. What I'm trying to accomplish is have a lookup field based on the logged in user's city. Make up your mind! If the State and the City are part of the User table, you can simply refer to those related fields in your calc: Name_City_State = User::Name & " from " & User::City & ", " & User::State
Andrew Q Posted December 12, 2006 Author Posted December 12, 2006 I'm so sorry Ender if I sound confusing. Hope you forgive me. I guess I suck at trying to explain my situation. I actually meant City. I don't think the solution(Name_City_State = User::Name & " from " & User::City & ", " & User::State ) you gave me is what I want and most probably it is because of my lousy explanation of the problem.So I hope everyone will bear with me while I try to explain 1 last time. I have a field called currentcity.(this is to capture the city name which is registered to the current logged in user). I am thining of using the function get(accountname) to acquire the logged in accountname which after getting, match it to the record of users in the database to see which city this user is registered to.Finally once i have the name of the city, i would like it to be placed in the currentcity field for me to use in other places as that will be a global field.
Ender Posted December 12, 2006 Posted December 12, 2006 Same principle. For setting that global, use a script: Set Field [ gCurrentCity; User::City ] Another approach is to just use a relationship to the User table from whatever table you happen to be on to get whatever User fields you wish whenever you wish. No need to populate a bunch of globals.
Recommended Posts
This topic is 6555 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now