Hard coded entries for later use (client requeriment)

If you're a new user of AppGini, feel free to ask general usage questions, or look for answers here.
Post Reply
arcanebits
Veteran Member
Posts: 104
Joined: 2018-12-10 21:52

Hard coded entries for later use (client requeriment)

Post by arcanebits » 2024-01-20 13:36

I have a client who, as a requirement, needs the application to automatically write a series of records to a specific table upon startup. The detail is that, by requirement (it is a financial entity), they need it to be hard-coded How can I achieve this? How can I write 3 records to a specific table and then work with those records later inside de Application as a normal record?"

Any help is welcome.
A3

arcanebits
Veteran Member
Posts: 104
Joined: 2018-12-10 21:52

Re: Hard coded entries for later use (client requeriment)

Post by arcanebits » 2024-01-22 13:22

I was thinking in using the after login hookup... any ideas?

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

Re: Hard coded entries for later use (client requeriment)

Post by jsetzer » 2024-01-22 15:25

I usually do that kind of stuff like auto inserting master data, if not exist, or auto creating groups and setting permissions by executing sql statements or method-calls in __global.php or in header-extras.php, sometimes also in TABLENAME.php hooks file if this is table related.
I usually execute those scripts if getLoggedAdmin(), not every time, because after update usually I reload the page as admin and so the scripts get executed by myself on first run.

Sometimes it makes sense to have a separate setup or migration or update file for the required update steps, which can be included.
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

arcanebits
Veteran Member
Posts: 104
Joined: 2018-12-10 21:52

Re: Hard coded entries for later use (client requeriment)

Post by arcanebits » 2024-01-23 14:41

Hi, very nice approach, I will hand draw a analisis of this aproach to port it after as code!
thanks again!
a3

Post Reply