VBScript "Type Mismatch" Error with Integration Manager 10.0
For those of you battling it out with a "Type Mismatch" error in your event or field scripts upgraded to IM 10.0 from previous releases of IM, sweat it no more! This issue has been recognized as a bug by Microsoft and was unfortunately not resolved in Feature Pack 1 (or Service Pack 2). The problem seems to occur with all IM VBScript functions that accept parameters.
"The issue is that these functions (and many other) accepted OPTIONAL parameters in prior versions of IM. The reason these are now failing is because Integration Manager has been switched over from VB6 to C# .Net code. The problem with that is that C# does not support optional parameters. That means that those existing function's "Optional" parameters are now actually Required parameters." said Greg Willson with Microsoft in the Microsoft Dynamics GP Community group.
However, as a workaround, IM developers must supply all parameters for the affected functions until a Hot Fix is made available in July. Willson proceed to explain the issue with an example.
"So with that said, the LogDocDetail function has five parameters (message, source, status_code, field_name and field_value). All parameters are string values except "status_code" which is an Integer value. So, now that we know that, if you supply a value for all parameters, it will work as expected.".
The list of affected functions include (but may not be limited to):
Until next post!
MG.-
Mariano Gomez, MIS, MCP, PMP
Maximum Global Business, LLC
http://www.maximumglobalbusiness.com/
"The issue is that these functions (and many other) accepted OPTIONAL parameters in prior versions of IM. The reason these are now failing is because Integration Manager has been switched over from VB6 to C# .Net code. The problem with that is that C# does not support optional parameters. That means that those existing function's "Optional" parameters are now actually Required parameters." said Greg Willson with Microsoft in the Microsoft Dynamics GP Community group.
However, as a workaround, IM developers must supply all parameters for the affected functions until a Hot Fix is made available in July. Willson proceed to explain the issue with an example.
"So with that said, the LogDocDetail function has five parameters (message, source, status_code, field_name and field_value). All parameters are string values except "status_code" which is an Integer value. So, now that we know that, if you supply a value for all parameters, it will work as expected.".
The list of affected functions include (but may not be limited to):
- CancelDocument [message, source, status_code, field_name, field_value]
- CancelIntegration [message, source, status_code]
- Execute path [, timeout] [, window_style]
- LogDetail [message, source, status_code]
- LogDocDetail [message, source, status_code, field_name, field_value]
- LogDocWarning [message, source, status_code, field_name, field_value]
- LogWarning [message, source, status_code]
- PlaySound path
Functions not affected:
- ClearVariables
- DocumentIsNew
- DocumentNo
- GetVariable(variable) -- the parameter is mandatory
- SetVariable variable, value -- the parameters are mandatory
Until next post!
MG.-
Mariano Gomez, MIS, MCP, PMP
Maximum Global Business, LLC
http://www.maximumglobalbusiness.com/
Comments
Katie