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):
- 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:
- GetVariable(variable) — the parameter is mandatory
- SetVariable variable, value — the parameters are mandatory
To access and contribute to the discussion thread on the Microsoft Dynamics GP community click here.
Until next post!
Mariano Gomez, MIS, MCP, PMP
Maximum Global Business, LLC