BuddySystems Posted December 18, 2000 Posted December 18, 2000 Is there a way to pass a token from the browser to Filemaker. I have 2 dbs - Users and Products - The user signs in to users which I then get a token from. Then they can view and edit products. What I want to be able to do is let them only see their discounted cost based on their user id. The only way I've figured to do this is to stay in the User database and create a portal to products with a relationship based on the product code and discount number, but I would like to work directly in the product database and set the token as a global. Does this make sense?
Simonpennington Posted December 19, 2000 Posted December 19, 2000 You may want to see my post to a similar question in the CDML forum under help w/cookies. I think it might answer your token question (no pun intended) Simon
BuddySystems Posted December 19, 2000 Author Posted December 19, 2000 First - my apologies -as I did not see the CDML board and this posting is more topical there. I read the posts there, and I am already passing tokens - but that doesn't help unfortunately, as what I need to do is figure out how to pass a token to filemaker once an action has been completed so that the information found can be customized based on that token, i.e. do a find and then set the value of the token to a global field.
Vaughan Posted December 19, 2000 Posted December 19, 2000 This sounds like a jod for cookies. Cookies are not hard to implement with CDML, in fact they job is almost trivial since Web Companion takes care of most of the work. The only problem is browser incompatibility handling the cookies...
BuddySystems Posted December 20, 2000 Author Posted December 20, 2000 How would cookies help? Can I move a cookie directly to Filemaker?
Vaughan Posted December 20, 2000 Posted December 20, 2000 You sure can move a cookie directly to FMP -- just like you can a token. The cookie value is "called" with the [FMP-Cookie: cookiename] CDML tag. To get the value into a FMP database you'd need a form with the CDML tag... <input type="hidden" name="fieldname" value="[FMP-Cookie: cookiename]"> ...or something similar could be done by generating a url directly for people to click on. Alternativerly the cookie value can be used in a [FMP-If] statement in a custom html format file.
BuddySystems Posted December 21, 2000 Author Posted December 21, 2000 I know that I can do that - what I need to do though is do a find AND THEN pass the token so that the found records display certain pricing data based on the current user.
Vaughan Posted December 21, 2000 Posted December 21, 2000 Try doing it in the database itself, not in CDML. That is, create a calculation field in the db that works out who the current user is (I dunno how you do that over the web with accuracy, passwords perhaps) and take it from there.
Keith M. Davie Posted January 3, 2001 Posted January 3, 2001 shimoda has writter: "I have 2 dbs - Users and Products - The user signs in to users which I then get a token from. Then they can view and edit products. What I want to be able to do is let them only see their discounted cost based on their user id. "The only way I've figured to do this is to stay in the User database and create a portal to products with a relationship based on the product code and discount number,..." "- what I need to do though is do a find AND THEN pass the token so that the found records display certain pricing data based on the current user." The discount number could be a key. If that number is common to a user in User and is common to a price list in Products, you can probably access the Products db through an -inlineaction, by accessing that key number through a -token. Such syntax might read: [fmp-inlineaction:-db=Products.fp5,-lay=layoutname,-token=fmp-field:discount_number,-find][fmp-record][fmp-field:item] [fmp-field rice] <br>[/fmp-record][/fmp-inlineaction] You may not like the display of the results. FYI, regarding the Form Action entry of the Cookie mentioned above, a similar line of code will get a -token tag from the format file to the database. If you have successfully designated a -token tag which is a field, the code might read: <input type="hidden" name="discount_number" value="[fmp-currenttoken:3]"> If you have successfully designated a -token tag which is a -recid, the code might read: <input type="hidden" name="-recid" value="[fmp-currenttoken:4]"> Hope you find this useful. Peace Keith M. Davie
Recommended Posts
This topic is 8993 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