"Field Check" CU 104015 compilation error

remark
Member Posts: 122
Hello,
I am trying to migrate NAV 5.0 SP1 native to SQL Server db. When using Migrate.fob file, after importing 104015 codeunit from a generated .txt file it is impossible to compile this imported 104015 codeunit.
I get an error:
"FIELDNAME is not a function, and only functions can be called with '(...'.
Please, help me with an advise, how it can be solved?
I am trying to migrate NAV 5.0 SP1 native to SQL Server db. When using Migrate.fob file, after importing 104015 codeunit from a generated .txt file it is impossible to compile this imported 104015 codeunit.
I get an error:
"FIELDNAME is not a function, and only functions can be called with '(...'.
Please, help me with an advise, how it can be solved?
0
Answers
-
can you paste the code where the compiler stops?
My guess you have some field name that causing this issue.0 -
Well of course I would suggest this ...
http://www.mibuso.com/dlinfo.asp?FileID=1149
Just run it with default options.Robert de Bath
TVision Technology Ltd0 -
ara3n wrote:can you paste the code where the compiler stops?
My guess you have some field name that causing this issue.
Thanks Rashed!
Here it is (I pointed out the line of error by line comment):A17235.CHANGECOMPANY(F.GetCompanyName); B17235.CHANGECOMPANY(F.GetCompanyName); F.UpdateKey(A17235.CURRENTKEY); A17235.MARKEDONLY := F.Modify; IF A17235.FIND('-') THEN REPEAT B17235 := A17235; B17235.SETRECFILTER; F.Update(B17235.GETFILTERS); F.CheckText(B17235.FIELDNAME("TableName"),MAXSTRLEN(B17235."TableName"),B17235."TableName"); //error occurs on this line after "FIELDNAME" F.CheckText(B17235.FIELDNAME("FieldName"),MAXSTRLEN(B17235."FieldName"),B17235."FieldName"); F.CheckText(B17235.FIELDNAME("Type Name"),MAXSTRLEN(B17235."Type Name"),B17235."Type Name"); F.CheckText(B17235.FIELDNAME("Field Caption"),MAXSTRLEN(B17235."Field Caption"),B17235."Field Caption"); F.CheckCode(B17235.FIELDNO("Division"),B17235.FIELDNAME("Division"),MAXSTRLEN(B17235."Division"),B17235."Division"); F.CheckCode(B17235.FIELDNO("Header"),B17235.FIELDNAME("Header"),MAXSTRLEN(B17235."Header"),B17235."Header"); F.CheckCode(B17235.FIELDNO("Component Line ID"),B17235.FIELDNAME("Component Line ID"),MAXSTRLEN(B17235."Component Line ID"), B17235."Component Line ID"); IF F.Modify THEN BEGIN A17235.DELETE; B17235.INSERT; END ELSE IF NOT A17235.MARK THEN A17235.MARK := F.Mark; UNTIL A17235.NEXT = 0;
0 -
rdebath wrote:Well of course I would suggest this ...
http://www.mibuso.com/dlinfo.asp?FileID=1149
Just run it with default options.
Thank you, I will try it.
Is this "Field Check" supposed to be as a replacement to Migrate.fob or just as a tool for additional checking before using standard methodology with Migrate.fob?0 -
It's a replacement for everything except the code field classification that, I think, is supposed to help you decide if you want to set the SQL type on code fields when you port from native to sql.Robert de Bath
TVision Technology Ltd0 -
OK, thank you, Robert!0
-
remark wrote:"FIELDNAME is not a function, and only functions can be called with '(...'.
Please, help me with an advise, how it can be solved?
My guess is that you have a field called "Fieldname" in table 17235. If you rename that field, the codeunit will compile.No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)0 -
Luc Van Dyck wrote:A few days ago I had the error "FIELDNO is not a function, etc." when I was using migrate.fob. This was caused by a table, which had a field called "FieldNo". Because FIELDNO is used as a function in this codeunit 104015, NAV does not know if you want to reference the field, or if you want to use the function with the same name.
My guess is that you have a field called "Fieldname" in table 17235. If you rename that field, the codeunit will compile.
Thank you, Luc!
Yes, there was a field called "Fieldname" in table 17235. I renamed it to "Fieldname1" and then tried to compile, but got another error:
When the function is called, the minimum number of parameters should be used. For example:
MyFunc( .. , .. , .. )
ROUND(MyVar)
ROUND(MyVar,0.05)
And the error occured on the same line of code (trigger Table17235), but after the first parameter "TableName" (I pointed it out by a line comment):A17235.CHANGECOMPANY(F.GetCompanyName); B17235.CHANGECOMPANY(F.GetCompanyName); F.UpdateKey(A17235.CURRENTKEY); A17235.MARKEDONLY := F.Modify; IF A17235.FIND('-') THEN REPEAT B17235 := A17235; B17235.SETRECFILTER; F.Update(B17235.GETFILTERS); F.CheckText(B17235.FIELDNAME("TableName"),MAXSTRLEN(B17235."TableName"),B17235."TableName"); //the error is here, after the first "TableName" F.CheckText(B17235.FIELDNAME("FieldName"),MAXSTRLEN(B17235."FieldName"),B17235."FieldName"); F.CheckText(B17235.FIELDNAME("Type Name"),MAXSTRLEN(B17235."Type Name"),B17235."Type Name"); F.CheckText(B17235.FIELDNAME("Field Caption"),MAXSTRLEN(B17235."Field Caption"),B17235."Field Caption"); F.CheckCode(B17235.FIELDNO("Division"),B17235.FIELDNAME("Division"),MAXSTRLEN(B17235."Division"),B17235."Division"); F.CheckCode(B17235.FIELDNO("Header"),B17235.FIELDNAME("Header"),MAXSTRLEN(B17235."Header"),B17235."Header"); F.CheckCode(B17235.FIELDNO("Component Line ID"),B17235.FIELDNAME("Component Line ID"),MAXSTRLEN(B17235."Component Line ID"), B17235."Component Line ID"); IF F.Modify THEN BEGIN A17235.DELETE; B17235.INSERT; END ELSE IF NOT A17235.MARK THEN A17235.MARK := F.Mark; UNTIL A17235.NEXT = 0;
Then I tried to rename yet another field in the table 17235 - TableName. I changed its name to TableName1. Then trying to compile I get an error on the same line (and exactly the same point) of code. The error message is following:
A field from a record variable was expected. For example:
Record.Field
Customer.Name0 -
Did you generate the CU 104015 again, after you have modified the fieldnames in the table?No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)0
-
Luc Van Dyck wrote:Did you generate the CU 104015 again, after you have modified the fieldnames in the table?
Thanks! That was the reason!
I changed back the TableName1 field to TableName, regenerated CU 104015, imported it again and, yes, it compiled without problems.
Should I return the initial name of a FieldName field in the table 17235 before running CU 104015 for scanning database?0 -
remark wrote:Should I return the initial name of a FieldName field before running CU 104015 for scanning database?No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)0
-
Luc, thank you very much!0
-
Reserved words should NEVER under any circumstances EVER be used for variables or Field Names. This is why it is so important to read the style guide and follow the rules.
The scariest thing here is the field number 17,325 meaning that its a localization done by whoever localized this version. This is disastrous that a, so called, developer was able to do this.
This needs to be reported to Microsoft. And they need to fix this.David Singleton0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions