Custom Object and External Object Interactions

When a log record in your package usage log has custom_entity_type equal to CustomObject or ExternalObject, it means that a user performed an action that resulted in a create, read, update, or delete (CRUD) interaction on your object.
Available in: both Salesforce Classic and Lightning Experience
Available in: Enterprise, Performance, Unlimited, and Developer Editions

To determine the type and amount of CRUD that occurred on your packaged component, focus on:

  • operation_type
  • operation_count

Many user actions result in CRUD, such as platform events, Apex REST API requests, or scheduled job executions. Each action is related to a log_record_type, and each log record has some standard fields that are always populated with data. For example, an Apex REST API request with a log_record_type of ApexRestApi always has url, api_version, http_method, and http_status_code data. Many actions produce log records with supplemental fields that are often populated. For example, an Apex REST API request sometimes has request_status, referrer_uri, and api_type data.

CRUD from Apex REST API Requests

To analyze an Apex REST API request that resulted in a CRUD operation on your packaged component, look for a log_record_type of ApexRestApi. Then use these fields to dig into the details of the Apex REST API interaction.

Standard Data Supplemental Data
  • url
  • api_version
  • http_method
  • http_status_code
  • request_status
  • referrer_uri
  • api_type
  • rows_processed
  • request_size
  • response_size
  • num_fields

CRUD from Apex SOAP API Requests

To analyze an Apex SOAP API request that resulted in a CRUD operation on your packaged component, look for a log_record_type of ApexSoap. Then use these fields to explore the details of the Apex SOAP API interaction.

Standard Data Supplemental Data
  • api_version
  • class_name
  • method_name
  • url
  • request_status
  • referrer_uri

CRUD from REST API Requests

To analyze a REST API request that resulted in a CRUD operation on your packaged component, look for a log_record_type of RestApi. Then use these fields to understand the details of the REST API interaction.

Standard Data Supplemental Data
  • url
  • api_version
  • http_method
  • http_status_code
  • request_status
  • referrer_uri
  • api_type
  • rows_processed
  • request_size
  • response_size
  • num_fields

CRUD from SOAP API Requests

To analyze a SOAP API request that resulted in a CRUD operation on your packaged component, look for a log_record_type of API. Then use these fields to uncover the details of the SOAP API interaction.

Standard Data Supplemental Data
  • api_type
  • api_version
  • request_size
  • response_size
  • method_name
  • url
  • request_status
  • request_uri
  • rows_processed
  • num_fields

CRUD from Bulk API Requests

To analyze a Bulk API request that resulted in a CRUD operation on your packaged component, look for a log_record_type of BulkApiV1 or BulkApiV2. Then use these fields to discover the details of the Bulk API interaction.

Standard Data Supplemental Data
  • api_version
  • bulk_job_id
  • bulk_batch_id
  • bulk_operation
  • api_type
  • rows_processed

CRUD from Scheduled Job Executions

To analyze a scheduled job execution that resulted in a CRUD operation on your packaged component, look for a log_record_type of CronJob. There are no additional package usage log fields to describe scheduled job executions.

Standard Data Supplemental Data
none none

CRUD from Platform Events

To analyze a platform event that resulted in a CRUD operation on your packaged component, look for a log_record_type of PlatformEventConsumer. Then use these fields to discover the details of the platform event.

Standard Data Supplemental Data
none
  • event
  • event_subscriber
  • event_count

CRUD from Queueable Apex Executions

To analyze a queueable Apex execution that resulted in a CRUD operation on your packaged component, look for a log_record_type of QueuedExec. There are no additional package usage log fields to describe Apex executions.

Standard Data Supplemental Data
none none

CRUD from Standard User Interface Requests

To analyze a user interaction that resulted in a CRUD operation on your packaged component, look for a log_record_type of URI. Then use these fields to discover the details of the user interaction.

Standard Data Supplemental Data
url
  • request_status
  • referrer_uri

CRUD from Visualforce Remoting Requests

To analyze a Visualforce Remoting request that resulted in a CRUD operation on your packaged component, look for a log_record_type of VFRemoting. Then use these fields to explore the details of the Visualforce Remoting request.

