Value from Sub Entity
Value from Sub Entity
Hello Sergey,
It will be very very usefull to have field - Value from Sub Entity.
Do you have in plan this allready or is it possible to add in next version?
Thanks
It will be very very usefull to have field - Value from Sub Entity.
Do you have in plan this allready or is it possible to add in next version?
Thanks
Re: Value from Sub Entity
Hi Mirijan,
you can use MySQL formula field and MySQL:
SELECT GROUP_CONCAT(app_entity_31.field_343) SEPARATOR '<br/>') FROM app_entity_31 WHERE app_entity_31.parent_item_id=e.id
where:
app_Entity_31 .... subentity
field_343 .... desired field from subentity
<br/> .... separator, if there are more then 1 record related, then list them separated by line break
parent_item_id .... points to parent entity
e.id .... id of entity
The MySQL formula is implemented in app_entity_31.
I hope this is of some help.
Best regards, Pepe
you can use MySQL formula field and MySQL:
SELECT GROUP_CONCAT(app_entity_31.field_343) SEPARATOR '<br/>') FROM app_entity_31 WHERE app_entity_31.parent_item_id=e.id
where:
app_Entity_31 .... subentity
field_343 .... desired field from subentity
<br/> .... separator, if there are more then 1 record related, then list them separated by line break
parent_item_id .... points to parent entity
e.id .... id of entity
The MySQL formula is implemented in app_entity_31.
I hope this is of some help.
Best regards, Pepe
- support
- Site Admin
- Posts: 6222
- Joined: 19 Oct 2014, 18:22
- Name: Sergey Kharchishin
- Location: Russia, Evpatoriya
Re: Value from Sub Entity
Marijan, can you provide live example why do you need it?
By they way, solution form Pape will work ok BUT if field_343 is simple input field.
By they way, solution form Pape will work ok BUT if field_343 is simple input field.
Re: Value from Sub Entity
Hello Sergey and Pepe,
I have situation like on picture:
In sub entity there is history of position with remaining kms, in Parrent entity I need field where it will show last data of remaining km from sub entity field[290]=input numeric field and if is possible Location field[288]=input field
Please if you can help me because is complicate for me to enter in every data to see remaining km
Thanks
I have situation like on picture:
In sub entity there is history of position with remaining kms, in Parrent entity I need field where it will show last data of remaining km from sub entity field[290]=input numeric field and if is possible Location field[288]=input field
Please if you can help me because is complicate for me to enter in every data to see remaining km
Thanks
- support
- Site Admin
- Posts: 6222
- Joined: 19 Oct 2014, 18:22
- Name: Sergey Kharchishin
- Location: Russia, Evpatoriya
Re: Value from Sub Entity
try to use Mysql-query field type
https://www.rukovoditel.net/mysql-query.html
The condition can be:
https://www.rukovoditel.net/mysql-query.html
The condition can be:
Code: Select all
parent_item_id=e.id order by id desc
Re: Value from Sub Entity
Sergey, I try but result show 0
Last edited by marijan on 09 Feb 2019, 09:59, edited 1 time in total.
Re: Value from Sub Entity
Hello,
I try from Pepe suggestion like this but nothing happens
SELECT GROUP_CONCAT(app_entity_31.field_290) FROM app_entity_31 WHERE app_entity_31.parent_item_id=686
I don't know where I made mistake
If I try like this
SELECT GROUP_CONCAT(app_entity_31.field_290) SEPARATOR '<br/>') FROM app_entity_31 WHERE app_entity_31.parent_item_id=686
then I receive error:
Database Error: 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'SEPARATOR '<br/>') FROM ...
I try from Pepe suggestion like this but nothing happens
SELECT GROUP_CONCAT(app_entity_31.field_290) FROM app_entity_31 WHERE app_entity_31.parent_item_id=686
I don't know where I made mistake
If I try like this
SELECT GROUP_CONCAT(app_entity_31.field_290) SEPARATOR '<br/>') FROM app_entity_31 WHERE app_entity_31.parent_item_id=686
then I receive error:
Database Error: 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'SEPARATOR '<br/>') FROM ...
- support
- Site Admin
- Posts: 6222
- Joined: 19 Oct 2014, 18:22
- Name: Sergey Kharchishin
- Location: Russia, Evpatoriya
Re: Value from Sub Entity
You don't need GROUP_CONCAT since you have to select just last value.
Try next
or next
or next
Try next
Code: Select all
SELECT field_290 FROM app_entity_31 WHERE parent_item_id=686 order by id desc limit 1
Code: Select all
SELECT field_290 FROM app_entity_31 WHERE parent_item_id=e.id order by id desc limit 1
Code: Select all
SELECT app_entity_31.field_290 FROM app_entity_31 WHERE app_entity_31.parent_item_id=e.id order by app_entity_31.id desc limit 1
Re: Value from Sub Entity
1 milion thanks Sergey,
With second code it works
Thanks a lot
With second code it works
Thanks a lot
-
- Sponsor
- Posts: 215
- Joined: 03 Jun 2021, 22:06
- Name: Bradley Hayes
- Location: USA Palmdale
- Company Name: Two-Lifestyles, Inc.
- Contact:
Re: Value from Sub Entity
BUMP!
This type of field would be really useful.
We already have Value from Parent Entity.
I 100% agree we also need Value from Sub Entity.
This type of field would be really useful.
We already have Value from Parent Entity.
I 100% agree we also need Value from Sub Entity.