RecRef and CompanyName

crisnicolas
Member Posts: 177
A RecRef variable can be opened with an optional parameter called CompanyName
RecordRef.OPEN(No[, Temp][, CompanyName])
NAV help for this function says: If you use the CompanyName parameter, then this function works the same as the CHANGECOMPANY Function (Record).
I'm using this on my code, but RecRef always points to the current company.
Has anyone experienced that?
I'm on NAV 2009 R2 (6.00.32012)
thanks
RecordRef.OPEN(No[, Temp][, CompanyName])
NAV help for this function says: If you use the CompanyName parameter, then this function works the same as the CHANGECOMPANY Function (Record).
I'm using this on my code, but RecRef always points to the current company.
IF Company.FINDSET THEN REPEAT T3.INIT; T3.Code := COPYSTR(Company.Name,1,10); RecRef2.GETTABLE(T3); RecRef.OPEN(3,FALSE,Company.Name); RecRef := RecRef2; RecRef.INSERT; RecRef.CLOSE; UNTIL Company.NEXT = 0;Notice that this code is only for testing purposes. All records get inserted on the same company, instead of in different companies.
Has anyone experienced that?
I'm on NAV 2009 R2 (6.00.32012)
thanks
0
Answers
-
I didn't check it but I suppose your problem is related to this line:
RecRef := RecRef2;
"Money is likewise the greatest chance and the greatest scourge of mankind."0 -
Yes it is... thank you...
With this assignation, recref points to the same recref2 was pointing (including the company).
How can I assign the whole record from a RecRef to another one, and change the company afterwards, or copy just the values, or...
I tried
RecRef := RecRef2.DUPLICATE;
But not working0 -
Take a look at this post on DUG: http://dynamicsuser.net/forums/t/25130.aspx"Money is likewise the greatest chance and the greatest scourge of mankind."0
-
Thank you0
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