Page 1 of 1

Joined tables and hidden fields visible

PostPosted: Mon Jun 08, 2009 11:52 pm
by Jean
Hi Steve and all,
I have the last version of Xataface.
I have a sql request in my fields.ini with a left joint
Code: Select all
__sql__="select a.givenName AS givenName, a.sn AS sn, b.otherTelephone AS otherTelephone, b.mobile AS mobile, b.telephoneNumber AS telephoneNumber, b.employeeID AS employeeID, b.sAMAccountName AS sAMAccountName from annuaire_jointure AS a NATURAL LEFT JOIN annuaire_export AS b where CHAR_LENGTH(b.otherTelephone)>0 OR CHAR_LENGTH(b.telephoneNumber)>0 OR CHAR_LENGTH(b.mobile)>0"

Then I add a statement on 2 fields
Code: Select all
[employeeID]
visibility:list = hidden;
visibility:browse = hidden
visibility:edit = hidden

[sAMAccountName]
visibility:list = hidden
visibility:browse = hidden
visibility:edit = hidden

But the two fields appear in my list. What is wrong or what could I do ?
Thank you
Jean

PostPosted: Tue Jun 09, 2009 4:07 am
by shannah
One thought is that if you are using windows, it seems to force all column names to lower case which can muck with Xataface settings that are case-sensitive.

E.g.

try changing
[employeeID]
to
[employeeid]

to appease windows (if you are using windows).

Another comment aside from this is that if you are using the __sql__ mechanism you should make sure that the result set has a superset of columns, and a one-to-one mapping of rows to the original table. I.e. it should at least contain all of the columns of the original table and should not contain a where clause. It is possible that things will work for the most part without obeying this, but there may be undefined behavior at some point as Xataface is written with this assumption.

-Steve

PostPosted: Tue Jun 09, 2009 11:52 pm
by Jean
Thank you Steve. I eventuallly find a way to leave it like this.
Jean

PostPosted: Thu Jun 11, 2009 1:37 am
by silma
Hello,

I had the same problem with one of my many to many relationship.

Finally, i created a directory and a fields.ini for the join table involved, and i hid the recalcitrant fields there.

Hope this help. (And sorry for the english...)

Silma

PostPosted: Thu Jun 11, 2009 5:15 am
by Jean
Hello Silma,
Thank you very much. I did not succeed to achieve it, there must be a problem somewhere else in my program.
Jean