Hello,
I make à chronoconnectivity list who requested table include user_id field. How display username in the same list ?
Thank you.
I make à chronoconnectivity list who requested table include user_id field. How display username in the same list ?
Thank you.
Hi Veronique,
You will need to add a new "Model", set the relation type to "belongs To", foreign key to "user_id", and the table to "users" table, set the Model name to "User".
Then you can use User.username
Regards,
Max
You will need to add a new "Model", set the relation type to "belongs To", foreign key to "user_id", and the table to "users" table, set the Model name to "User".
Then you can use User.username
Regards,
Max
Hmm, nothing display in new column. Maybe the problem is that in one table user id is "user_id" field but in the other table is "id" field.
This the debug informations. In number 3 I don't see username field selected ?
Array
(
[0] => SELECT `Extension`.`id` AS `Extension.id`, `Extension`.`name` AS `Extension.name` FROM `jnew_chronoengine_extensions` AS `Extension` WHERE `Extension`.`enabled` = '1' ORDER BY `Extension`.`ordering` ASC
[1] => SELECT `Connection`.`id` AS `Connection.id`, `Connection`.`title` AS `Connection.title`, `Connection`.`params` AS `Connection.params`, `Connection`.`extras` AS `Connection.extras`, `Connection`.`published` AS `Connection.published` FROM `jnew_chronoengine_connections` AS `Connection` WHERE `Connection`.`title` = 'patronymes' AND `Connection`.`published` = '1'
[2] => SELECT COUNT(*) AS `patronymes.count` FROM `jnew_chronoengine_chronoforms_datatable_patronyme` AS `patronymes` LEFT JOIN `jnew_users` AS `User` ON `patronymes`.`user_id` = `User`.`id`
[3] => SELECT `patronymes`.`id` AS `patronymes.id`, `patronymes`.`patro_patronyme` AS `patronymes.patro_patronyme`, `patronymes`.`patro_variantes` AS `patronymes.patro_variantes`, `patronymes`.`patro_lieu` AS `patronymes.patro_lieu` FROM `jnew_chronoengine_chronoforms_datatable_patronyme` AS `patronymes` LEFT JOIN `jnew_users` AS `User` ON `patronymes`.`user_id` = `User`.`id` ORDER BY `patronymes`.`patro_patronyme` LIMIT 30
)
The query is correct, what do you have under the "Columns list" box now ? are you sure that your "user_id" fields are populated with valid users ids ?
Where i have to put "User.username" in the Table for front list table to be show? Please a example
Where i have to put "User.name" in the Table for front list table to be show? Please a example
I used this in the HTML textarea: Listar.cliente:{Cliente.name}
The query is correct, what do you have under the "Columns list" box now ? are you sure that your "user_id" fields are populated with valid users ids ?
Yes I'm sure. But how list could display "username" field value from "jnew_users" table when the SQL request don't select it like show debug :
[3] => SELECT `patronymes`.`id` AS `patronymes.id`, `patronymes`.`patro_patronyme` AS `patronymes.patro_patronyme`, `patronymes`.`patro_variantes` AS `patronymes.patro_variantes`, `patronymes`.`patro_lieu` AS `patronymes.patro_lieu`, `patronymes`.`user_id` AS `patronymes.user_id` FROM `jnew_chronoengine_chronoforms_datatable_patronyme` AS `patronymes` LEFT JOIN `jnew_users` AS `utilisateurs` ON `patronymes`.`user_id` = `utilisateurs`.`id` ORDER BY `patronymes`.`patro_patronyme` LIMIT 30
)
This is my "Columns list" box for front : [attachment=0]ScreenShot.jpg[/attachment]
The "utilisateurs" model details : [attachment=1]ScreenShot2.jpg[/attachment]
and second part of "utilisateurs" model details : [attachment=2]ScreenShot3.jpg[/attachment]
Please clear the "fields" box under the users model, the primary key is not retrieved and this is causing a problem!
Regards,
Max
Regards,
Max
Well, I clear "fields" box under the users model, but username field is always not selected. How can retrieved it ?
Véronique.
Véronique.
I had to create a new connection for it to work. Thanks for the support.
@Veronique,
Please clear the "Fields" box under all models, and try again, when this is done correctly you will be able to find both tables fields in the debug query!
Regards,
Max
Please clear the "Fields" box under all models, and try again, when this is done correctly you will be able to find both tables fields in the debug query!
Regards,
Max
This topic is locked and no more replies can be posted.