Complicated UserName Issue
If anybody has the time to bear with me, I've come across a problem that I haven't a clue how to fix.
Simple database -- two tables: Activities and Issues.
In both tables I have fields fors CreatedBy, CreatedDate, ModifiedBy, and ModifiedDate. All work fine.
In both tables I also have fields for ApprovedBy and ApprovedDate. In UAC I have separate authorities (User and Manager) so that regular users cannot access (but can see) these fields. Works fine.
I created an "Approved" button to run a script to insert AccountName in the ApprovedBy field and CurrentDate in the Approved Date fields. In UAC this script can only be accessed by somebody logging in as a manager. This works fine, BUT.
The AccountName (ApprovedBy) is pulling in the name off the computer, not the log-in name. Although this is OK most of the time, a manager may log in from another computer and then the wrong info will be logged. Also, every time the button/script is run, it modifies the ModifiedBy/ModifiedDate fields, even if the manager has not actually modified the contents of the record.
My two (related?) questions are:
1. How do I get the Approved button/script to insert the logged in name and not the name in the computer (AccountName)?
2. How can I stop the record from showing a new ModifiedBy name and date if the manager hasn't actually modified it? I would want it to show the manager's name if the manager actually modified any of the data in the record so the creator would know. In fact, later on I may try to set up a Layout for each user to show any records that have been modified by others.
All help greatly appreciated.