NAV 2013 Transferfields Function problem

stefang
Member Posts: 11
Has anyone else experienced problems with the Transferfields function in NAV 2013?
In NAV 2013, the Transferfields function does not seem to be working properly when transferring multiple records between two instances of the same table. In this case, Integer and Boolean fields are sometimes not transferred correctly but the error only occurs in tables with many fields and not for the first x fields in the table. See example code that creates this error when executed in Cronus International 7.00 W1 version, build 7.0.34082.
The three new items created by the code (1100X, 1110X and 1120X) should have "Low-Level Code" 1100,110,1120 respectively.
When the code is runned, all 3 items get "Low-Level Code" = 1100. So the Integer field "Low-Level Code" is copied from the first record for all 3 records generated by the Transferfields command.
//Example code that demonstrates a failure in the Transferfields function.
//Item1 and Item2 Global Variables of type Rec = Item
Item1.GET('1100');
Item1."Low-Level Code" := 1100;
Item1.MODIFY;
Item1.GET('1110');
Item1."Low-Level Code" := 1110;
Item1.MODIFY;
Item1.GET('1120');
Item1."Low-Level Code" := 1120;
Item1.MODIFY;
COMMIT;
Item1.SETFILTER("No.",'1100|1110|1120');
Item1.FINDSET;
REPEAT
Item2.TRANSFERFIELDS(Item1);
Item2."No." := Item2."No." + 'x';
Item2.INSERT;
UNTIL Item1.NEXT = 0;
In NAV 2013, the Transferfields function does not seem to be working properly when transferring multiple records between two instances of the same table. In this case, Integer and Boolean fields are sometimes not transferred correctly but the error only occurs in tables with many fields and not for the first x fields in the table. See example code that creates this error when executed in Cronus International 7.00 W1 version, build 7.0.34082.
The three new items created by the code (1100X, 1110X and 1120X) should have "Low-Level Code" 1100,110,1120 respectively.
When the code is runned, all 3 items get "Low-Level Code" = 1100. So the Integer field "Low-Level Code" is copied from the first record for all 3 records generated by the Transferfields command.
//Example code that demonstrates a failure in the Transferfields function.
//Item1 and Item2 Global Variables of type Rec = Item
Item1.GET('1100');
Item1."Low-Level Code" := 1100;
Item1.MODIFY;
Item1.GET('1110');
Item1."Low-Level Code" := 1110;
Item1.MODIFY;
Item1.GET('1120');
Item1."Low-Level Code" := 1120;
Item1.MODIFY;
COMMIT;
Item1.SETFILTER("No.",'1100|1110|1120');
Item1.FINDSET;
REPEAT
Item2.TRANSFERFIELDS(Item1);
Item2."No." := Item2."No." + 'x';
Item2.INSERT;
UNTIL Item1.NEXT = 0;
0
Comments
-
If you have found a verifiable bug, have you reported it to Microsoft?
Also, why not use Item2:=Item1 rather than TRANSFERFIELDS?David Machanick
http://mibuso.com/blogs/davidmachanick/0 -
Hi.
There are workarounds for this like Item2 := Item1, but in some cases that does not work because the timestamp of the record is copied as well. Another workaround seems to be clearing the variable before doing Transferfields.
There is a lot of old code out there using transferfields, thererfore these workarounds are not always practical. I have reported this to the Microsoft support site for partners.0 -
There is a known and fixed error with TRANSFERFIELD and BLOB fields. You could try to request this hotfix and see if it solves your problem:
https://mbs.microsoft.com/knowledgebase ... US;2761649Regards
Peter0 -
pdj wrote:There is a known and fixed error with TRANSFERFIELD and BLOB fields. You could try to request this hotfix and see if it solves your problem:
https://mbs.microsoft.com/knowledgebase ... US;2761649
Hi
The example provided with NAV2013 build 33781 works fine.
Bye
Matteo Montanari
PS: blob transferfields bug was reported by me to Microsoft supportReno Sistemi Navision Developer0 -
According to Microsoft, there is an error when using Transferfields for tables with BLOBS. For these tables, fields after the BLOB field are not copied. This was introduced in in one of the hotfixes 8) and will hopefully be fixed with a new hotfix.0
-
Ouch!
Thanks for letting us know.
Please update us when you get the hotfix that corrects it.David Machanick
http://mibuso.com/blogs/davidmachanick/0
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
- 322 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