NAV 2013 R2 Changecompany is not working
connamics
Member Posts: 11
Hello together,
we made a Upgrade from NAV 2009 R2 to Nav 2013 R2 everything is working, but i try to test our individual Client Programmins. In this Function we Copy Records from one Company to another. For this we use the Standard Function CHANGECOMPANY and Transferfields. The function is calling from the System, i tracked it step by step over the Debugger, but in the Destination Company nothing is inserted.
??????
Has anybody more Information regarding the Function CHANGECOMPANY() in NAV 2013 R2 ?
we made a Upgrade from NAV 2009 R2 to Nav 2013 R2 everything is working, but i try to test our individual Client Programmins. In this Function we Copy Records from one Company to another. For this we use the Standard Function CHANGECOMPANY and Transferfields. The function is calling from the System, i tracked it step by step over the Debugger, but in the Destination Company nothing is inserted.
??????
Has anybody more Information regarding the Function CHANGECOMPANY() in NAV 2013 R2 ?
0
Comments
-
Hi,
I have just tested the CHANGECOMPANY at NAV 2013 R2, by a simple code copying a customer from one Company til another, and it Works fine.
Customer_loc.CHANGECOMPANY('CRONUS TRIMIT 2013 Test BASIS');
Customer_loc := Rec;
Customer_loc.INSERT;
MESSAGE('Copied.');0 -
Is your environment single or multiple tenant? In case of multiple, are both companies in the same tenant?
Did you try using the boolean return value as a check?* Daniele Rebussi * | * Rebu NAV Diary *0 -
Hello together,
thanks for your tests and answer. I found the Problem.
CustomerRec.Changecompany(Companyname);
CustomerRec.Transferfields(Rec);
IF NOT CustomerRec.INSERT THEN
CustomerRec.MODIFY;
This Code are not working. The last 2 Lines.0 -
Why are you using transferfields? There have been problems reported with transferfields in the past.
The recommendation you received was to make newrec:=Rec.
Seems nice and simple.David Machanick
http://mibuso.com/blogs/davidmachanick/0 -
Thanks everybody.
@BlackTiger
CustomerRec.CHANGECOMPANY(Companyname);
The Variable Companyname is a Parameter from the Funkction.0 -
Just for anyone who comes across this thread while looking for this error like I was.
TRANSFERFIELDS used with CHANGECOMPANY appears to be a problem in 2015, but not 2009. If you use TRANSFERFIELDS with the second parametre set to FALSE, the problem goes away.
Why this is I do not know, but there is clearly some difference between how 2009 and 2015 respond to the TIMESTAMP field in SQL at the time of MODIFY. Adding the FALSE parameter seems to work so I am now doing this in my code base - I just hope there are no consequences of this not detailed in the manual
0
Categories
- All Categories
- 75 General
- 75 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K 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
- 610 NAV Courses, Exams & Certification
- 1.9K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 251 Dynamics CRM
- 103 Dynamics GP
- 6 Dynamics SL
- 1.5K Other
- 991 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 28 Design Patterns (General & Best Practices)
- Architectural Patterns
- 9 Design Patterns
- 4 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1K General Chat
- 1.6K Website
- 77 Testing
- 1.2K Download section
- 23 How Tos section
- 249 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions
