Compartir a través de


Método OrganizationServiceContext.AddObject

Se aplica a: CRM 2015 on-prem, CRM Online

Adds the specified entity to the set of entities that the OrganizationServiceContext is tracking.

Espacio de nombres: Microsoft.Xrm.Sdk.Client
Ensamblado: Microsoft.Xrm.Sdk (en Microsoft.Xrm.Sdk.dll)

Sintaxis

'Declaración
Public Sub AddObject ( _
    entity As Entity _
)
public void AddObject (
    Entity entity
)

Parámetros

Comentarios

The entity is put into the tracking set of the OrganizationServiceContext in the Added state. The OrganizationServiceContext will attempt to insert the entity into the CRM on the next call to the SaveChanges. This method does not add entities related to the specified entity to the OrganizationServiceContext. Each object must be added through a separate call to AddObject.

The method does not validate that the entity set specified is in the Web service associated with the OrganizationServiceContext or that the added entity has the required attributes needed to be added to the specified entity set.

Seguridad de hilo

Los miembros estáticos públicos (Shared en Visual Basic) de este tipo son seguros para el hilo. No se garantiza que los miembros de instancia sean seguros para el hilo.

Plataformas

Plataformas de desarrollo

Windows Vista, Windows Server 2003 y

Plataformas de destino

Windows Vista,Windows XP

Vea también

Referencia

Clase de OrganizationServiceContext
Miembros de OrganizationServiceContext
Espacio de nombres de Microsoft.Xrm.Sdk.Client

Send comments about this topic to Microsoft.
© 2014 Microsoft Corporation. All rights reserved.