April 10, 200223 yr Newbies Hello Over the last week i have been looking for some documentation for problem that i have. I'am working on a database system that needs to be approached with cdml. I have two tables wich are related. Table 1 contains a portal to see records in table 2. I created a website to add new records to the database. I have the following problem: I want to add multiple records in the portal just like in filemaker. I only approach table 1 from the web wich contains the portal. I only succeeded in adding only the first row. I use fmpro5.5 if anyone can help me i would apppreciate it. greetings from the Netherlands [ April 10, 2002, 03:47 AM: Message edited by: Tom_asplus2 ]
April 10, 200223 yr Greetings back from the USA. Let's switch locales for a couple of weeks, shall we? Unfortunately, FileMaker's native CDML/web server will not allow you to edit portaled information. This continues to be one of its major weaknesess. It is number two on my "wish list" after "the ability to view related data more than one relation away (without having to use calculated fields)". If it is imperative that your solution allows you to do this, you will need to look at Lasso, a product from Blueworld that provides much additional functionality to "webified" FileMaker databases.
April 10, 200223 yr I can edit multiple records in a portal. This is an extract from a quoting system I wrote: code: [FMP-Portal:quote_Id_rel] <a href="Javascript:showitem('[FMP-Field:quote_Id_rel::item_id]');">[FMP-Field:quote_Id_rel::item_id]</a> [FMP-Field:quote_Id_rel::item_name] <input type="text" name="quote_Id_rel::quanity.[FMP-CurrentPortalRowNumber]" value="[FMP-Field:quote_Id_rel::quanity]" size="4"> [FMP-Field:quote_Id_rel::sell_price_ex_tot_txt] [FMP-Field:quote_Id_rel::supplier_price_old] <a href="Javascript:rmvrow('[FMP-Field:quote_Id_rel::rec_id]');">remove</a>< [/FMP-Portal] The submit will edit all rows within the portal. I wrote this about a year ago, so I will have to search my memory for any esoteric explanations. Hope this points you in the right direction. Garry ps I've just removed the html formatting to clean it up. [ April 10, 2002, 02:38 PM: Message edited by: Garry Claridge ]
April 11, 200223 yr Author Newbies Thanks for the reply's Its nice to know that iam not the only one with that problem . I now found the solution to my problem, i just made a temp field wich was linked with a script that inputs the record in the portal. I used the code from Garry Claridge for editing the row when it is created but iam getting an error Object expected. Could it be that the code was incomplete for the javascript. Thanks Tom Bokma Greetings from the Netherlands
April 11, 200223 yr Tom, Here are the Javascript functions: code: <script> function rmvrow(rmvrecid) { if (confirm("Remove Item?")) { document.rmvrowfm.elements[7].value = rmvrecid ; document.rmvrowfm.submit() ; } ; } function addrow(additemid) { document.addrowfm.elements[8].value = additemid ; document.addrowfm.submit() ; } function showitem(showitemid) { window.open("","itemdetails","status=no,resizable=yes,scrollbars=yes,width=580,height=390") ; document.itemdetailsfm.elements[7].value = showitemid ; document.itemdetailsfm.submit() ; } function printtal() { window.open("http://[FMP-CurrentToken:0]:[FMP-CurrentToken:1]/FMPro?-db=quotes.fp5&-lay=web&-format=/digi_lan/print_quote_tal.html"e_id=[FMP-Field:quote_id]&-find","talprint","status=no,resizable=yes,scrollbars=yes,width=580,height=600") ; } function printalts() { window.open("http://[FMP-CurrentToken:0]:[FMP-CurrentToken:1]/FMPro?-db=quotes.fp5&-lay=web&-format=/digi_lan/print_quote_alt.html"e_id=[FMP-Field:quote_id]&-find","talprint","status=no,resizable=yes,scrollbars=yes,width=580,height=600") ; } </script> As you can see I use diferent forms, the main edit form is 'edquotefm'. The other forms are: code: <form name="rmvrowfm" action='http://[FMP-CurrentToken:0][FMP-CurrentToken:1]/FMPro' method='post' target='quote'> <input type="hidden" name="-db" value="quote_line_items.fp5"> <input type="hidden" name="-lay" value="web"> <input type="hidden" name="-format" value="/digi_lan/editreturn.html"> <input type="hidden" name="-token.0" value="[FMP-CurrentToken:0]"> <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-Field:quote_id]"> <input type="hidden" name="-recid" value=""> <input type="hidden" name="-delete"> </form> <form name="addrowfm" action='http://[FMP-CurrentToken:0] [FMP-CurrentToken:1]/FMPro' method='post' target='quote'> <input type="hidden" name="-db" value="quote_line_items.fp5"> <input type="hidden" name="-lay" value="web"> <input type="hidden" name="-format" value="/digi_lan/editreturn.html"> <input type="hidden" name="-token.0" value="[FMP-CurrentToken:0]"> <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-Field:quote_id]"> <input type="hidden" name="quote_id" value="[FMP-Field:quote_id]"> <input type="hidden" name="item_id" value=""> <input type="hidden" name="quanity" value="1"> <input type="hidden" name="-new"> </form> <form name="itemdetailsfm" action='http://[FMP-CurrentToken:0]:[FMP-CurrentToken:1]/FMPro' method='post' target='itemdetails'> <input type="hidden" name="-db" value="resale_items.fp5"> <input type="hidden" name="-lay" value="web"> <input type="hidden" name="-format" value="/digi_lan/item_details.html"> <input type="hidden" name="-token.0" value="[FMP-CurrentToken:0]"> <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-Field:quote_id]"> <input type="hidden" name="item_id" value=""> <input type="hidden" name="-find"> </form> Hope this makes sense. Garry [ April 11, 2002, 01:14 PM: Message edited by: Garry Claridge ]
April 12, 200223 yr Author Newbies Garry, Thanks for the reply iam getting further now but could you post the editreturn.html. Its making a little sence now Greetings Tom
April 13, 200223 yr Tom, I use 'return' files to go back to the original page. Better ways may exist, however this method works for me at the moment. Here is 'editreturn.html': code: <html> <head> <title>Edit Return</title> <meta name="generator" content="BBEdit 6.5.2"> </head> <body onload="Javascript:document.edreturnfm.submit();">...updating quote <form name="edreturnfm" action='http://[FMP-CurrentToken:0]:[FMP-CurrentToken:1]/FMPro' method='post' target='quote'> <input type="hidden" name="-db" value="quotes.fp5"> <input type="hidden" name="-lay" value="web"> <input type="hidden" name="-format" value="/digi_lan/editquote.html"> <input type="hidden" name="-token.0" value="[FMP-CurrentToken:0]"> <input type="hidden" name="-token.1" value="[FMP-CurrentToken:1]"> <input type="hidden" name="-token.2" value="[FMP-CurrentToken:2]"> <input type="hidden" name="quote_id" value="[FMP-CurrentToken:3]"> <input type="hidden" name="-find"> </body> </html> Hope this helps. Garry
March 11, 200322 yr Gary, Can you post the complete code for edquotefm.htm? I cannot follow the code for editing records in the portal: code: -------------------------------------------------------------------------------- [FMP-Portal:quote_Id_rel]<a href="Javascript:showitem('[FMP-Field:quote_Id_rel::item_id]');">[FMP-Field:quote_Id_rel::item_id]</a>[FMP-Field:quote_Id_rel::item_name]<input type="text" name="quote_Id_rel::quanity.[FMP-CurrentPortalRowNumber]" value="[FMP-Field:quote_Id_rel::quanity]" size="4">[FMP-Field:quote_Id_rel::sell_price_ex_tot_txt][FMP-Field:quote_Id_rel::supplier_price_old]<a href="Javascript:rmvrow('[FMP-Field:quote_Id_rel::rec_id]');">remove</a><[/FMP-Portal]
March 12, 200322 yr Here you go: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd"> <html> <head> <title>Edit Quote</title> <meta name="generator" content="BBEdit 6.5.2"> <style type="text/css"> <!-- .button {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 9px;; width: 100px} .maintext { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10pt; color: #000000} .message { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10pt; color: #FF0000} .update {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 9px; text-align: left; color: #000000} a { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 9px; font-weight:bold;text-decoration: none; color: #000000} body { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 9pt; background-color: #FFFFFF; margin-top: 0px; margin-left: 0px; padding-top: 0px; padding-left: 0px} input.text { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 9px; text-transform: none} td { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 9px; text-transform: none} td.head { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; font-weight:bold} td.button { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 9px; text-align: right} td.label { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 9px; text-align: right; font-weight: bold; white-space: nowrap} --> </style> <script> function rmvrow(rmvrecid) { if (confirm("Remove Item?")) { document.rmvrowfm.elements[7].value = rmvrecid ; document.rmvrowfm.submit() ; } ; } function addrow(additemid) { document.addrowfm.elements[8].value = additemid ; document.addrowfm.submit() ; } function showitem(showitemid) { window.open("","itemdetails","status=no,resizable=yes,scrollbars=yes,width=580,height=390") ; document.itemdetailsfm.elements[7].value = showitemid ; document.itemdetailsfm.submit() ; } function printtal() { window.open("http://[FMP-CurrentToken:0]:[FMP-CurrentToken:1]/FMPro?-db=quotes.fp5&-lay=web&-format=/digi_lan/print_quote_tal.html"e_id=[FMP-Field:quote_id]&-find","talprint","status=no,resizable=yes,scrollbars=yes,width=580,height=600") ; } function printalts() { window.open("http://[FMP-CurrentToken:0]:[FMP-CurrentToken:1]/FMPro?-db=quotes.fp5&-lay=web&-format=/digi_lan/print_quote_alt.html"e_id=[FMP-Field:quote_id]&-find","talprint","status=no,resizable=yes,scrollbars=yes,width=580,height=600") ; } </script> </head> <body><form name="edquotefm" action='http://[FMP-CurrentToken:0]:[FMP-CurrentToken:1]/FMPro' method='post' target='quote'><input type="hidden" name="-db" value="quotes.fp5"><input type="hidden" name="-lay" value="web"><input type="hidden" name="-format" value="/digi_lan/editquote.html"><input type="hidden" name="-token.0" value="[FMP-CurrentToken:0]"><input type="hidden" name="-token.1" value="[FMP-CurrentToken:1]"><input type="hidden" name="-token.2" value="[FMP-CurrentToken:2]"><input type="hidden" name="-recid" value="[FMP-CurrentRecID]"><table> <tr><td width="120"><b>Quote ID:</b> [FMP-Field:quote_id]</td> <td width="280"><b>Customer:</b>[FMP-Field:cust_name]</td> <td><b>Date:</b> [FMP-Field: quote_date]</td><td></td></tr> </table><table cellspacing="1"> <tr><th align="left" width="60">Item ID</th> <th align="left" width="320">Item Name</th> <th align="right">Qty</th> <th align="right">Price ex</th> <th align="right">Age</th> <th></th></tr> [FMP-Portal:quote_Id_rel] <tr bgcolor="#D3D3D3"><td><a href="Javascript:showitem('[FMP-Field:quote_Id_rel::item_id]');">[FMP-Field:quote_Id_rel::item_id]</a></td> <td>[FMP-Field:quote_Id_rel::item_name]</td> <td align="right"><input type="text" name="quote_Id_rel::quanity.[FMP-CurrentPortalRowNumber]" value="[FMP-Field:quote_Id_rel::quanity]" size="4"></td> <td align="right">[FMP-Field:quote_Id_rel::sell_price_ex_tot_txt]</td> <td align="center" valign="bottom">[FMP-Field:quote_Id_rel::supplier_price_old]</td> <td align="right"><a href="Javascript:rmvrow('[FMP-Field:quote_Id_rel::rec_id]');">remove</a></td></tr> [/FMP-Portal] <tr><td colspan="2"></td><td colspan="2"><hr></td></tr> <tr><td colspan="2"></td><td align="right"><b>Discount:</b></td><td align="right"> <input type="text" name="price_adjust" value="[FMP-Field:price_adjust]" size="4"></td><td align="left">%</td></tr> <tr><td colspan="2"></td><td align="right"><b>Delivery:</b></td><td align="right">$<input type="text" name="courier_cost" value="[FMP-Field:courier_cost]" size="8"></td></tr> <tr><td colspan="2"></td><td align="right"><b>Total Ex:</b></td><td align="right">[FMP-Field:total_price_ex_txt]</td></tr> <tr><td colspan="2"></td><td align="right"><b>GST:</b></td><td align="right">[FMP-Field:gst_txt]</td></tr> <tr><td colspan="2"><input type="submit" name="-edit" value="Update Quote"> <a href="Javascript:printtal();">Print Tallied</a> <a href="Javascript:printalts();">Print Alts</a></td><td align="right"><b>Total Inc:</b></td><td align="right">[FMP-Field:total_price_inc_txt]</td></tr> </table></form> <form name="rmvrowfm" action='http://[FMP-CurrentToken:0]:[FMP-CurrentToken:1]/FMPro' method='post' target='quote'><input type="hidden" name="-db" value="quote_line_items.fp5"><input type="hidden" name="-lay" value="web"><input type="hidden" name="-format" value="/digi_lan/editreturn.html"><input type="hidden" name="-token.0" value="[FMP-CurrentToken:0]"><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-Field:quote_id]"><input type="hidden" name="-recid" value=""><input type="hidden" name="-delete"></form> <form name="addrowfm" action='http://[FMP-CurrentToken:0]:[FMP-CurrentToken:1]/FMPro' method='post' target='quote'><input type="hidden" name="-db" value="quote_line_items.fp5"><input type="hidden" name="-lay" value="web"><input type="hidden" name="-format" value="/digi_lan/editreturn.html"><input type="hidden" name="-token.0" value="[FMP-CurrentToken:0]"><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-Field:quote_id]"><input type="hidden" name="quote_id" value="[FMP-Field:quote_id]"><input type="hidden" name="item_id" value=""><input type="hidden" name="quanity" value="1"><input type="hidden" name="-new"></form> <form name="itemdetailsfm" action='http://[FMP-CurrentToken:0]:[FMP-CurrentToken:1]/FMPro' method='post' target='itemdetails'><input type="hidden" name="-db" value="resale_items.fp5"><input type="hidden" name="-lay" value="web"><input type="hidden" name="-format" value="/digi_lan/item_details.html"><input type="hidden" name="-token.0" value="[FMP-CurrentToken:0]"><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-Field:quote_id]"><input type="hidden" name="item_id" value=""><input type="hidden" name="-find"></form> </body></html> Good Luck. Garry
March 12, 200322 yr Hi Garry, I tried to follow your logic on deleting specific portal row without luck. I am getting error "Cannot find the specified row". I believe in your function rmvrow, elements[7] refers to the <input type="hidden" name="-recid" value="">. In this case, how does it know to delete this portal record? Thanks much. <form name="rmvrowfm" action='http://[FMP-CurrentToken:0]:[FMP-CurrentToken:1]/FMPro' method='post' target='quote'> <input type="hidden" name="-db" value="quote_line_items.fp5"> <input type="hidden" name="-lay" value="web"><input type="hidden" name="-format" value="/digi_lan/editreturn.html"> <input type="hidden" name="-token.0" value="[FMP-CurrentToken:0]"> <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-Field:quote_id]"> <input type="hidden" name="-recid" value=""> <input type="hidden" name="-delete"></form> function rmvrow(rmvrecid) { if (confirm("Remove Item?")) { document.rmvrowfm.elements[7].value = rmvrecid ; document.rmvrowfm.submit() ; } ; }
March 13, 200322 yr It is deleting the record directly from the related file; not from the portal. (Same effect though!) All the best. Garry
Create an account or sign in to comment