Freeze the record so no one can modify that record
-
- Posts: 6
- Joined: 2013-01-22 06:40
Freeze the record so no one can modify that record
How i can freeze the record so no one can modify that record after changing some status in the record, for example customer created a record (using new button), the default status (of a field) is "Open". Now he worked on it and change the status (of a field) to "Applied" and save it. Now I want make this record to be freeze (after change the status from Open to Applied), so no one can edit it anymore. Any idea how to do it?
Re: Freeze the record so no one can modify that record
You could use the before_update hook to perform this ... the idea is to use the record ID provided in the $data['selectedID'] variable to retrieve the stored status value (don't use $data['status'] since the user can change this ... use the actual status value stored in the record) ... you can then return false if the status is "Applied" (returning false from the before_update hook prevents the update from taking place).
AppGini plugins to add more power to your apps:
- DataTalk is an innovative AppGini plugin based on ChatGPT that allows you to interact with your AppGini database using natural language questions, without writing any SQL. Check the demo video
- Mass Update plugin: Update multiple records at once and improve your workflow efficiency.
- Check our other plugins and get a generous discount of up to 30% when buying 2 or more plugins.
Re: Freeze the record so no one can modify that record
I already use a variation of Ahmad's method but I also return a line that advises the user it cannot be updated.
I am currently working on a hook to display a message, based upon a value, telling everyone when they select the record it cannot be modified anymore. This way they will not try to modify it and waste their time.
I do put in code so only those who are in one of the allowed groups can modify it.
Actually I am just working on changing it from group based permission in this case to using another table to pull a value from checking to see if that individual member can modify it. This is a table similar to what I talk about here.
http://forums.appgini.com/phpbb/viewtopic.php?f=7&t=58
The advantage, IMHO, is with another table present it is used as a lookup and an admin does not need to be involved. Anyone who has permission to see this table can add members who can modify it. The biggest advantage is modify access is controlled by who is in the table not by who is in a group.
It is actually less work this way as the admin/designer/programmer does not get involved at all. It allows the easy creation of turnkey systems so to speak. Consider the additional tables to be behind the scene administrator controls.
If you have any questions just ask.
I am currently working on a hook to display a message, based upon a value, telling everyone when they select the record it cannot be modified anymore. This way they will not try to modify it and waste their time.
I do put in code so only those who are in one of the allowed groups can modify it.
Actually I am just working on changing it from group based permission in this case to using another table to pull a value from checking to see if that individual member can modify it. This is a table similar to what I talk about here.
http://forums.appgini.com/phpbb/viewtopic.php?f=7&t=58
The advantage, IMHO, is with another table present it is used as a lookup and an admin does not need to be involved. Anyone who has permission to see this table can add members who can modify it. The biggest advantage is modify access is controlled by who is in the table not by who is in a group.
It is actually less work this way as the admin/designer/programmer does not get involved at all. It allows the easy creation of turnkey systems so to speak. Consider the additional tables to be behind the scene administrator controls.
If you have any questions just ask.
Calgary, Alberta, Canada - Using Appgini 5.50 -
Re: Freeze the record so no one can modify that record
Thanks for the explanation, so if I wanted to create a table where the staff had some sort of points given by the management on a monthly basis, could the above method be applied? I do not want the staff to change their points value but only their personal details, phone number, address....
Thank you,
Ben
Thank you,
Ben
Re: Freeze the record so no one can modify that record
Hi Ahmad,
Do you have an example in your website about the before_update hook please?
I am having the same problem, I need to freeze certain details so the user cannot change them, only the admin.
Thank you,
Ben
Do you have an example in your website about the before_update hook please?
I am having the same problem, I need to freeze certain details so the user cannot change them, only the admin.
Thank you,
Ben
Re: Freeze the record so no one can modify that record
Unfortunately there is no example code published currently for this, but I plan to prepare a post on this soon.bambinou wrote:Hi Ahmad,
Do you have an example in your website about the before_update hook please?
I am having the same problem, I need to freeze certain details so the user cannot change them, only the admin.
AppGini plugins to add more power to your apps:
- DataTalk is an innovative AppGini plugin based on ChatGPT that allows you to interact with your AppGini database using natural language questions, without writing any SQL. Check the demo video
- Mass Update plugin: Update multiple records at once and improve your workflow efficiency.
- Check our other plugins and get a generous discount of up to 30% when buying 2 or more plugins.
Re: Freeze the record so no one can modify that record
I know you are busy with the new release, but would also appreciate it, if you can post this example.
Take your time no rush.
Take care,
Ahmed
Take your time no rush.
Take care,
Ahmed
AppGini 22.14 - xampp 3.3.0 - PHP 7.4.30 - Summary reports - Calendar - Mass update - Messages - AppGiniHelper
Re: Freeze the record so no one can modify that record
For the time being I did it like this:
I have a master details, I ask the user to choose a YES when he finishes the last detail, this would trigger a change of ownership on the master table.
That is it, table is now locked and the save button disappears for him.
The user HAS to choose yes in order to process the item, this way there is no escape.
I have a master details, I ask the user to choose a YES when he finishes the last detail, this would trigger a change of ownership on the master table.
That is it, table is now locked and the save button disappears for him.
The user HAS to choose yes in order to process the item, this way there is no escape.
AppGini 22.14 - xampp 3.3.0 - PHP 7.4.30 - Summary reports - Calendar - Mass update - Messages - AppGiniHelper
Re: Freeze the record so no one can modify that record
Hi AhmedBR,
I need to better understand the procedure you used to lock the fields.
Is a long time I'm looking for a solution to this, and this could be a very good way.
Thank you very much for your help.
I need to better understand the procedure you used to lock the fields.
Is a long time I'm looking for a solution to this, and this could be a very good way.
Thank you very much for your help.
Re: Freeze the record so no one can modify that record
All you need to do is to update membership_userrecords and change the usarname from the user to another user.
And make sure the user can only edit his own records.
That is it.
This user can no longer edit the record because it is not his anymore = the records is LOCKED for him.
And make sure the user can only edit his own records.
That is it.
This user can no longer edit the record because it is not his anymore = the records is LOCKED for him.
AppGini 22.14 - xampp 3.3.0 - PHP 7.4.30 - Summary reports - Calendar - Mass update - Messages - AppGiniHelper
Re: Freeze the record so no one can modify that record
Hi Ahmed,
can you insert an example with code... i'm a novice and i don't understand where i must change the information for change the owner.
Thank you very much for your patience.
can you insert an example with code... i'm a novice and i don't understand where i must change the information for change the owner.
Thank you very much for your patience.