This topic is locked

READ A FIELD FROM ANOTHER TABLE AUTOMATICALLY

7/7/2011 6:30:39 PM
PHPRunner General questions
A
Aleix author

Hello;
We need read de Master-link-field ID_TABLE1 from details TABLE2 before it is display.
We have the next structure:
TABLE1_

ID_TABLE1

OBJET_TYPE
TABLE2___


ID_TABLE2

ID_TABLE1_RELATION 1 --> N

OBJET_TYPE (DROPDOWN)

CUSTOMER_TYPE (DROPDOWN dependent of OF OBJET_TYPE)

CUSTOMER_CLASS (DROPDOWN dependent of CUSTOMER_TYPE)

CUSTOMER_PROPOST (DROPDOWN dependent of CUSTOMER_CLASS)
We need select CUSTOMER_PROPOST, then we do that with several dropdown.
THE PROBLEM__

The problem is that the user he does not Know what OBJET_TYPE have then we need read it from the TABLE1 automatically.

I mean, read de Master-link-field ID_TABLE1 from details TABLE2 before it is display.
Please help us to solve it. Thanks in advance.
We tray:

1.- AUTOFILL, but it dosen´t work with drop field. OBJET_TYPE is forced to dropdown or the CUSTOMER_TYPE

dropdown dependent dosen´t work.
2.- EVENT in the ADD PAGE – PROCESS RECORD VALUES or BEFORE DIPLAY, but de the

ID_TABLE1_RELATION in the TABLE2 is empty when we use

$values["ID_TABLE1_RELATION"]

we can not read it.
In EDIT PAGE it works fine.
Thanks

C
cgphp 7/8/2011

Please, could you post some screenshots or a demo ?
I don't understand why you have these two fields in TABLE_2:
"ID_TABLE1_RELATION"

"OBJET_TYPE (DROPDOWN)"
You need only one to link the two tables.

A
Aleix author 7/8/2011



Please, could you post some screenshots or a demo ?
I don't understand why you have these two fields in TABLE_2:
"ID_TABLE1_RELATION"

"OBJET_TYPE (DROPDOWN)"
You need only one to link the two tables.



Hello
First thanks for your answer.
This is a good question, and could be that the problem come from a bad structure.

At the end, we want to help the user to choose an option.
I will try to explain what we need.
Table1 with information about OBJET like serial number . . . and OBJETTYPE
In the Table2, the user select one SERVICE that is dependent of OBJET.
There are only one relation field between two talbes

MASTER TABLE1
__DETAILS TABLE2___

TABLE1-->ID_TABLE1 < ---- > TABLE2-->ID_TABLE1_RELATION
Imagine that there many SERVICES in another TABLE3, and we want to help at the user to choose the option in the TABLE2 with the dropdown dependent.
The dropdown are: (all in TABLE2-DETAILS TABLE)

  • OBJET_TYPE
  • CUSTOMER_TYPE ((DROPDOWN dependent of OF OBJET_TYPE)
  • CUSTOMER_CLASS (DROPDOWN dependent of CUSTOMER_TYPE)
  • SERVICE (DROPDOWN dependent of CUSTOMER_CLASS)
    Then we need de OBJET_TYPE because every OBJET_TYPE can attend only specific type of the customer, but the customer does not Know its OBJET_TYPE . It is a technical information.
    Then we want read OBJET_TYPE from TALBE1 with a query to the TABLE1 using ID_TALBL1_RELATION.
    But the problem is that we can´t access to the ID_TABLE1_RELATION, before de display. The fields are empty.
    We tried in the EDIT PAGE EVENT, and it works fine. The fields have information and then we can do the query and read de information that we need.
    But in de ADD PAGE EVENT ( Process record values), the fields are empty although we add register in the MATERS-DETALIS mode. We use $values("MyField") to read MyField
    Could be the problem is the structure, I don´t Know, any ideas would be welcome.
    Thanks for your help.