empty record

If you're a new user of AppGini, feel free to ask general usage questions, or look for answers here.
Post Reply
guelland
Posts: 6
Joined: 2021-08-06 22:51

empty record

Post by guelland » 2021-08-08 09:42

Hello friends,
I used appgini with us in training.
There’s a section to help us manage the lockers.
The records lockers are set up 1 to 100.
Now lockers are occupied and released again.
That’s the problem. How do I get the record blank (as with a new creation) without deleting the record. Preferably with a button “locker free. ”
Putting the button on is not a problem, I already did that (Udemy).
I hope someone can help me with that.

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

Re: empty record

Post by jsetzer » 2021-08-08 11:20

What about an additional status field?

Like occupied yes/no (boolean) or status (free/occupied/reserved/...) or status_id as lookup refering a second 'states' table.

There are many options depending on your specific requirements.
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

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

Re: empty record

Post by jsetzer » 2021-08-08 11:29

By the way: I'm not sure if I got it right. Are you relying on 'id' column for locker-number 1-100? Usually you don't care for the technical id (primary key column) but create a second column, for example 'number', which can contain numbers 1-100 or more. Having technical id separate from number, you can even delete a record and create a new one with same number and don't have to care for technical id.

You can even keep historical data, for example:

Code: Select all

id;number;year;month;owner
1;50;2021;7;Jan
2;50;2021;8;Ahmed
...
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

guelland
Posts: 6
Joined: 2021-08-06 22:51

Re: empty record

Post by guelland » 2021-08-08 13:17

Hello,

That’s right. But I don’t want the user to delete or create records. He should only occupy the lockers that are present.

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

Re: empty record

Post by jsetzer » 2021-08-08 17:30

As I said: usually you don't use the technical id for naming (numbering) a given number (=100) of records.

Anyway, if you don't want them to delete or create records, you will have to use filters for listing only lockers not having an owner. Then they can select one record in DV, then press an extra button which sets the owner of that record. For removing ownership, you can add an extra button.


If this was my project, I'd model it differently:

Usually I'd create a table for the lockers (available resources) then a second, connected table for then rental (bookings), related to a locker and to a person, each.

For example

Code: Select all

Lockers
id;number
7;1
8;2
9;3
...
Note: the technical id does not matter

Code: Select all

Rentals
id;locker_id;owner
1;7;Jan
Now you can delete a rental record without losing the locker record itself. And you can add a new rental for the same locker record, perhaps for the next month or whatever your use case requires.

It's up to you, I can only tell from my experience that most of the times it makes sense to distinct between id and name/number and to split resources (lockers) and bookings (rentals) into different tables.
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: 1635
Joined: 2018-04-01 10:12

Re: empty record

Post by pbottcher » 2021-08-08 20:45

hi, as the information provided is limited, here another thought. you could use the batch action to vlear the record(s). See https://bigprof.com/appgini/help/advanc ... ch-actions
You can add a check in the hook to allow only specific groups this action.
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.

guelland
Posts: 6
Joined: 2021-08-06 22:51

Re: empty record

Post by guelland » 2021-08-12 17:19

Hello,
thank you for the many suggestions.
I see it's not that easy.
#Jan.
I think your approach is probably the easiest.
So a parent data set with locker.
Regestration number and a child data record with the trainee.
It would be nice if you could see the name of the trainee in parent record.
Let's see if i can fix this.
Thank you very much.

Post Reply