WebCrmApiWriteCollectionToWebcrm Method |
Updates or creates collection of entities.
WriteCollectionToWebcrm is deprecated, please use WriteCollectionToWebcrmDirect instead.
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 WriteCollectionToWebcrm(
DataEntityType entityType,
WebCrmDataCollection collection
)
Public Function WriteCollectionToWebcrm (
entityType As DataEntityType,
collection As WebCrmDataCollection
) As WriteCollectionToWebCrmResult
public:
WriteCollectionToWebCrmResult^ WriteCollectionToWebcrm(
DataEntityType entityType,
WebCrmDataCollection^ collection
)
member WriteCollectionToWebcrm :
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);
WebCrmData productData1 = new WebCrmData
{
Pairs = new KeyValuePair[] {
new KeyValuePair("4_System_ID", "0"),
new KeyValuePair("4_prd_organisationID", "1"),
new KeyValuePair("4_Year", "1998") }
};
WebCrmData productData2 = new WebCrmData
{
Pairs = new KeyValuePair[] {
new KeyValuePair("4_System_ID", "0"),
new KeyValuePair("4_prd_organisationID", "1"),
new KeyValuePair("4_Year", "1999") }
};
WebCrmDataCollection productCollection = new WebCrmDataCollection()
{
DataRecords = new WebCrmData[] { productData1, productData2 }
};
WriteCollectionToWebCrmResult result =
proxy.WriteCollectionToWebcrm(ticket, DataEntityType.Products, productCollection);
See Also