Sync 2 datafields in different tables

If you're a new user of AppGini, feel free to ask general usage questions, or look for answers here.
Post Reply
maschill
Posts: 1
Joined: 2016-03-23 11:21

Sync 2 datafields in different tables

Post by maschill » 2016-03-23 11:36

Hi,

I'm a very new user, so forgive me if the question is stupid :p

I'm working on a system to track tools that will be lent out to members of our crew. Right now I got a table for tools, one for employees and one is supposed to track who borrows what when(Lendings).

To be able to track what tools are available right now or who has missing stuff, there is a status entry for every tool and one for every lending process.
However I'm not able to sync those two fields.
AKA what I want is if I register a new tool, its status is 'available'. Then if somone borrows it , its marked as 'borrowed' in both the tables. Then when its brought back, its status is changed back to 'available'.

As far as I understood it, normal lookup fields are to choose data entries from other tables, not for syncing them up.
I hope the problem is clear. Help please :p

best regards,
mace

User avatar
shasta59
AppGini Super Hero
AppGini Super Hero
Posts: 231
Joined: 2013-01-08 19:40
Location: Calgary, Alberta, Canada

Re: Sync 2 datafields in different tables

Post by shasta59 » 2016-03-28 02:55

What version of AppGini are you using?

It is a good idea to put something like:

Using AppGini 5.xx in the first line of your post.

And this is very doable using a hook function that would update the correct field so both say borrowed or available when brought back .

Should not be too hard to do but right now I do not have the time to figure this out for you.

But when in the lendings table and you pick a took I assume you have a unique number like a serial # etc that identifies that tool. Then when that tool is marked borrowed the hook would, on record update, also update the correct record in the tools database based on the serial number or other unique identifier for that tool.

Hope this points you in the direction you need to go.

Alan
Calgary, Alberta, Canada - Using Appgini 5.50 -

Post Reply