Audit Log Setup

Introduction

When you set up the Audit Log, you need to set up the following:

Prerequisites

To set up the Audit Log, you need to:

Have these user licenses Have these permissions Complete these tasks
and review these topics
before continuing
  • Create and Customize List Views

  • Manage Public Templates

  • View Setup and Configuration

Setting Up the Audit Log

When setting up the Audit Log, complete these tasks:

Configure the Audit Log Page Layout

  1. Access FieldFX Back Office.

  2. Switch to Salesforce Classic.

  3. From Setup, enter object in the Quick Find box, then select Objects.

  4. Click Audit Log.

  5. Under Page Layouts, click Edit next to Audit Log Layout.

  6. Add the following fields to the layout:

    • Cleared

    • New Audit Log

    • Originating Audit Log

  7. On the toolbar, click Buttons.

  8. Drag Packet Viewer into the Custom Buttons section.

  9. Click Save.

Grant Permissions

  1. Grant management personnel permissions to use the Audit Log:

    1. From Setup, enter permissions in the Quick Find box, then select Permission Sets.

    2. Open a permission set.

    3. Under Apps, click Object Settings.

    4. Click Audit Logs.

    5. Click Edit.

    6. Under Object Permissions, select Read, Create, and Edit.

    7. Under Field Permissions, select Read and Edit for every field.

    8. Click Save.

    9. Repeat the above steps for other permission sets as needed.

  2. Grant FieldFX Mobile users permissions so that their syncs get recorded in the Audit Log:

    1. From Setup, enter "permissions" in the Quick Find box, then select Permission Sets

    2. Open a permission set for FieldFX Mobile

    3. Under Apps, click Object Settings

    4. Click Audit Logs

    5. Click Edit

    6. Under Object Permissions, select Read, Create, and Edit

    7. Under Field Permissions, select Read and Edit for every field

    8. Click Save

    9. Repeat steps a to h for other permission sets as needed

  3. Grant users access to the Packet Viewer:

    1. From Setup, enter permission in the Quick Find box, then select Permission Sets.

    2. Open a permission set for Visualforce pages.

    3. Under Apps, click Visualforce Page Access.

    4. Click Edit.

    5. Add "FX5.PacketViewer" to Enabled Visualforce Pages.

    6. Click Save.

    7. Repeat the above steps for other permission sets as needed.

Set Up Features

Complete the setup for these features:

Email Notifications

You can set up email notifications to alert system administrators when sync upload errors occur.

System administrators can then resolve sync upload errors before they cause further disruption.

Setting Up Email Notifications

  1. Access FieldFX Back Office.

  2. Switch to Salesforce Classic.

  3. Add an email template:

    1. From Setup, enter email templates in the Quick Find box, then select Classic Email Templates.

    2. Click New Template.

    3. Select Text.

    4. Click Next.

    5. In Folder, select "Unified Public Email Templates".

    6. Select Available for Use.

    7. In Email Template Name, enter "Sync Upload Error".

    8. In Subject, enter "Sync Upload Error".

    9. Copy the following text:

      A sync upload error has just occurred.
      
      Details:
      Audit Log Entry: {!FX5__Audit_Log__c.Name}
      User: {!FX5__Audit_Log__c.FX5__User__c}
      Date/Time: {!FX5__Audit_Log__c.FX5__Event_Date__c}
      Record: {!FX5__Audit_Log__c.FX5__Tracking_Number__c}
      Error: {!FX5__Audit_Log__c.FX5__Message__c}
      
      Please access the Audit Log and resolve this sync upload error immediately.
    10. Paste the text into Email Body.

    11. Click Save.

  4. Add a workflow rule:

    1. From Setup, enter workflow rules in the Quick Find box, then select Workflow Rules.

    2. Click New Rule.

    3. In Object, select "Audit Log".

    4. Click Next.

    5. In Rule Name, enter Sync Upload Error.

    6. In Description, enter Email notification for sync upload errors.

    7. In Evaluate the rule when a record is, select created.

    8. Under Rule Criteria, select the following:

      • Run this rule if the following: select Criteria are met

      • Field: Select Audit Log: Type

      • Operator: Select equals

      • Value: Select SyncUploadError
        Screen shot of Rule Criteria selections

    9. Click Save & Next.

  5. Add an email alert:

    1. Click Add Workflow ActionNew Email Alert.

    2. In Description, enter Sync Upload Error.

    3. In Email Template, select "Sync Upload Error".

    4. In the Selected Recipients list, add the users to receive alerts about sync upload errors.

    5. In From Email Address, select "Current User’s email address".

    6. Click Save.

    7. Click Done.

    8. Click Activate.

