---
schema_version: "1"
id: b8b1b6060c26bab8311fcb75fb706e6cfeb06d9a2eb9496cb4f32deaae6dd72d
title: AccountRelationship
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/object_reference/sforce_api_objects_accountrelationship.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_accountrelationship.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 7c77c2d84a545f8769f00ebc2cb241e31f13b1f479714ebd8e9af31845e338f4
description: Represents a relationship of a given type between two accounts. This object is available in API version 45.0 and later.
---
# AccountRelationship

Represents a relationship of a given type between two accounts. This object is available in API version 45.0 and later.

## Supported Calls

create(), delete(), describeLayout(), describeSObjects(), getDeleted(), getUpdated(), query(), retrieve(), update(), upsert()

## Special Access Rules

In Digital Experience Settings, turn on the Enable Account Relationships org preference, which is off by default.

## Fields

| Field | Details |
| --- | --- |
| AccountFromID | 
Type

reference

Properties

Create, Filter, Group, Sort,

Description

ID of the account that gains access to data from AccountTo.



 |
| AccountToId | 

Type

reference

Properties

Create, Filter, Group, Sort

Description

ID of the account sharing data with AccountFrom.



 |
| LastReferencedDate | 

Type

dateTime

Properties

Filter, Nillable, Sort

Description

The timestamp when the current user last accessed this record, a record related to this record, or a list view.



 |
| LastViewedDate | 

Type

dateTime

Properties

Filter, Nillable, Sort

Description

The timestamp when the current user last viewed this record or list view. If this value is null, the user accessed this record or list view (LastReferencedDate) but didn’t viewed it.



 |
| Name | 

Type

string

Properties

Create, Filter, Group, idLookup, Sort, Update

Description

The name of the account relationship.



 |
| OwnerId | 

Type

reference

Properties

Create, Defaulted on create, Filter, Group, Sort, Update

Description

ID of the user who created the account relationship.



 |
| Type | 

Type

picklist

Properties

Create, Defaulted on create, Filter, Group, Restricted picklist, Sort

Description

The relationship type. All account relationship sharing rules of that type are to this account relationship.

Standard values are:

- System Integrator
- Agency
- Advertiser
- Reseller
- Distributor
- Developer
- Broker
- Lender
- Institution
- Contractor
- Dealer
- Consultant
- Client
- Vendor
- Agent
- Retailer
- SubContractor
- Supplier

Picklist items can be updated with your own values.



 |

## Associated Objects

This object has the following associated objects. Unless noted, they’re available in the same API version as this object.

[AccountRelationshipFeed](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_associated_objects_feed.htm "StandardObjectNameFeed is the model for all feed objects associated with standard objects. These objects represent the posts and feed-tracked changes of a standard object.")

Feed tracking is available for the object.

[AccountRelationshipHistory](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_associated_objects_history.htm "StandardObjectNameHistory is the model for all history objects associated with standard objects. These objects represent the history of changes to the values in the fields of a standard object.")

History is available for tracked fields of the object.

[AccountRelationshipOwnerSharingRule](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_associated_objects_ownersharingrule.htm "StandardObjectNameOwnerSharingRule is the model for all owner sharing rule objects associated with standard objects. These objects represent a rule for sharing a standard object with users other than the owner.")

Sharing rules are available for the object.

[AccountRelationshipShare](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_associated_objects_share.htm "StandardObjectNameShare is the model for all share objects associated with standard objects. These objects represent a sharing entry on the standard object.")

Sharing is available for the object.