Standard Data Supplemental Data
  • class_name
  • method_name
  • url
  • request_status
  • referrer_uri
  • request_size
  • response_size

CRUD from Visualforce Requests

To analyze a Visualforce request that resulted in a CRUD operation on your packaged component, look for a log_record_type of VisualforceRequest. Then use these fields to explore the details of the Visualforce request.

Standard Data Supplemental Data
url
  • request_status
  • referrer_uri
  • request_size
  • response_size

CRUD from All Other User Actions

To analyze any other user action that results in a CRUD operation on your packaged component, look for a log_record_type of UnassociatedCRUD. There are no additional package usage log fields to describe all other interactions.

Standard Data Supplemental Data
none none

Example

Let’s look at an example package usage log record and analyze the custom or external object interaction.

1{
2     "timestamp_derived": "2022-12-15T05:47:35.945Z",
3     "log_record_type": "VFRemoting",
4     "request_id": "4mbhuJkvJ7Q83tlq2Z5aAk",
5     "organization_id": "00Dxx0000006H2l",
6     "organization_name": "MyCustomer Inc.",
7     "organization_status": "Demo",
8     "organization_edition": "Enterprise Edition",
9     "organization_country_code": "IN",
10     "organization_language_locale": "en_US",
11     "organization_time_zone": "Australia/Sydney",
12     "organization_instance": "GS0",
13     "organization_type": "Production",
14     "user_id_token": "005-rBBA92863JO8GJN3pT75gp0cG8a9z1vpH6MOti/359o=",
15     "user_type": "Standard",
16     "url":"uwlNmuT1+gH+xKq+xCoxiaAyOOhw8B4WLeQXAbgx+mA=",
17     "package_id": "033xx0000004FqD",
18     "package_version_id": "04txx0000004Idi",
19     "managed_package_namespace": "Acme",
20     "custom_entity": "Insurance_Agent",
21     "custom_entity_type": "CustomObject",
22     "operation_type": "INSERT",
23     "operation_count": 2,
24     "session_key": "9/uZ+soHD+0UqKYt",
25     "login_key": "5tjyGvX04w06xFgT",
26     "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/IP_ADDRESS_REMOVED Safari/537.36",
27     "user_country_code": "IN",
28     "user_time_zone": "Asia/Kolkata",
29     "class_name": "shwGCoJjDrkhbw+CY4TFzVxFWypN07UGvtGkexbj/y4=",
30     "method_name": "3/UbV0E5yIW8a3c2Fb2XXjfWse1MUekEZWX44tp5TJs="
31}

The Insurance_Agent packaged component of type CustomObject had CRUD performed as a result of a user action from the subscriber org My Customer Inc. Specifically, two records were inserted during a Visualforce Remoting request that the user performed at 2022-12-15 at 05:47 am UTC.

The key data in this analysis are:

Question Field Value
What
  • custom_entity
  • custom_entity_type
  • package_version_id
  • managed_package_namespace
  • Insurance_Agent
  • CustomObject
  • 04txx0000004Idi
  • Acme
Who
  • organization_id
  • user_id_token
  • 00Dxx0000006H2l
  • 005-rBBA92863JO8GJN3pT75gp0cG8a9z1vpH6MOti/359o=
How log_record_type VFRemoting
How Much
  • operation_type
  • operation_count
  • INSERT
  • 2
When timestamp_derived 2022-12-15T05:47:35.945Z

In this example, the Visualforce Remoting code isn’t owned by the package, so url, class_name, and method_name are tokenized.

1"url": "uwlNmuT1+gH+xKq+xCoxiaAyOOhw8B4WLeQXAbgx+mA=",
2"class_name": "shwGCoJjDrkhbw+CY4TFzVxFWypN07UGvtGkexbj/y4=",
3"method_name": "3/UbV0E5yIW8a3c2Fb2XXjfWse1MUekEZWX44tp5TJs="

If the Visualforce Remoting code is part of the package, you see actual values instead of tokens.