Hi all,
I'm sure some of you have had the same problem as me. I must first excuse, if the solution is somewhere on the forum. I'm new to Alpha Five, so running on the demo and trying to find out if it can help me with my needs for a database solution. I have looked for several days, trying to find out how to update a field in the database automatically with username when the record is changed. Also looked a lot in this forum, but haven't found a solution yet.
I have two fields in the database "CreatedBy", "ChangedBy". "CreatedBy" is set to user entered in Field Rules on the table, the default value is set to A5WS_GETCURRENTUSER(). So this gets the current user when a new record is created.
But "ChangedBy" doesn't work, I have tried to set Field Rules to Calculated, and then use the same A5WS_GETCURRENTUSER(), but no luck.
My next solution would properly be to somehow change the update script for the database, or do some xbasic to change the field from the form window. But I'm pretty lost here, since I don't know how to do xbasic yet.
I also thought if I could store username/userid in Session and the maybe use this on the database field, but doesn't seem like I'm allowed to use Session variables in database fields.
Hope some of you can help me with a solution.
Kind regards David.
I'm sure some of you have had the same problem as me. I must first excuse, if the solution is somewhere on the forum. I'm new to Alpha Five, so running on the demo and trying to find out if it can help me with my needs for a database solution. I have looked for several days, trying to find out how to update a field in the database automatically with username when the record is changed. Also looked a lot in this forum, but haven't found a solution yet.
I have two fields in the database "CreatedBy", "ChangedBy". "CreatedBy" is set to user entered in Field Rules on the table, the default value is set to A5WS_GETCURRENTUSER(). So this gets the current user when a new record is created.
But "ChangedBy" doesn't work, I have tried to set Field Rules to Calculated, and then use the same A5WS_GETCURRENTUSER(), but no luck.
My next solution would properly be to somehow change the update script for the database, or do some xbasic to change the field from the form window. But I'm pretty lost here, since I don't know how to do xbasic yet.
I also thought if I could store username/userid in Session and the maybe use this on the database field, but doesn't seem like I'm allowed to use Session variables in database fields.
Hope some of you can help me with a solution.
Kind regards David.
Comment