WITH ParameterSpec DO BEGIN ... TESTFIELD("Parameter Type","Parameter Type"::Integer);
Definition of field Parameter Type:Microsoft Dynamics NAV
Break On Error Message:
Parameter Type must be equal to 'Integer' in Parameter Spec.: Code=TEST2, Line No.=10000. Current value is 'Integer'.
OK
{ 12 ; ;Parameter Type ;Option ;OptionString=[ ,Integer,Decimal,Code,Text,Date,DateFormula,TableFilter,Boolean] }The debugger says, the value is Integer just before the error is thrown.
Answers
http://msdn.microsoft.com/en-us/library/dd301274.aspx
Seems to be what you are experiencing.
What are you trying to do with code?
Only process something that has an integer parameter?
http://www.BiloBeauty.com
http://www.autismspeaks.org
This code will work for sure - always!:
1 Go through local/global variables.
2 Skip the WITH ParameterSpec DO BEGIN line and add the tablevariable where neccessary.
3 Insert a line like: just before the TESTFIELD line.
4 Try to isolate the problem in a new simple table with just a few fields of the appropriate type.
I first added the record var explicitly in the code (but left the WITH in place. It must have no effect on that changed line of code, though This did not help.
I then added a just in front of the TESTFIELD, which also did not bring about any change, which really made me wonder.
I then noticed the field "Parameter Type" is a FlowField of Lookup type (CALCFIELDS was executed on it). However, the OptionSting value of the two fields differed. So, apparently, :bug: NAV used the OptionString definition of the table looked up from to show the value in the debugger and for the field value in the error message. The option constant, though was taken from the FlowField itself :roll:.