1 of 1 people found this helpful
There are several possible approaches.
One method is to set up a layout for this purpose where you define and place global fields that correspond to each user editable field of your record. Your "save" button then uses set field to transfer the data from the global fields to a new record in your table. You then control which records can be edited by using scripts to transfer the data back into the global fields.
There are also ways to use record level access control inside Manage Security to control when a given record can or cannot be edited. For example, I created an invoicing system where, when the record's status field changes to "printed", the average user can no longer edit the record because there access privileges do not allow them to do so.
The first step is clear but may you please explain this step further:
"Your "save" button then uses set field to transfer the data from the global fields to a new record in your table"
So, how would i transfer the data from the global fields to a new record?
2 of 3 people found this helpful
Set Field ( firstname ; firstname_g )
Set Field ( lastname ; lastname_g )
.... repeat for each global field
I typically clear the global fields at the end of the script (or call a subscript to clear them), unless they are further needed in the script.
Global fields are session/user specific, so several people can use them this way and there is no problem.
Thanks a lot beverly
I have tried the second method (from security controls) and it works great but the only problem is that the record becomes non editable only when i logout and login back, so can i overcome this using a script without logging out?
philmodjunk, said in the first reply:
"when the record's status field changes to "printed", the average user can no longer edit the record because there access privileges do not allow them to do so."
So how can i achieve that? What if i want the record to be saved + becomes non editable with a click of a button?
You are awesome! I couldn't imagine getting this amount of great help in no time, really appreciated and i'm really impressed
Just adding to Beverly's script steps, before the New Record step you need to make sure the script navigates you to the correct Table, otherwise the New Record could have unexpected consequences.
Further, I use a similar method to keep users out of the main table in a Cash Book database; it enables all manner of data checking and standardising within the script that actually posts the data into the permanent record. In my case I don't use global fields but rather a temporary record in a separate data entry table as that gives me better flexibility.
To prevent changes to the stored data, apart from the method suggested by philmodjunk, you can also use field validation. I have a couple of binary Lock fields that are set to 1 when certain functions are performed (e.g. bank rec or tax reporting) after which data must not be changed. Then I set field validation to prevent change if the lock field(s) equal 1. It is simple and effective.
I have found this, i have tested the saving button, it works as it should. The only remaining step is to make the record non editable after it has been saved..
Sorry, I'm not seeing the entire thread. I answered how to set fields with global values. I will check what you are saying when I'm back online.
Sent from my miPhone
What privileges are you using? What menus are you using? If these have been answered, I'll see later.
Sent from my miPhone
Records via this layout>Modifiable
All View Only
All Executable Only
Available Menu Commands>All
Thanks a lot for your time,
the record should be "editable" until it is committed. are you saying that relogin is needed?
also, if you use Global (storage) fields for entry and script the Set Field(s), then you can also prevent entry into the fields (through Inspector).
remember that with script privileges it may be possible to change data (your admin permission for example).
What i have done is that i have added a script with the following step to a button called "Save Record":
Commit Record/Requests [With dialog:Off]
I don't know if this is the right way but this is what i have used, however if i click the "Save Record" button i still can edit the data regardless of the set privileges, but if i exit the application and then login, the records become non editable..So did you mean that once the record is committed it should be non editable automatically according to the set privileges without using additional scripts or any triggers?
In this topic: How to get rid of "Save changes to this record"
A boolean and a variable of 0,1 values are used to verify if the record is committed with the help of both buttons and layout triggers.
Finally i have achieved it!
I have followed this:How to get rid of "Save changes to this record"
Then i have added the following script with the OnObjectEnter Trigger to each field that i don't want it to be editable once the record is committed:
If [not IsEmpty (Get(ActiveFieldContents)) and table_name::commit]
Go to Field 
If there is another way of doing it without assigning the above script to each field that should be different time-saving way to use if all field must not be editable..
Thanks a lot everyone for your assistance,
1 of 1 people found this helpful
You can select multiple fields, and then Set Script Trigger for all of them at once.