Skip to Content
Menu
This question has been flagged
2 Replies
2026 Views

Added a new field in Studio to a Delivery view and I want to record a line in the Log Note on that view every time anyone makes changes to that field.


Is there a way to do this from Studio?

Avatar
Discard
Best Answer

Yes - you should be able to change your new field to be tracked.  You can either find the field directly or from studio:



Then update the field definition:


You can't do this for standard fields, but there is a workaround

 

Avatar
Discard
Best Answer

Creating a log note when a particular field is updated in a system or database involves implementing a logging mechanism within your application or system. The exact steps may vary depending on the technology stack you're using, but here's a general outline of the process:

  1. Identify the Field to Monitor: Determine which field or fields you want to track for updates. This could be a user profile field, a configuration setting, or any other relevant data point.
  2. Database Design: If the field you're monitoring is stored in a database, ensure that your database schema has a structure to store the log notes. This may involve creating a separate table to store the log entries.
  3. Create a Log Table: If you don't already have one, create a table to store log entries. This table should include fields such as timestamp, user ID (if applicable), the field that was updated, the old value, the new value, and any other relevant information.
  4. Implement Triggers (if using a relational database): In relational databases, you can use triggers to automatically execute a set of instructions (such as inserting a log entry) when a specific event (such as an update to a certain field) occurs. Write a trigger that captures the necessary information and inserts a log entry into the log table.
    sqlCopy codeCREATE TRIGGER field_update_trigger
    AFTER UPDATE ON your_table
    FOR EACH ROW
    BEGIN
        IF NEW.updated_field acti https://www.finderlane.com OLD.updated_field THEN
            INSERT INTO log_table (timestamp, user_id, field_updated, old_value, new_value)
            VALUES (NOW(), NEW.user_id, 'updated_field', OLD.updated_field, NEW.updated_field);
        END IF;
    END;
    
    Note: This is just a simple example, and the actual implementation may vary based on your database system (e.g., MySQL, PostgreSQL, SQL Server).
  5. Implement Logging in Code (if not using triggers): If your application logic handles updates, incorporate logging directly into your code. When updating the field, add a step to log the change.
    pythonCopy codedef update_field(record_id, new_value, user_id):
        old_value = get_old_value(record_id)
        update_database(record_id, new_value)
    
        # Log the change
        log_entry = {
            'timestamp': current_timestamp(),
            'user_id': user_id,
            'field_updated': 'updated_field',
            'old_value': old_value,
            'new_value': new_value
        }
        insert_log_entry(log_entry)
    
  6. Testing: Thoroughly test your implementation to ensure that log entries are created only when the specified field is updated.

Remember to adapt these steps based on the specific technologies and frameworks you are using. Additionally, consider security measures, such as only allowing authorized users to update the monitored field and protecting the log entries from unauthorized access.


Avatar
Discard
Related Posts Replies Views Activity
1
Oct 24
1695
2
Oct 24
3047
1
Jul 24
2302
0
Jun 24
1179
2
Feb 24
2737