Can a Data Connector import rule use C# functions when using a data filter?

book

Article ID: 181165

calendar_today

Updated On:

Products

Symantec Products

Issue/Introduction

 

Resolution

Question: Can a Data Connector import rule use C# functions or code when using a data filter? For example, "[date] < DateTime.Today()", where "DateTime.Today()" is a C# subroutine that returns the current date and time.
Answer: An import rule cannot use C# functions in a data filter, such as the DateTime.Today() function. A data filter can only use basic SQL commands. Note: The Data Connector User Guide refers to "using" DateTime in a data filter, however, this is out of context for it being used as a function. Trying to use a function will result in an error, such as "The expression contains undefined function call", as "DateTime.Today()" is not recognized."

A workaround is to manually specify the results of the function. For example, "[date] < '09-05-2012'". The value would need to also be manually changed before each run of the import rule to add in the correct value.

Another workaround is to consider using pre-processing for the data source, which can use some C# functions (but not all).

Related Articles

How to use C# code in Data Connector data source pre-processing
http://www.symantec.com/business/support/index?page=content&id=HOWTO80659

How to import data into the Symantec Management Platform database using Data Connector
http://www.symantec.com/business/support/index?page=content&id=HOWTO79380