WebCrmApiWriteCollectionToWebcrmDirect Method |
Updates or creates collection of entities.
Namespace: dk.webCRM.ApiSync.WebServiceAssembly: dk.webCRM.ApiSync.WebService (in dk.webCRM.ApiSync.WebService.dll) Version: 2.0.0.5 (2.0.0.5)
Syntaxpublic WriteCollectionToWebCrmResult WriteCollectionToWebcrmDirect(
DataEntityType entityType,
WebCrmDataCollection collection
)
Public Function WriteCollectionToWebcrmDirect (
entityType As DataEntityType,
collection As WebCrmDataCollection
) As WriteCollectionToWebCrmResult
public:
WriteCollectionToWebCrmResult^ WriteCollectionToWebcrmDirect(
DataEntityType entityType,
WebCrmDataCollection^ collection
)
member WriteCollectionToWebcrmDirect :
entityType : DataEntityType *
collection : WebCrmDataCollection -> WriteCollectionToWebCrmResult
Parameters
- entityType
- Type: dk.webCRM.ApiSync.BusinessLayer.EnumsDataEntityType
Entity type. - collection
- Type: dk.webCRM.ApiSync.BusinessLayer.EntitiesWebCrmDataCollection
Collection of WebCrmData objects specifying entities to update or add.
Entities are identified by specific fields corresponding to entity type.
For example, for person it is Person_ID.
If the identifier is equal to 0 then new entity is to be added with the given data.
Note that entity identifier is required here. Otherwise entity will not be processed.
Return Value
Type:
WriteCollectionToWebCrmResultReturns IDs of the processed entities as well error status for each separate item and for the whole collection.
Examples
WebCrmApiSoapClient proxy = new WebCrmApiSoapClient();
ErrorStatus errorStatus;
TicketHeader ticket = proxy.Authenticate("cm1111aaaaaa", "username", "password", out errorStatus);
productData1 = new WebCrmData
{
Pairs = new KeyValuePair[] {
new KeyValuePair("product_ID", "0"),
new KeyValuePair("prd_organisationID", "1"),
new KeyValuePair("prd_productYear", "1998") }
};
productData2 = new WebCrmData
{
Pairs = new KeyValuePair[] {
new KeyValuePair("product_ID", "0"),
new KeyValuePair("prd_organisationID", "1"),
new KeyValuePair("prd_productYear", "1999") }
};
WebCrmDataCollection productCollection = new WebCrmDataCollection()
{
DataRecords = new WebCrmData[] { productData1, productData2 }
};
WriteCollectionToWebCrmResult result = proxy.WriteCollectionToWebcrmDirect(
ticket, DataEntityType.Products, productCollection);
See Also