Skip to main content

Notifications

Microsoft Dynamics NAV (Archived)

NAV 2013 transferfields function

Posted on by Microsoft Employee

I have posted this as a support issue to Microsoft, but would be interested to hear if anyone else has experienced similar problems with Transferfields or other database-related C/AL Commands.

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;

*This post is locked for comments

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,240 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans