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.
empty record
Re: empty record
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.
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
AppGini 24.10 Revision 1579 + all AppGini Helper tools
<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 readabilityAppGini 24.10 Revision 1579 + all AppGini Helper tools
Re: empty record
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:
...
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
AppGini 24.10 Revision 1579 + all AppGini Helper tools
<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 readabilityAppGini 24.10 Revision 1579 + all AppGini Helper tools
Re: empty record
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.
That’s right. But I don’t want the user to delete or create records. He should only occupy the lockers that are present.
Re: empty record
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
Note: the technical id does not matter
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.
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
...
Code: Select all
Rentals
id;locker_id;owner
1;7;Jan
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
AppGini 24.10 Revision 1579 + all AppGini Helper tools
<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 readabilityAppGini 24.10 Revision 1579 + all AppGini Helper tools
Re: empty record
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.
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.
Re: empty record
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.
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.