April 7, 200520 yr Hi, I'm having a hard time passing information from two different databases using CDML. I have a database "login" for storing login information, then I have a database "invoices" which holds information about customer invoices. After they login to the "login" database, I want to pass the company name so that when they do a search in the "invoices" database they can only search on their company name. In other words, when they login and transition to the search page for invoices I want a field that defaults (and shows) their name, then searches the "invoices" database for their company. It should also be noted that on the search page I wish to have other search criteria, like date, available. Any ideas/help will be greatly appreciated, everything I try seems to not work. Thanks in advance. TS
April 7, 200520 yr In the form for the search in the invoice DB, add the following line like this: <input type="hidden" name="company" value="[FMP-Field: company]">
April 8, 200520 yr Author Thank you for the suggestion. I keep getting a Javascript error when trying to go to the search page. I put your cdml in the link page (page before the search page). Here's the whole cdml link: FMPro?-DB=VendInv.fp5&-Format=vinvsearch.htm&<input type="hidden" name="Vendor" value="[FMP-Field: Vendor] What am I doing wrong? Thank you, TS
April 8, 200520 yr As I said, <input type="hidden" ... is in a <form ... (so POST action), not for in the URL (GET action). If your URL is a simple link (a href="..."), then it should look like this: FMPro?-DB=VendInv.fp5&-Format=vinvsearch.htm&Vendor=[FMP-Field: Vendor]&otherqueryparametershere&-find If it's in a JavaScript function, there are two scenarios: - the JavaScript is executed immediately upon load of the page: same as above - the JavaScript is executed by a user action: then you should pass the value of the field to a variable in the function e.g. < a href="execute_my_little_javascript_function([FMP-Field: Vendor])">click here</a> and the function: function execute_my_little_javascript_function(pass_me_a_vendor) { window.location.href="FMPro?-DB=VendInv.fp5&-Format=vinvsearch.htm&Vendor="+pass_me_a_vendor+"&otherqueryparametershere&-find"; }
Create an account or sign in to comment