![]() |
Admin 2/24/2017 |
Are you adding this code to master or to details table event? The code itself doesn't look correct either. |
C
|
cardman3000 author 2/25/2017 |
This code is added to master table. |
![]() |
jadachDevClub member 2/25/2017 |
Can't you display the 3rd table in a custom view based on the first 2 tables? |
C
|
cardman3000 author 2/25/2017 |
Can't you display the 3rd table in a custom view based on the first 2 tables?
|
|
90288 2/25/2017 |
I think this can be done by : an event to add Master table fields after edit to Tracking table wihtout hw_id Then make a Sql auery of custom view to add the field hw_id. No, because with your suggestion I will get only the last value of the "Status" per hw_id. What I need is the whole history with all values saved per hw_id: id -------- Request_Nr -------- Agent ---------- Status ------------ hw_id 1 -------------- 1001 -------------- Peter -------- Created ------------- 123 2 -------------- 1001 -------------- Peter -------- Created ------------- 124 3 -------------- 1001 -------------- Peter -------- Created ------------- 125 4 -------------- 1001 -------------- Steve -------- Ordered ------------- 123 5 -------------- 1001 -------------- Steve -------- Ordered ------------- 124 6 -------------- 1001 -------------- Steve -------- Ordered ------------- 125 7 -------------- 1001 -------------- Steve -------- Processed --------- 123 8 -------------- 1001 -------------- Steve -------- Processed --------- 124 9 -------------- 1001 -------------- Steve -------- Processed --------- 125 Thanks for reply. |
![]() |
lefty 2/25/2017 |
I think this can be done by : an event to add Master table fields after edit to Tracking table wihtout hw_id Then make a Sql auery of custom view to add the field hw_id.
|
C
|
cardman3000 author 2/26/2017 |
"hw_id" is an auto-increment field of the Table_Assets. Assets will be manualy added to this table (for example logistic department) and then stored into Table_Hardware per Event "After record added". I have skipped this information because this step works fine. |
|
90288 2/26/2017 |
I think I got a solution for you if i really understood what you need: global $dal;
SELECT
|
C
|
cardman3000 author 2/26/2017 |
Hi Alain,
|
|
90288 2/26/2017 |
Hi Alain, first of all thank you for the assistance.
|
C
|
cardman3000 author 2/26/2017 |
Alain you can see the demo at demoaccount |
![]() |
lefty 2/26/2017 |
Alain you can see the demo at demoaccount Sorry, that was my mistake and bad explanation. Table_Hardware is only custom view of Table_Assets. OK, and that's what I need in the Tracking_Table: id -------- Request_Nr -------- Agent ---------- Status ------------ hw_id 1 -------------- -------------- Andy -------- Created ------------- 123 2 -------------- -------------- Andy -------- Created ------------- 124 3 -------------- -------------- Andy -------- Created ------------- 125 4 -------------- -------------- Andy -------- Created ------------- 126 5 -------------- ____ -------------- Andy -------- Created ------------- 127 6 -------------- 1001 -------------- Steve -------- Ordered ------------- 123 7 -------------- 1001 -------------- Steve -------- Ordered ------------- 124 8 -------------- 1001 -------------- Steve -------- Ordered ------------- 125 9 -------------- 1001 -------------- Peter -------- Processed --------- 123 10 ------------ 1001 -------------- Peter -------- Processed --------- 124 11 ------------ 1001 -------------- Peter -------- Processed --------- 125
|
|
90288 2/26/2017 |
Hello Cardman global $dal;
SELECT
|
C
|
cardman3000 author 2/27/2017 |
I could not imagine that my question would be so confused. |
![]() |
jadachDevClub member 2/27/2017 |
You might be able to do this using a trigger in your database. |
C
|
cardman3000 author 2/27/2017 |
You might be able to do this using a trigger in your database.
|
L
|
laonian 2/27/2017 |
I am kind of late. While Jerry's approach has worked for your purpose, I just want to post my traditional query method. And I am not sure if this is going to work or not.
|
![]() |
jadachDevClub member 2/27/2017 |
Jerry, just 4 words: "you are the best"! Only a simple trigger AFTER UPDATE and it works. That's solution!!!! Thank you and best Regards <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=81472&image=1&table=forumreplies' class='bbc_emoticon' alt=':D' />
|
C
|
cardman3000 author 2/27/2017 |
I am kind of late. While Jerry's approach has worked for your purpose, I just want to post my traditional query method. And I am not sure if this is going to work or not. Table_Order table After record updated event
|
L
|
laonian 2/27/2017 |
I've tested it and this is the result: Error type 256 Error description Unknown column 'REQ1001' in 'where clause' URL localhost/demoaccount/table_order_edit.php?submit=1&editid1=1& Error file C:\xampp\htdocs\demoaccount\connections\Connection.php Error line 642 SQL query *select from table_assets where Request_Nr = REQ1001** Thanks anyway
|