hello friends,
I have Lookup filed in one my tables that's attached to under table that stores the values.
I use this Lookup to store contact names, emails and phone numbers of construction companies.
my problem is that some companies have a different contact person on different sites, so if i change the details of contact person in one record it will change also in all previous records of that company.
can anyone suggest a different approach please?
Shay.
a question on Lookups
Re: a question on Lookups
The displayed contents of a lookup field will change when the parent record changes indeed. In some scenarios, you want to "freeze" the value of the lookup ..
In this case, one possible approach is to have a lookup field that shows maybe the company id, and a read-only text field for storing the "frozen" contact info.
Next, you should edit the "tablename_after_insert" hook for the table containing the lookup field to retrieve the contact info from the parent table and store them into the read-only contact info field. This way, the read-only field will preserve the contact info that were present at the time of creating the record.
We plan to add support for frozen lookup fields in future releases.
In this case, one possible approach is to have a lookup field that shows maybe the company id, and a read-only text field for storing the "frozen" contact info.
Next, you should edit the "tablename_after_insert" hook for the table containing the lookup field to retrieve the contact info from the parent table and store them into the read-only contact info field. This way, the read-only field will preserve the contact info that were present at the time of creating the record.
We plan to add support for frozen lookup fields in future releases.
AppGini plugins to add more power to your apps:
- DataTalk is an innovative AppGini plugin based on ChatGPT that allows you to interact with your AppGini database using natural language questions, without writing any SQL. Check the demo video
- Mass Update plugin: Update multiple records at once and improve your workflow efficiency.
- Check our other plugins and get a generous discount of up to 30% when buying 2 or more plugins.
Re: a question on Lookups
Thanks Ahmed, it was very helpful.