List Views

You should set up custom list views to make tracking sync activity much easier.

We recommend that you create the following list views:

  1. Unresolved Sync Upload Errors

    Displays the Audit Log entries for sync upload errors you need to resolve.

  2. Resolved Sync Upload Errors

    Displays the Audit Log entries for sync upload errors you resolved.

Adding an Unresolved Sync Upload Errors List View

  1. Access FieldFX Back Office.

  2. Switch to Salesforce Classic.

  3. Open the Audit Logs tab.

  4. Click Create New View.

  5. Complete the following:

    1. In View Name, enter Unresolved Sync Upload Errors.

    2. Under Step 2: Specify Filter CriteriaFilter By Additional Fields, enter the following:

      Field Operator Value

      Type

      contains

      SyncUploadError

      Cleared

      equals

      False

    3. Under Step 3: Select Fields to DisplayAvailable Fields, select the following:

      • Audit Log ID

      • Event Date

      • User

      • Message

      • Tracking Number

      • Cleared

    4. Click Add.

    5. Under Step 4: Restrict Visibility, select Visible to all users.

    6. Click Save.

Adding a Resolved Sync Upload Errors List View

  1. Access FieldFX Back Office.

  2. Switch to Salesforce Classic.

  3. Open the Audit Logs tab.

  4. Click Create New View.

  5. Complete the following:

    1. In View Name, enter "Resolved Sync Upload Errors".

    2. Under Step 2: Specify Filter CriteriaFilter By Additional Fields, enter the following:

      Field Operator Value

      Type

      contains

      SyncUploadError

      Cleared

      equals

      True

    3. Under Step 3: Select Fields to DisplayAvailable Fields, select the following:

      • Audit Log ID

      • Event Date

      • User

      • Message

      • Tracking Number

      • Cleared

    4. Click Add.

    5. Under Step 4: Restrict Visibility, select Visible to all users.

    6. Click Save.

Auto Delete

Use the Auto Delete feature to delete Audit Log entries automatically after a set number of days.

Example 1. Possible entries to delete

Delete SyncComplete and SyncDownloadComplete entries automatically after 30 days.

This keeps the Audit Log running more efficiently and reduces your administrative burden.

Setting Up the Auto Delete Feature

  1. Access FieldFX Back Office.

  2. Switch to Salesforce Classic.

  3. Configure FX Settings:

    1. From Setup, enter custom settings in the Quick Find box, then select Custom Settings.

    2. Click Manage next to FX Settings.

    3. Click Edit.

    4. In AuditLogRetainingDays, enter the number of days after occurring that you want to delete Audit Log entries.

      Enter "30" to delete entries 30 days after they occurred.

    5. In AuditLogTypeForTruncation, enter the types of Audit Log entries you want to delete automatically (use commas to separate multiple values).

      Enter SyncDownloadComplete,SyncUploadComplete to delete SyncDownloadComplete and SyncUploadComplete entries only.

      As a best practice, never select to delete LoggedOutWithData or SyncUploadError entries.

    6. Click Save.

  4. Schedule the AuditLogTruncatorScheduler Apex class:

    1. From Setup, enter apex in the Quick Find box, then select Apex Classes.

    2. Click Schedule Apex.

    3. In Job Name, enter Audit Log – Auto Delete.

    4. In Apex Class, select "AuditLogTruncatorScheduler".

    5. Select how often you want to delete old Audit Log entries.

      Select a frequency of at least once per week, preferably daily.

    6. Click Save.

Running the Auto Delete Feature Manually

  1. Access FieldFX Back Office.

  2. Access Workbench.

  3. Select Utilities | Apex Execute.

  4. Enter the following script:

    System.debug(FX5.FXBatchableLauncher.Run('FX5.AuditLogTruncator', null));
  5. Click Execute.