Application Uses a Value of the Wrong Type for the Current Operation error on SOP transaction Integration Content provided by Microsoft TechKnowledge Content Question: While running a Sales Order Processing transaction with Integration Manager using the SQL Optimized provider, the error message 'Application uses a value of the wrong type for the current operation' appears randomly during the integration. Why is this error occurring and how can it be resolved?Answer: The Contact field within Dynamics/eEnterprise has a keyable length of 31 characters. Within the Integration Manager SQL Optimized adapter the keyable length is specified as 64. When a value within the source file contains over 31 characters for the contact field, Integration Manager is unable to truncate as it has the contact field defined as 64 characters, and the error occurs.A work around for this situation is to use a VB script at the contact field event that trims the values from the source file to 31 characters.Currentfield=Left(Sourcefields("Query Name.Column Name"), 31)This article was TechKnowledge Document ID: 22654 APPLIES TO • Microsoft Dynamics GP 9.0 • Microsoft Business Solutions–Great Plains 8.0 • Microsoft Business Solutions–Great Plains 7.5 • Microsoft Great Plains Dynamics 7.0 • Microsoft Great Plains eEnterprise 7.0 • Great Plains Dynamics 6.0 • Great Plains eEnterprise 6.0 • Integration Manager Last Updated: 4 Apr 2017 Was this information helpful? Yes No Tell us what we can do to improve the article Submit Thanks! Your feedback will help us improve the support experience.