Changes to custom fields logged in the activity log

Have you ever noticed that after implementing a custom field, changes to that field are not logged in the activity log? Here's how to get the activity for your custom fields into the activity log.

1. Create an activity association for your new field. In parenthesis, you'll see an example that I used for a custom field called Call Type.
  1. On the web client go to the Administration tab, unfold the Notification menu, and select Activity Associations.
  2. Press 'Create New' on the Activity Association List.
  3. Enter the custom field name in the symbol text box (IND001)
  4. Enter a code in the code text box (IND001)
  5. Choose the object type from the drop-down box (Request)
  6. Enter a description of the field (The Call Type field on a Incident)
  7. Enter the custom attribute name (zCall_Type)
  8. Enter the activity type. You can use "Field Update" or you can create a new activity type if you need to specify notifications for the activity type you select. (Field Update)
  9. Check the "Log Me" checkbox.
2. Copy cr_site.mod from $NX_ROOT\caisd\samples\call_mgt to $NX_ROOT\caisd\site\mods\majic

3. Modify the contents of the file from the default below. Replace the attr, attr, with your custom attribute name.


OBJECT cr {
     TRIGGERS {
        // log field changes
        POST_CI val_fieldupdate_site(persistent_id, audit_userid, CHANGED_ONLY, attr, attr,... ) 40
                                    FILTER( EVENT("UPDATE") );
   } ;
};


Separate multiple custom attributes with commas.


OBJECT cr {
     TRIGGERS {
        // log field changes
        POST_CI val_fieldupdate_site(persistent_id, audit_userid, CHANGED_ONLY, zCall_Type, zDomain) 40
                                    FILTER( EVENT("UPDATE") );
    };
};

4. Restart USP services.
5. You should notice that the activity log now includes changes made to your custom field, but the custom attribute name (zCall_Type) is listed in the activity log instead of the label name (Call Type). Please refer to the Article entitled "Matching attribute names with label names" to resolve this problem.