Discussions
Activity
Best Of...
Sign In
·
Register
Home
›
NAV/Navision Classic Client
Howdy, Stranger!
It looks like you're new here. Sign in or register to get started.
Sign In
Register
Quick Links
Categories
Recent Discussions
Activity
Best Of...
Unanswered
Categories
All Categories
73
General
73
Announcements
66.6K
Microsoft Dynamics NAV
18.6K
NAV Three Tier
38.4K
NAV/Navision Classic Client
3.6K
Navision Attain
2.4K
Navision Financials
115
Navision DOS
854
Navision e-Commerce
1K
NAV Tips & Tricks
772
NAV Dutch speaking only
615
NAV Courses, Exams & Certification
2K
Microsoft Dynamics-Other
1.5K
Dynamics AX
295
Dynamics CRM
109
Dynamics GP
10
Dynamics SL
1.5K
Other
993
SQL General
384
SQL Performance
34
SQL Tips & Tricks
34
Design Patterns (General & Best Practices)
Architectural Patterns
10
Design Patterns
5
Implementation Patterns
53
3rd Party Products, Services & Events
1.7K
General
1.1K
General Chat
1.6K
Website
79
Testing
1.2K
Download section
23
How Tos section
259
Feedback
12
NAV TechDays 2013 Sessions
13
NAV TechDays 2012 Sessions
How to copy a NAV Record to an ADO Record
MatteoSp
Member
Posts:
4
2009-09-29
edited 2009-09-29
in
NAV/Navision Classic Client
In Navision 5, i need to copy all fields of a Navision record to a new ADO Record?
Is there a way to do this in a generic way?
thanks
m.
0
Comments
ara3n
Member
Posts:
9,256
2009-09-29
you can create a sql query with a select statement.
Select the Nav table you need to view.
The return will be a record set.
Ahmed Rashed Amini
Independent Consultant/Developer
blog:
https://dynamicsuser.net/nav/b/ara3n
0
MatteoSp
Member
Posts:
4
2009-09-29
many thanks, but consider this:
1) I need the generic way, so: is there a way to extract the table name from the NAV record?
2) When the data does not yet exist (for example when I'm about to insert the record), I still need to copy values
from the NAV record to the ADO record.
thanks again
m.
0
ara3n
Member
Posts:
9,256
2009-09-29
you will need to loop through the NAV record and insert them one record a time.
NAVRecord.findset;
repeat
ADOCommand.execute('
Insert INTO SQL TABLE
(FIELD1,FIELD2)
VALUES
('+ NAVRecord.field1 + ','+ NAVRecord.Field2 + ')';
until NAVRecord.next = 0;
ADO is build around string and that is what you can pass back.
Ahmed Rashed Amini
Independent Consultant/Developer
blog:
https://dynamicsuser.net/nav/b/ara3n
0
MBerger
Member
Posts:
413
2009-09-29
Take a look into Recordrefs and Fieldrefs....they work a bit like ADO recordsets, making you able to loop through a NAV record.
0
MatteoSp
Member
Posts:
4
2009-09-29
do you now where I can find some (good) docs about Recordrefs and Fieldrefs?
0
Sign In
or
Register
to comment.
Comments
Select the Nav table you need to view.
The return will be a record set.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
1) I need the generic way, so: is there a way to extract the table name from the NAV record?
2) When the data does not yet exist (for example when I'm about to insert the record), I still need to copy values
from the NAV record to the ADO record.
thanks again
m.
NAVRecord.findset;
repeat
ADOCommand.execute('
Insert INTO SQL TABLE
(FIELD1,FIELD2)
VALUES
('+ NAVRecord.field1 + ','+ NAVRecord.Field2 + ')';
until NAVRecord.next = 0;
ADO is build around string and that is what you can pass back.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n