a question on Lookups

If you're a new user of AppGini, feel free to ask general usage questions, or look for answers here.
Post Reply
ushay
Veteran Member
Posts: 54
Joined: 2020-06-26 21:30

a question on Lookups

Post by ushay » 2023-05-09 15:47

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.

User avatar
a.gneady
Site Admin
Posts: 1281
Joined: 2012-09-27 14:46
Contact:

Re: a question on Lookups

Post by a.gneady » 2023-05-10 21:16

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.
:idea: 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.

ushay
Veteran Member
Posts: 54
Joined: 2020-06-26 21:30

Re: a question on Lookups

Post by ushay » 2023-05-11 15:33

Thanks Ahmed, it was very helpful.

Post Reply