By kleung - Wed Oct 10, 2018 11:41 pm
- Wed Oct 10, 2018 11:41 pm
#817201
Hi,
Grateful if somebody can give me a hand to tackle the following problem in dynaform.
I have a table PMT_COMPANY indexed by COID for storing company information such as name (CONAME), address, etc.
I have another table PMT_VIP indexed by VIPID holding the information of the VIPs. This table contains a column VIPCOID holding the company key (COID) of the VIP for linking up the PMT_VIP and PMT_COMPANY.
In a dynaform, I have a field @@CoName of Suggest Control type which access to the PMT_COMPANY for company selection.
The SQL
SELECT CONAME, CONAME FROM PMT_COMPANY LIMIT 999
works well.
A dependent field @@CoID which the SQL
(SELECT COID, COID FROM PMT_COMPANY WHERE CONAME = @@CoName) in the sql Property
could get the COID successfully from the PMT_COMPANY.
In the same dynaform, I created a grid for the purpose of listing the VIPs of the selected company and their phone numbers and other information for my colleagues to select the VIPs (can be more than one) of the selected company for them to follow-up with. The columns of the grid are as follows.
VIPName (Suggest type) , Tel (Text type), other fields (all are of Text type)
The Tel other fields are dependent fields depending on the VIPName.
In the VIPName column, I used the following SQL in the sql Property trying to get the list of VIP names from the PMT_VIP.
SELECT VIPNAME, VIPNAME FROM PMT_VIP WHERE VIPCOID =@@CoID
I found out that the @@CoID is null in the grid and the SQL could not come up with any result.
Could the value of a dependent field carry forward into grid?
Grateful if I can be advised on how to fix the problem.
Thousand Thanks in advance.
cheers,
Karl
Grateful if somebody can give me a hand to tackle the following problem in dynaform.
I have a table PMT_COMPANY indexed by COID for storing company information such as name (CONAME), address, etc.
I have another table PMT_VIP indexed by VIPID holding the information of the VIPs. This table contains a column VIPCOID holding the company key (COID) of the VIP for linking up the PMT_VIP and PMT_COMPANY.
In a dynaform, I have a field @@CoName of Suggest Control type which access to the PMT_COMPANY for company selection.
The SQL
SELECT CONAME, CONAME FROM PMT_COMPANY LIMIT 999
works well.
A dependent field @@CoID which the SQL
(SELECT COID, COID FROM PMT_COMPANY WHERE CONAME = @@CoName) in the sql Property
could get the COID successfully from the PMT_COMPANY.
In the same dynaform, I created a grid for the purpose of listing the VIPs of the selected company and their phone numbers and other information for my colleagues to select the VIPs (can be more than one) of the selected company for them to follow-up with. The columns of the grid are as follows.
VIPName (Suggest type) , Tel (Text type), other fields (all are of Text type)
The Tel other fields are dependent fields depending on the VIPName.
In the VIPName column, I used the following SQL in the sql Property trying to get the list of VIP names from the PMT_VIP.
SELECT VIPNAME, VIPNAME FROM PMT_VIP WHERE VIPCOID =@@CoID
I found out that the @@CoID is null in the grid and the SQL could not come up with any result.
Could the value of a dependent field carry forward into grid?
Grateful if I can be advised on how to fix the problem.
Thousand Thanks in advance.
cheers,
Karl