When i want to take a backup from dynamics NAV, this error appaers:
"There is an error in the database struture. The error (1190 in module 19)
may have been caused by the computer or a program.
Table: Item
Compny:
Key Fields: No."
Please advice
Ahmad Bani Naser
Dynamics NAV Developer
0
Comments
This has helped.
1. Make a copy of the database.
2. Export all data from table Item.
A simple dataport which dumps all fields except flowfields will do.
3. Delete all records with DELETEALL(FALSE).
4. Import the data.
You could use the same dataport.
Make sure that you don't use any triggers !
In most cases this error comes about because you have lower case characters in a CODE field. This can happen if you directly access the database (say though ODBC) and write data without making sure its the correct data type.
You need to figure out how the error occurred, by looking at any external connectivity you have.
Once you find the source, you need to fix the error by simply writing Navision code that converts the code from lower case to upper case.
I tried to solve the problem but i still hav a question.
Must i have a report that calculates the flowfield after
the Dataport? :-k
Thanks for answer and happy new year to everyone.
Martin
???
You don't need to calculate the flowfields.
Since they are calculated when used, you don't want to (nor should you) export and import that data.
Regards Martin
Then use C/AL-code in de trigger OnAfterImportRecord: INSERT(FALSE)
The property CallFieldValidate of the Dataport Fields is default No, which is what you want in this situation. Don't change those.
Good luck.
.. it makes me a little nervous that you wish me luck 8-[
but i will try it.
Regards Martin
It's slow and only a prototype...I will explain it when I can...now I'm busy as you can imagine
Well...
RRRec ->recordref
FRField -> fieldref
TBField -> table "Field"
code in bold -> it's fixed: you must change it according to the table you want to change: in this case table 23: Vendor
sorry...are there recref and fieldref in 2.60? I don't remember....
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
The code of Belias can be useful to resolve the problem.
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
i also find a solution of my problem. It 's a little different .
I wirte a Dataport and read al data from the table. Settings in
the Dataport were Autoupdate - No and Autoreplace - No. Then i
tried to read the txt-file into the table and it crashes different times.
A copy of the txt/file i opend in EXCEL and there i see that some of the
CODE-Fields had two " CR/LF ". That were the fault and i can correct it
directly in the Itemmask.
Now the database is Ok. The error were because some users copy and paste complete Cells from EXCEL into the Field.
Thanks everybody
Martin
As the code is now in tips&tricks, I have to confirm you that i tested the code (used for a dozen tables) ant it works fine (slow indeed, but better than modify data in sql, writing and writing queries)...and this is the complete object enjoy! 8)
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
Thought i would dig this thread up from last year, I'm "fortunate" enough to have a database with this problem (lowercase letter in code field) due to an external tool modifying records through ODBC. I have tried using the tool below to fix the issue but it just continues to generate the same "The X Table contains a value in a Code field that cannot be used with Microsoft Dynamics NAV" error message. Is there some trick to get the tool to work that i'm missing, or is it restricted to only work in C/Side or certain versions of NAV?
Any help would be much appreciated!
The tool solves ONLY lowercase/Code problems, not "strange" characters.
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
I was testing with the above code in a demo database where i just modified a record using SQL Management Studio (changed the "Search Description" on an Item to include a lower case character), and was not able to get it to work, it would complain about that one record when it ran the 'UNTIL RRRec.NEXT = 0' line of code which was retrieving the broken record. So no "strange" characters were stopping it from working, it was just a lowercase value in a code field.
I turned on the debugger and noticed that it had at least loaded the first couple of values into the RecordRef variable, however it still contained the values from the previous record in the "Search Description" field, and if my memory is correct, all other fields after the "Search Description' were from the previous record.
:?: