Documentation

ZohoCRMClient

Version 1.2   |   Last Updated: 1/28/2014 (v1.2)   |  

ZohoCRMClient is the main class through which ZohoSharp client applications interact with Zoho CRM data. A ZohoCRMClient object is instantiated by providing field mappings through an IFieldMappings object and a model factory through an ICRMModelFactory object (see the Field Mappings section and the Model Factory section). If neither is provided, ZohoCRMClient will use default implementations for both field mappings and a model factory. A Zoho CRM API auth token must also be supplied to the ZohoCRMClient object, either upon instantiation or through the AuthToken property.

A number of settings options are available that control how the ZohoSharp library interacts with the Zoho API and the model objects that it processes. The majority of these settings are replicated in option objects that may be supplied on an individual request basis as well – these options are described in the General Get Options and General Post Options sections. Other options include:

Timeout
A timeout may be specified for all web requests made to Zoho.
WebPropertiesIgnoreOption
Specifies which ignore attributes to recognize on model classes. The default is WebSyncIgnoreOnly. See the Ignore Attributes section for further detail.
UseDummyGetQueryStrings
Specifies the option to append a dummy query string variable to all GET requests of the form "dummy=XXXXXXXXXXXX", where the Xs represent a random 12-character string. This eliminates (to an extremely high probability) the issue of a network stack or browser (particularly Internet Explorer) potentially caching prior GET requests. Default is false.
UseDotNetProxy
Specifies the option to use a special proxy server API instead of the actual Zoho API. This is required if using the library in a restricted environment like Silverlight that requires a crossdomain.xml file be present on the Zoho API server (which it isn’t). If set to true, the DotNetProxyBaseAddress property must also be set. The default is false.
DotNetProxyBaseAddress
Specifies the base uri address of the proxy server API. Only used when the UseDotNetProxy property is set to true.
DefaultModelTypesToGenerate
Specifying ModelType.POCO instructs the default model factory to return the default POCO model objects instead of the default SyncableModelBase model objects. The default is ModelType.Syncable. See the Model Factory section for further detail.
DisableDefaultModelPropertyNotifications
Specifying true instructs the default model factory to disable property notifications when returning the default SyncableModelBase model objects. The default is false. See the Model Factory section for further detail.
DisableDefaultModelStateTracking
Specifying true instructs the default model factory to disable state tracking when returning the default SyncableModelBase model objects. The default is false. See the Model Factory section for further detail.
PostNullFieldsOnInsert
Specifying true instructs the insert record methods to include all null or empty fields when generating the post request to the Zoho CRM API, otherwise the null or empty fields are excluded. The default is false.

The Module method accepts a string representation of a CRM module name and returns an ICRMClientModule object that is used to actually interact with the Zoho CRM. ZohoCRMClient also includes a set of convenience properties that accomplish the same thing – there exists a property for each built-in CRM module, returning the corresponding ICRMClientModule object.

The ICRMClientModule interface exposes the common Zoho CRM API functionality for operating on the various modules. This functionality is described in the Interacting with the Zoho CRM section. Calls to these methods should usually be wrapped with try-catch statements as the methods are designed to throw exceptions under a variety of situations.