Hi there,
can someone tell me how I can display 2 values via the lookup field (e.g. index and name), but only save one of them (name) in the table field?
Thanks
Thomas
Lookup field with two caption fields, only save one
Re: Lookup field with two caption fields, only save one
For Lookups exactly one value is stored in DB: the primary key ('id'). Not the name nor any other text.
We cannot decide which value will be stored. It is always the PK.
Caption field + optional separator + optional caption field 2 is just for display.
Next to the PK, if you need additional data in database, consider adding another column and populate it by code or by using a calculated field.
We cannot decide which value will be stored. It is always the PK.
Caption field + optional separator + optional caption field 2 is just for display.
Next to the PK, if you need additional data in database, consider adding another column and populate it by code or by using a calculated field.
Kind regards,
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
AppGini 25.10 + all AppGini Helper tools
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
[code]...[/code]
blocks for better readabilityAppGini 25.10 + all AppGini Helper tools
Re: Lookup field with two caption fields, only save one
Maybe I did not make myself clear. I have this situation: A lookup field from a parent table with Parent caption field part 1 and Parent caption field part 2, let's assume First_name and Last_name.
When adding a new field, the First and Last name are displayed correctly, and when saving, the last and first name does get saved, but I would like to save just the last name.
(specific case, I work for an NGO and we do have a large number of farmers, each with a unique ID. When doing distributions, we look up the farmer through the name, as the farmers do not know their unique ID. In the DB, I would just like to save the ID, the name is not needed.)
Thanks
Thomas
When adding a new field, the First and Last name are displayed correctly, and when saving, the last and first name does get saved, but I would like to save just the last name.
(specific case, I work for an NGO and we do have a large number of farmers, each with a unique ID. When doing distributions, we look up the farmer through the name, as the farmers do not know their unique ID. In the DB, I would just like to save the ID, the name is not needed.)
Thanks
Thomas
Re: Lookup field with two caption fields, only save one
Ignore the previous post. I understand that only the ID gets stored in the DB.
But in the AG table, both values, including the seperator are displayed. Where is that defined? I only want to display one value.
Thanks
Thomas
But in the AG table, both values, including the seperator are displayed. Where is that defined? I only want to display one value.
Thanks
Thomas
Re: Lookup field with two caption fields, only save one
You configure caption1 + optional separator + optional caption2 for the lookup field. As mentioned before, this is only for display.
There is no separate configuration option which allows you to configure TV, DV insert, DV update and DV view differently.
Again, consider adding additional autofill fields or calculated fields or fields populated in hooks by code.
There is no separate configuration option which allows you to configure TV, DV insert, DV update and DV view differently.
Again, consider adding additional autofill fields or calculated fields or fields populated in hooks by code.
I guess an autofill lookup should do. And you can exclude columns from TV display. Show original lookup field only in DV, hide from TV. Show autofill column in TV and DV.I only want to display one value.
Kind regards,
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
AppGini 25.10 + all AppGini Helper tools
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
[code]...[/code]
blocks for better readabilityAppGini 25.10 + all AppGini Helper tools
Re: Lookup field with two caption fields, only save one
Ok, thanks for that.
Indeed, the easiest seems to be to play around with detail and table view.
I'll try the calculated field method as well, hooks are above my skill level.
Thanks again,
Greetings from Malawi,
Thomas
Indeed, the easiest seems to be to play around with detail and table view.
I'll try the calculated field method as well, hooks are above my skill level.
Thanks again,
Greetings from Malawi,
Thomas