Entity Ownership
![]() |
[Applies to: Microsoft Dynamics CRM 4.0]
Find the latest SDK documentation: CRM 2015 SDK
There are several types of entity ownership. Entities are typically owned by the organization or by a user. Custom entities always have one of these types of ownership. There are some system entities that do not have an owner. The type of ownership defines some operations that can be performed on an instance of the entity type. The following table describes the ownership properties.
| Ownership Type | Description |
| Organization Owned | Organization-owned entities typically contain data involving something that belongs to or that can be viewed by the whole organization. Organization-owned entities cannot be assigned or shared. For example, products are owned by the organization. |
| Business Owned | Business-owned entities belong to a business unit. |
| User Owned | User-owned entities are associated with a user. User-owned entities typically contain data that relates to customers, such as accounts or contacts. Security can be defined according the business unit for the user. |
| None | The entity is not owned by another entity. For example, the uom (unit-of-measure) and workflowlog (workflow log) entities are not owned by another entity. |
The ownership type is represented by the EntityMetadata.OwnershipType property.
Example
When you create an entity instance, the ownerid attribute is automatically set to be the ID of the authenticated user. For more information, see Web Service Authentication and Impersonation. The following code shows you how to assign a different owner.
newAccount.ownerid = new Owner();
// Set the value to the ID of a user in the system.
newAccount.ownerid.Value = new Guid("556E49E6-581B-4B61-91E4-6A7E7E8E6A9E");
// Set the type code of the owner.
newAccount.ownerid.type = EntityName.systemuser.ToString();
// Now create or update the entity instance.
See Also
Concepts
Reference
Other Resources
.gif)