Click or drag to resize
WebCrmApiWriteToWebcrmDirect Method
Updates an existing entity specified by organisationID and recordID or creates a new one if the ids are empty. If entityType is Organisations then organisationID and recordID must be equal.

Namespace: dk.webCRM.ApiSync.WebService
Assembly: dk.webCRM.ApiSync.WebService (in dk.webCRM.ApiSync.WebService.dll) Version: 2.0.0.5 (2.0.0.5)
Syntax
public WriteToWebCrmResult WriteToWebcrmDirect(
	DataEntityType entityType,
	long organisationID,
	long recordID,
	WebCrmData data
)

Parameters

entityType
Type: dk.webCRM.ApiSync.BusinessLayer.EnumsDataEntityType
Entity type.
organisationID
Type: SystemInt64
Organisation ID.
recordID
Type: SystemInt64
Enitity identifier.
data
Type: dk.webCRM.ApiSync.BusinessLayer.EntitiesWebCrmData
Collection of key-value pairs describing the entity.

Return Value

Type: WriteToWebCrmResult
Error status and identifier of the processed entity. The identifier can be useful while adding new entities.
Remarks
When creating a new table row for opportunity (create only) and the update value for opportunity/delivery number = "-1" (string) then the API will assign the opportunity/delivery number using auto numbering according to the settings in webCRM.
Examples
// Login and get a webservice ticket
WebCrmApiSoapClient proxy = new WebCrmApiSoapClient();
ErrorStatus errorStatus;
TicketHeader ticket = proxy.Authenticate("cm1111aaaaaa", "username", "password", out errorStatus);

// Write to webCrm
WebCrmData organisationData = new WebCrmData
{
    Pairs = new KeyValuePair[] {
    new KeyValuePair("o_organisation", "Wates Construction"),
    new KeyValuePair("o_divisionName", "Sharston"),
    new KeyValuePair("o_telephone", "0161 946 8800"),
    new KeyValuePair("o_fax", "0161 946 8800"),
    new KeyValuePair("o_postcode", "M22 4BJ") }
};
WriteToWebCrmResult result = proxy.WriteToWebcrmDirect(
    ticket, DataEntityType.Organisations, 0, 0, organisationData);
See Also