xtrim Posted May 9, 2003 Posted May 9, 2003 Hi I have table called "DB1", a layout called "LAY1" and a page called "Page.htm" I aslo have a field "Field1" Is it possible to create a link that insert a value into "field1" in the same record ? I've tried to use "[FMP-LinkRecID: format=page.htm, layout=lay1]" but I don't know where to insert the "field1=any_value" ......
Unable Posted May 9, 2003 Posted May 9, 2003 If you will refer to you CDML Reference database, you will find that the [FMP-Link] tag self-generates a URL which "includes all the find and sort criteria that was used to generate the page this tag is on." Since the link is self-generated, you cannot insert any code into the link. If you don't have the CDML Reference database, you should search the CDML forum for a thread under that subject which provides a link to get the db file. Also, you will need to use an -edit tag to edit an existing record. Again, see the CDML Reference database.
Leb i Sol Posted May 9, 2003 Posted May 9, 2003 you need to be more specific to what you are trying to insert in relation to the record..... but in some other perspective it is possible..just "depends how you look at it" for example: IF you are looking to your "Results.html" page with bunch of records displayed and you are using the LinkID to go to "Details.html" page and you would like to record some activity (insert) THEN you could "fake it" and have a hidden field associated with each record that accepts some value (eg. vitiors name) and then use the "linkID" as a submit button as a text that would actually perform an isert (the submit of a form). I would also look into combo of LinkID and Inline Action on the Dtails.html page where the Inline action coudl possibly perform the addition of a new record(s). now, go get lucky
xtrim Posted May 9, 2003 Author Posted May 9, 2003 Hi and tnx 4 replying. I will explain myself more clearly : I have a table with systems I have a table with units I have a table for web interfaces - web_users. Users can login in two different ways 1. user/pass 2. System Identifier (each system has a unique number) When users login with System Identifier they get a the systems detail page. When users login with users pass they get a list of all their systems (through a portal). in this list the identifier is visible and I want them to be able to click on that link and get straight to the system details page. In order to make that happen, I need to insert to the "identifier" field (that is on "web_users")the identifier number (from the specific portal row), so the relationship will work (web_users<->systems<->units) in order to display the system detail page properly.
Leb i Sol Posted May 9, 2003 Posted May 9, 2003 Hi Xtrim! ...I think I have an idea for you... but in the mean time let me just comment that crating relationships by inserting uniqueID is a great approach to security (way to go)!: But on the other side represents a potential data corruptions especially if you have multiple users hitting/loggin/inserting uniqueIDs at the same time...relationships could possibly relate to wrong records...again it is a possiblity however it will work. Sorry but my time is limited today...maybe this weekend I can help... in the mean time: ---Login page----- some form ------------------ ---Loggedin/Welcome page----- [FMP-InlineAction:-db=SomeDB.fp5, -lay=layout, -token.0={field:uniqueID}, -view] [/FMp-InlineAction] to set the Token.x = FeieldName THEN display record: Click on Record to see Details kind of a message: [FMP-Record] 1. adsfadsda 2. fdgdgdgdf 3. dsfsfsffd [/FMP-Record] -------------------------------------- ------Deatils Page---------------------- [FMP-InlineAction] to add a record into some other DB's Field THEN display records from this other DB --------------------------------------------- again, this is in Theory so I can't really guareantee it will work I have not tried it on a real DB. Other solution would be to preset the realtionships (which is the most common way) and then dragg arround a token that is unique and keep putting into a hidden field on any of our pages with a form that needs be submitted..so again that would be general form: ----FORM-------- Search the Database: enter product name: [_____form__field____] {__hidden_form field_that_contains_token___} ....[sUBMIT [RESET]....... ------------------- so when this form is submited you are actually submittin for product name and whatever other filed u like to be searched. the best way of looking at this would be from SQL perspective: WHERE ItemName=[formfield_ItemName] AND postedby = [hidden field_that_contains_UniqueUserID_passed_as_token_prior_to_this] I hope it makes sense! good LUCK!
Anatoli Posted May 10, 2003 Posted May 10, 2003 It is possible, but there must be some kind of processing like JavaScript, auto submit pages, META refresh etc. I am using that for visitor's bookmark with their login credentials like User and Password.
Leb i Sol Posted May 12, 2003 Posted May 12, 2003 I guess if you are good at JS you could do it just like Anatoli said...unfortuanately I am not. The other approach I used, rather than creating a relationships on_the_fly, is to set a token= UserID when they loggin and then dragg that token arround....used it to record in sence WHERE userID="7" AND UserName="Jack" and kept token recorded with any user activity... eg. user adds a record along withe the UniqueID(userID) whose value is in the hidden field(s) of a form(s). Next time they come arround they look for "their" records...and see only those records WHERE userID="x" Also with the combo of [FMP-If] statements you can control what "rights" to the site they have.....anyway
xtrim Posted May 13, 2003 Author Posted May 13, 2003 Tnx Again I'm no good at JS...so for the moment I will not use it cause I don't have the time right now... Lets elaborate a bit : I have a Portal. In this portal a unique number is displayed for each row (a related value). I want to be able to click on this portal row, and go to a different page while I'm inserting the specific value (from the portal) to a local field, in order to use other relationship that uses this value. Example : [Portal] ID Name Location 1 jack CA 4 joe NY [Portal/] I want to be able to click on any of the rows and extract the ID number. So... is it possible? or I have to use JS?
Pupiweb Posted May 15, 2003 Posted May 15, 2003 Sounds doable Format the ID as a link <A HREF="FMPro?-db=RelatedFile.fp5&-format=cgi&ID= [fmp-field:PortalRelationship::ID]&-find"></A> IOW it will run a search in the related file for the record having the ID of the portal row
xtrim Posted May 18, 2003 Author Posted May 18, 2003 Hi Tnx for the tip. I played with it a little bit anf found the winning formula : <A HREF="FMPro?-db=DB.fp5&-format=page.htm&ID= [fmp-field:PortalRelationship::ID]&-edit"></A> once again...U R the man...
Recommended Posts
This topic is 7929 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