C
|
Chris Whitehead 5/1/2025 |
When I've done this previously I've used the update in the database API to update/insert the joined fields, I just unset the elements from the joined fields which I don't want to get passed to the save on the main table.. // Update the record with id=50 in the 'Cars' table Could it be that you're not unsetting a field? |
![]() |
Sergey Kornilov admin 5/1/2025 |
I see two issues here.
|
G
|
GMO author 5/1/2025 |
The multi-table custom LIST view has headers from two tables. One table requires TWO fields to be editable in the two table custom-view. Table-one "Dispatch" fields are called "active" and "date". "Dispatch" table is Master and "tbl_Invoices" is Details table. I only need to edit TWO FIELDs on the LIST View. Field Names = "active" and "Date". table-two "" has 5 fields that require un-set event. Link Field is "inv_id". /// ============================ BEGIN code return true; Questions:
What else am I doing wrong? This question might require writing a book. I only need to edit ONE Record at the time. I def do not require all records to be edited, just one. Note: previously mentioned error message "Error occurred >> not editable" is the first two words for PHPR 11 error messge. And the error message is expected because I can not get the the manual instructions figured out. Thank you Chris and Admin for your replies. Very much appreciated. |
![]() |
Sergey Kornilov admin 5/5/2025 |
There still multiple issues here.
It doesn't really make much sense as Dispatch table is not even a part of your setup. This is also something that you need to resolve to make this working. |
C
|
Chris Whitehead 5/6/2025 |
I think there's a bit of confusion on which table is which. If you post the query, that may help to give an idea on which fields belong to which table. It would also be helpful to see which fields are contained within the $values which is getting passed to the "beforeRecordAdded/Updated" event. If you drop this line into the "beforeRecordAdded/Updated" event, it will echo out the $values array, we can then see which fields from the query should be getting saved. echo " If the main table is "dispatch" and the fields of "date" and "active" are in that table, I am then thinking you don't need the other query, you just need to unset the fields in the "tbl_Invoices" which are getting passed in $values. |
G
|
GMO author 5/11/2025 |
Thank you, Chris, for your Echo suggestion. I will try it. Thank you, Admin. (Your SQL code intends to update the whole tbl_Invoices table.) >> Yes, indeed, it deleted over 40k Client Ids from my Invoice table, and luckily, I had a backup for the Invoice Table. And another thank you to our Admin for the suggestion: (You need to learn how to properly write a SQL query that would update something in a different table.) I am in 100% agreement. IMO: PHP Runner is a great PHP builder and an excellent program, and I appreciate the exceptional intellectual genius responsible for PHP Runner. I have been renewing my PHPR registration/license for approximately 15-17 years. I am in love! If I discover a solution, I will post it here. Thank you, Sergy, you are the best. |