Exposed functions

The Connector API exposes a number of functions, typically using custom data types.

Common exposed functions

The set of common functions are used in every connector, and therefore, should always be overridden and contain custom functionality. The uncommon functions are only used in special occasions, and as such are not contained in the sample connectors provided.

Each of the exposed functions takes a connectString parameter which is passed through from the Activation Info field in Composer. This is useful when data is only required to be retrieved from a single source, and the connection information will never change. However, if multiple data source connections are required, or the data source information is volatile, we recommend that the connection strings are stored elsewhere.

Each table and field name used within the Connector’s code is case-sensitive.

Common exposed functions reference

Function Type Notes
GetTablePermissions public virtual PDETablePermissions GetTablePermissions(string connectString, string table) This function should return a PDETablePermissions object which is initialized to give appropriate permissions. Select, Update, or Insert permissions are available.
TestConnection public virtual bool TestConnection(string connectString) This function is used to determine whether or not the connection to each required data source is functional. Code in TestConnection should perform a handshake with every stakeholding database or application before returning a Boolean value representing success or failure.
GetTables public virtual StringCollection GetTables(string connectString) This function should return a StringCollection of “virtual” table names. These table names will be exposed as part of the connector’s data source, and will therefore be available to use in Designer.
GetTableSchema public virtual DataTable GetTableSchema(string connectString, string tableName) This function should return a DataTable containing schema details about the specified table. The schema can either be built manually using the DataTable derived SchemaTable helper class, or retrieved using the GetTableData function and requesting only a schema.
GetTableData public virtual DataTable GetTableData(string connectString, string tableName, StringCollection fields, DataTableFilterCollection filters, bool schemaOnly) This function should return a DataTable containing the specified fields, matching on the specified filters and, where necessary, limit it only the schema structure.

Uncommon exposed functions reference

Function Type Notes
UpdateTableRow public virtual int UpdateTableRow(string connectString, string tableName, PDEFieldValueCollection, updateFieldValues, PDEFieldValueCollection keyFieldValues) If the tables which make up the data source require updating from a given App, this function should be overridden. Fields with values contained in updateFieldValues should be updated if the records contain the values in keyFieldValues. Returns a positive integer value which determines success.
InsertTableRow public virtual int InsertTableRow(string connectString, string tableName, PDEFieldValueCollection insertFieldValues, out object keyValue) If the tables which make up the data source require inserts from within a given App, this function should be overridden. If the table has a single key field, then the key value of the new record must be returned in the out parameter keyValue, or null if not present. Can be a numeric or string key value auto-generated by the connector or the data source. Returns a a positive integer value which determines success.
Article last edited 8 May 2018