Hello,
I have a question regarding (multiple) foreign key relationships in ds files.
I have 3 tables: A, B and C
A contains a foreign key fk_B_id pointing to B, and B contains a foreign key fk_C_id pointing to C. C contains a simple field "myField"
I have these fields in A.ds.xml:
<field name="fk_B_id" foreignKey="B.f_id" joinType="outer" displayField="B_text" useLocalDisplayFieldValue="true"/>
<field name="B_text" includeFrom="B.C_text" hidden="true"/>
Fields in B.ds.xml:
<field name="fk_C_id" foreignKey="C.f_id" joinType="outer" displayField="C_text" useLocalDisplayFieldValue="true"/>
<field name="C_text" includeFrom="C.myField" hidden="true"/>
I have problems defining C_text. If I leave it as shown: (<field name="C_text" includeFrom="C.myField" hidden="true"/> ) everything seems to work. When I include "A.fk_B_id" in a form, it shows the values of "C.myField" correctly.
But I need a customSelectStatement instead, something like:
<field name="C_text" customSelectStatement="case when 1 then C.myField else 'a text' end" includeFrom="C.myField" hidden="true"/>
As I read in the forum, customSelectStatement and includeFrom do not work together. But how can I achieve what I am trying to do?
Using smartgwt 6.0p power.
I have a question regarding (multiple) foreign key relationships in ds files.
I have 3 tables: A, B and C
A contains a foreign key fk_B_id pointing to B, and B contains a foreign key fk_C_id pointing to C. C contains a simple field "myField"
I have these fields in A.ds.xml:
<field name="fk_B_id" foreignKey="B.f_id" joinType="outer" displayField="B_text" useLocalDisplayFieldValue="true"/>
<field name="B_text" includeFrom="B.C_text" hidden="true"/>
Fields in B.ds.xml:
<field name="fk_C_id" foreignKey="C.f_id" joinType="outer" displayField="C_text" useLocalDisplayFieldValue="true"/>
<field name="C_text" includeFrom="C.myField" hidden="true"/>
I have problems defining C_text. If I leave it as shown: (<field name="C_text" includeFrom="C.myField" hidden="true"/> ) everything seems to work. When I include "A.fk_B_id" in a form, it shows the values of "C.myField" correctly.
But I need a customSelectStatement instead, something like:
<field name="C_text" customSelectStatement="case when 1 then C.myField else 'a text' end" includeFrom="C.myField" hidden="true"/>
As I read in the forum, customSelectStatement and includeFrom do not work together. But how can I achieve what I am trying to do?
Using smartgwt 6.0p power.
Comment