SuperOffice.ErpSync.Contract in your sync connector, you can take advantage of various helper classes and methods to make creating a connector a bit easier.
ConfigDataHelper class contains a
GetMetaData method which parses a given class to generate a set of
FieldMetadataInfo objects (used when Erp Sync asks the connector which fields are needed to define a connection, or which fields are supported on a given actor type).
It also has methods to save and retrieve configuration data to and from persistent storage (using
All return types from a sync connector are
PluginResponseInfo objects (or objects from one of its derived classes), and the
ResponseHelper class is designed to make it as easy as possible to generate these objects.
ConnectorWS also contains a copy of
CultureDataFormatter (the original version is found in SoCore), which can help with parsing strings to typed objects and vice versa.
For more information on the usefulness of this class, see field-value formats and conventions.
SearchHelper class contains various methods for checking if a given field value is a match to a given
SearchRestrictionInfo object. There are various methods available:
(object testValue, SearchRestrictionInfo restriction)
|Attempts to determine the type of the given value before sending it off to its respective typed version (see last row of this table).
If the type of the value is a string, it will also check to see if it is an encoded string, and if so try to parse it into a typed object first.
(object testValue, FieldMetadataTypeInfo testValueType, SearchRestrictionInfo restriction)
|The same as above, but instead of trying to determine the type of the value based on the value itself, it uses the given
|IsMatchString / IsMatchInt / IsMatchDouble / IsMatchDateTime / IsMatchBool||Typed version of
IsMatchString will not see if a string is encoded and try to parse it first.
All string comparisons are case insensitive.
There isn’t a separate method for list values, because each connector will handle lists in its own way. However, since the list item keys are communicated as simple strings from the ERP sync,
IsMatchString will probably be useful for checking searches containing list restrictions.
There are also extension methods available for all classes that are duplicated between the web service layer and the host/connector communication layer (such as
ErpActorWS), useful for turning one into the other (and vice versa).