Jul Posted March 2, 2004 Posted March 2, 2004 Hi, I am having problem with editing global fields on the web. I have two db's: the first one is the list of users (User) and the second one is the activities they perform (Activities). When I open the second database, the login window pops up where I do have three global fields - gLName, gFName and gPass. If they match to the username and passowrd in the User db, then main window opens where I have a auto-entered calculation field "gLName & gFName". I am trying to do the same on the web - I ask user to enter his user name and password and then search for this record on the User db. If the record is found, I am showing the welcome message and trying to edit global fields with <input type="submit" name="-Edit" value="Continue">, but it gives me an error -101 - record is missing. I realize this is happening because it can't find a single record with a global field equal to the submitted value. However, if I am trying to add a new record and change these global fields - it is working just fine. I'd appreciate any help..Thx
Garry Claridge Posted March 2, 2004 Posted March 2, 2004 Have you considered using "Tokens" for this. Tokens are like the web version of Global Fields. Good Luck. Garry
Jul Posted March 2, 2004 Author Posted March 2, 2004 Garry, Do you know any good articles on tokens? I have never used them before Thx Jul
Garry Claridge Posted March 2, 2004 Posted March 2, 2004 Here is a quick example. Can be assigned like this (or as type="text"): <input type="hidden" name="-token.1" value="[FMP-Field:LName]"> <input type="hidden" name="-token.2" value="[FMP-Field:FName]"> <input type="hidden" name="-token.3" value="[FMP-Field:Pass]"> You can pass them from page-to-page like this: <input type="hidden" name="-token.1" value="[FMP-CurrentToken: 1]"> <input type="hidden" name="-token.2" value="[FMP-CurrentToken: 2]"> <input type="hidden" name="-token.3" value="[FMP-CurrentToken: 3]"> You can use them with [FMP-If]: [FMP-If: CurrentToken:1.eq.Bloggs] Name = Bloggs [/FMP-If] The "CDML Reference" database has some good notes on Tokens. Hope this helps. All the best. Garry
Jul Posted March 5, 2004 Author Posted March 5, 2004 Thank you for your explanation. I can't really employ that solution because I have about 30 users and they all have their own passwords.. Here is what I did - on the first page the user provides values - first name, last name, and password - and I am searching User db for those. If the record is found, the user is taken to "process" page where he has to click "continue" to edit entered before values. Everything is working fine except that every time global fields are edited (the user clicks continue button), a new record is added in Activities DB. I am completely lost why this is happening. Does anybody have an idea? Thx Jul
Garry Claridge Posted March 5, 2004 Posted March 5, 2004 I'm still not sure why you are using Global fields for this. You can simply display a Token like this: Welcome [FMP-CurrentToken:1] [FMP-CurrentToken:0]<br> The Tokens would be assigned after the User is "found" in the Users database. Good Luck. Garry p.s. You will be able to edit the Global Fields if you use a -RecID from any valid record.
Jul Posted March 5, 2004 Author Posted March 5, 2004 Garry, I am using global fields because I have about 6 other fields that are auto-enter calculations based on those global fields. I a database it works perfectly. I just need to figure out how to do it online. I almost did except that new records that is created every time I try to edit global field. I am still puzzled what to do.. Jul
Garry Claridge Posted March 6, 2004 Posted March 6, 2004 You can pickup a RecID through the Users db from any related record in the activities db. Create a Calc field in the activities db which uses Status(CurrentRecordID). Create a Calc field in the User db which just "calls" this field; e.g. activities::recid. You can then use in the "Continue" page: .... <input type="hidden" name="-db" value="activities.fp5"> <input type="hidden" name="-format" value="activitieslist.html"> <input type="hidden" name="-recid" value="[FMP-Field:actrecid]"> <input type="hidden" name="gLName" value="[FMP-Field:LName]"> ..... <input type="submit" name="-edit" value="Continue"> All the best. Garry
Jul Posted March 8, 2004 Author Posted March 8, 2004 Garry, I have a relationship based on the global field first name + last name between users and activities dbs. So, when I do the recid field - it is empty in the Users db because not all of them have performed activities. As a result when I am trying to edit the record - it just gives me an error. Maybe I didn't get something....I am still fighting with this new record that is automatically created. Thank you anyway for your help Jul
Garry Claridge Posted March 8, 2004 Posted March 8, 2004 Are the Global fields in the "users" db or the "activities" db? Garry
Jul Posted March 8, 2004 Author Posted March 8, 2004 In the Activities db. It works like that: user logs in to the Activities db entering gFName and gLName. There is a relationship between Activities and User db's through calc field "concatenated first + last name". If the related record exists, the user is taken to the main layout, if not - exit. So, if I am trying to edit global fields from the User file I have to edit related fields: Activities::gLName and Activities:gFName. To do that I am searching for the record with the first, last names and password supplied by the user and if the record is found in the Users db, I am editing Activities::gLName and Activities:gFName fields by passing its CurrentRecID. It is working just fine except that new record that is entered. Any ideas? Thank you very much Jul
Recommended Posts
This topic is 7634 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