---
schema_version: "1"
id: 5fbcdd8d292ec88ac4ad94e9ae43631e6059561e99eb5fa618f95ff11619efb3
title: Custom Object and External Object Interactions
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/platform-pkg-exchange/managed_packaging/guides/second-generation/appexchange/app-analytics/app-analytics-read-logs/app-analytics-read-logs-custom-external-objects.md
canonical_url: https://developer.salesforce.com/docs/platform/pkg2-dev/guide/app-analytics-read-logs-custom-external-objects.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 5db0919f7f32be9cfd425591cf2c183c20d7bcc226f096de47e5b0b627dce99c
products:
  - Second-Generation Managed Packaging Developer Guide
  - merged-docs
---

# 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.

| Required Editions                                                                        |
| ---------------------------------------------------------------------------------------- |
| 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                                                                                                                                                         |
| ---------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <ul><li>`url`</li><li>`api_version`</li><li>`http_method`</li><li>`http_status_code`</li></ul> | <ul><li>`request_status`</li><li>`referrer_uri`</li><li>`api_type`</li><li>`rows_processed`</li><li>`request_size`</li><li>`response_size`</li><li>`num_fields`</li></ul> |

## 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                                                       |
| -------------------------------------------------------------------------- | ----------------------------------------------------------------------- |
| <ul><li>`api_version`</li><li>`class_name`</li><li>`method_name`</li></ul> | <ul><li>`url`</li><li>`request_status`</li><li>`referrer_uri`</li></ul> |

## 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                                                                                                                                                         |
| ---------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <ul><li>`url`</li><li>`api_version`</li><li>`http_method`</li><li>`http_status_code`</li></ul> | <ul><li>`request_status`</li><li>`referrer_uri`</li><li>`api_type`</li><li>`rows_processed`</li><li>`request_size`</li><li>`response_size`</li><li>`num_fields`</li></ul> |

## 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                                                                                                    |
| ----------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
| <ul><li>`api_type`</li><li>`api_version`</li><li>`request_size`</li><li>`response_size`</li><li>`method_name`</li></ul> | <ul><li>`url`</li><li>`request_status`</li><li>`request_uri`</li><li>`rows_processed`</li><li>`num_fields`</li></ul> |

## 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                                     |
| ------------------------------------------------------------------------------------------------------ | ----------------------------------------------------- |
| <ul><li>`api_version`</li><li>`bulk_job_id`</li><li>`bulk_batch_id`</li><li>`bulk_operation`</li></ul> | <ul><li>`api_type`</li><li>`rows_processed`</li></ul> |

## 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          | <ul><li>`event`</li><li>`event_subscriber`</li><li>`event_count`</li></ul> |

## 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`         | <ul><li>`request_status`</li><li>`referrer_uri`</li></ul> |

## 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                                                                                                      |
| ------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------- |
| <ul><li>class_name</li><li>method_name</li></ul> | <ul><li>`url`</li><li>`request_status`</li><li>`referrer_uri`</li><li>`request_size`</li><li>`response_size`</li></ul> |

## 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`         | <ul><li>`request_status`</li><li>`referrer_uri`</li><li>`request_size`</li><li>`response_size`</li></ul> |

## 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.

```nolang
{
     "timestamp_derived": "2022-12-15T05:47:35.945Z",
     "log_record_type": "VFRemoting",
     "request_id": "4mbhuJkvJ7Q83tlq2Z5aAk",
     "organization_id": "00Dxx0000006H2l",
     "organization_name": "MyCustomer Inc.",
     "organization_status": "Demo",
     "organization_edition": "Enterprise Edition",
     "organization_country_code": "IN",
     "organization_language_locale": "en_US",
     "organization_time_zone": "Australia/Sydney",
     "organization_instance": "GS0",
     "organization_type": "Production",
     "user_id_token": "005-rBBA92863JO8GJN3pT75gp0cG8a9z1vpH6MOti/359o=",
     "user_type": "Standard",
     "url":"uwlNmuT1+gH+xKq+xCoxiaAyOOhw8B4WLeQXAbgx+mA=",
     "package_id": "033xx0000004FqD",
     "package_version_id": "04txx0000004Idi",
     "managed_package_namespace": "Acme",
     "custom_entity": "Insurance_Agent",
     "custom_entity_type": "CustomObject",
     "operation_type": "INSERT",
     "operation_count": 2,
     "session_key": "9/uZ+soHD+0UqKYt",
     "login_key": "5tjyGvX04w06xFgT",
     "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",
     "user_country_code": "IN",
     "user_time_zone": "Asia/Kolkata",
     "class_name": "shwGCoJjDrkhbw+CY4TFzVxFWypN07UGvtGkexbj/y4=",
     "method_name": "3/UbV0E5yIW8a3c2Fb2XXjfWse1MUekEZWX44tp5TJs="
}
```

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     | <ul><li>`custom_entity`</li><li>`custom_entity_type`</li><li>`package_version_id`</li><li>`managed_package_namespace`</li></ul> | <ul><li>`Insurance_Agent`</li><li>`CustomObject`</li><li>`04txx0000004Idi`</li><li>`Acme`</li></ul> |
| Who      | <ul><li>`organization_id`</li><li>`user_id_token`</li></ul>                                                                     | <ul><li>`00Dxx0000006H2l`</li><li>`005-rBBA92863JO8GJN3pT75gp0cG8a9z1vpH6MOti/359o=`</li></ul>      |
| How      | `log_record_type`                                                                                                               | `VFRemoting`                                                                                        |
| How Much | <ul><li>`operation_type`</li><li>`operation_count`</li></ul>                                                                    | <ul><li>`INSERT`</li><li>2</li></ul>                                                                |
| 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.

```nolang
"url": "uwlNmuT1+gH+xKq+xCoxiaAyOOhw8B4WLeQXAbgx+mA=",
"class_name": "shwGCoJjDrkhbw+CY4TFzVxFWypN07UGvtGkexbj/y4=",
"method_name": "3/UbV0E5yIW8a3c2Fb2XXjfWse1MUekEZWX44tp5TJs="

```

If the Visualforce Remoting code is part of the package, you see actual values instead of tokens.

**See Also**

- [Package Usage Logs Schema](https://developer.salesforce.com/docs/platform/pkg2-dev/app-analytics-custom-object-logs.md)
