This topic is locked

Send Fields Values When Clicking Add New Values on the Fly

8/29/2016 7:30:14 PM
PHPRunner General questions
D
dangdk author

Hi,
For a lookup field it is possible to add new numbers on the fly. Can I send some of the field values from the current record to this add new page so that they can populate some of the fields of that record. I would also ideally like to know if I got to the Add new page by clicking this "add new" link by the lookup field or not and this would then tell me to limit the fields to edit to just the one that the lookup is searching for with all the others to be written to be built from the sent fields.
Thanks

romaldus 8/29/2016



Hi,
For a lookup field it is possible to add new numbers on the fly. Can I send some of the field values from the current record to this add new page so that they can populate some of the fields of that record. I would also ideally like to know if I got to the Add new page by clicking this "add new" link by the lookup field or not and this would then tell me to limit the fields to edit to just the one that the lookup is searching for with all the others to be written to be built from the sent fields.
Thanks


Could you please rephrase your question?

M
mhollibush 8/30/2016

I am looking for the same thing, but more along the lines of the "copy record" function.
you can pass all the data using the "copy" button, but I would like to be able to specify what fields are being passed to the "copied" new record.
I think that what he is talking about
You can create a link that passes the desired fields to the new add record...
Create a field on the page that you want to have the link placed
Then create a custom view for the field and place the following code in the custom view
$value = "<a href=\"eventreg_add.php?eventID=".$data["eventID"]."&title=".$data["title"] . "\"><font color='#5bc0de'><b>Click Here To Pre Register</b></font></a>";
then on the "add" page - make the desired fields view as "custom" that you are wanting to pass and make them a default value as $_GET["eventID"] and the title field as $_GET["title"]
I use this as a link to register to an event - so the "eventid" and title are passed to the "register" page
Hope that makes sense and gives you some direction on what you could possibly use

D
dangdk author 8/30/2016

Hi,
I will rephrase it with pics, I hope that helps <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=80174&image=1&table=forumreplies' class='bbc_emoticon' alt=':)' />
I want to set up a Purchase Order system. I have a purchase_orders table as the master and a purchase_details table as the child, like in the pic below.


Each item in the purchase_details would be a specific item for that purchase order (so would link to the index key for the purchase_orders table). The supplier ID (key of the supplier from the suppliers table) would be sent from the master table to the details. Then I would be able to lookup productnames associated with that given supplier from previous orders. This would be stored in a supplier_products table with its own index key, the product name and the key of the supplier. The lookup would only show items for that supplier. I could also then "add new" which would (should) open the popup screen allowing me to make an entry on the supplier_products table. Clicking on that "add new" link should only allow me to edit the productname field, the key for the supplier should be automatically filled in (and the field greyed out) because I have already selected the supplier in the PO.
It is also the case that I buy different sizes of the same product from the same supplier, for example one time maybe a 1 litre bottle of ethanol and the next time a 50 litre bottle. For this I propose to have another table product_details which would have the supplier_id and the product name along with details for the size (product size), supplier code for that item (their own identifier) and the price. I would like to select these (if made before) or add a new entry in that table. The same principle would apply but instead this time I would be sending the supplier_id and the product_name to the add page and these fields should be greyed out. Similarly, if all other entries (supplier, product name, size, product code) have been filled out but the price has changed I would like to click add new and the only field available for input would be the price (the others would be automatically populated). The "size" "code" and "price" fields should also be greyed out until there is a value for the product name.
Can anyone help with this please.
Also, I have noticed that in PHPR9 the add new on the fly button currently opens a popup window that includes my header (which I don't want and it didn't do that on PHPR8) and that sometimes (actually currently all the time) clicking the add new button just leads to the browser window going blank and me losing all the data input. The actual url doesn't change but the screen goes blank. This happens for the add new on the fly button on many pages <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=80174&image=3&table=forumreplies' class='bbc_emoticon' alt=':(' />
Thanks



Could you please rephrase your question?