How do I save the amount and not the id in my database?

The recommended method of customizing your AppGini-generated application is through hooks. But sometimes you might need to add functionality not accessible through hooks. You can discuss this here.
Post Reply
pasbonte
Veteran Member
Posts: 162
Joined: 2013-02-06 09:49

How do I save the amount and not the id in my database?

Post by pasbonte » 2023-11-08 18:16

Good evening

I have a database that works well, the staff enter hours by choosing in a combo field, but the value is always recorded with the id and not with the number, the amount. How do I save the amount and not the id in my database?

How do I save the amount and not the id in my database?

I'm attaching copies to be clearer,

thank you
formulaire
Capture d'écran 2023-11-08 191137.png
Capture d'écran 2023-11-08 191137.png (27.81 KiB) Viewed 2067 times
mysql
Capture d'écran 2023-11-08 191226.png
Capture d'écran 2023-11-08 191226.png (64.48 KiB) Viewed 2067 times
Capture d'écran 2023-11-08 191415.png
Capture d'écran 2023-11-08 191415.png (44.63 KiB) Viewed 2067 times

User avatar
jsetzer
AppGini Super Hero
AppGini Super Hero
Posts: 1817
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

Re: How do I save the amount and not the id in my database?

Post by jsetzer » 2023-11-08 18:42

That's the way lookups work. They store the primary key of the chosen record.

Consider adding another field and configure it as calculated field. The SQL command should fetch the value from the 2nd table where table2.pk=table1.fk
Kind regards,
<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 readability

AppGini 24.10 Revision 1579 + all AppGini Helper tools

pbottcher
AppGini Super Hero
AppGini Super Hero
Posts: 1638
Joined: 2018-04-01 10:12

Re: How do I save the amount and not the id in my database?

Post by pbottcher » 2023-11-09 22:14

Hi pasbonte,

maybe you explain a bit more what you try to acheive and why you need to store that data in the same table. That could help in finding a solution.
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.

User avatar
baudwalker
Veteran Member
Posts: 188
Joined: 2015-02-03 08:08
Location: Bellingen NSW Australia

Re: How do I save the amount and not the id in my database?

Post by baudwalker » 2023-11-09 23:17

Hi pasbonte,

Have a look at this.

viewtopic.php?f=6&t=2618

Barry

Post Reply