Navision 4 Dataports Question
dkajfes
Member Posts: 7
Hello to everyone,
I have a client who has been using Navision 4 for approx 18months now.
I need to create a dataport to export information from the sales invoice line table and the sales invoice header table.
The dataport needs to export invoices in the range the user selects to a text file to be imported by their EDI software.
I am aware that i can't indent using standard dataports.
The issue i face is that i need all the information for an invoice on one line.
ie. Header info, followed by line info
The header info is repeated for each line if there is more than one item on the invoice. (the edi program will use the header info to group the lines together back onto an electronic invoice)
Is there a way to do this using dataports?
I am not very familiar with Cside porgramming, but do have some basic understanding. The client has not paid for the programming module.
Can i add code in the C/AL editor under the SalesInvoiceLine dataitem to get the data from the SalesInvoiceHeader table and put the data into variables, then write the variables out as a dataport field?
How would i code this?
Thanks for your help.[/b]
I have a client who has been using Navision 4 for approx 18months now.
I need to create a dataport to export information from the sales invoice line table and the sales invoice header table.
The dataport needs to export invoices in the range the user selects to a text file to be imported by their EDI software.
I am aware that i can't indent using standard dataports.
The issue i face is that i need all the information for an invoice on one line.
ie. Header info, followed by line info
The header info is repeated for each line if there is more than one item on the invoice. (the edi program will use the header info to group the lines together back onto an electronic invoice)
Is there a way to do this using dataports?
I am not very familiar with Cside porgramming, but do have some basic understanding. The client has not paid for the programming module.
Can i add code in the C/AL editor under the SalesInvoiceLine dataitem to get the data from the SalesInvoiceHeader table and put the data into variables, then write the variables out as a dataport field?
How would i code this?
Thanks for your help.[/b]
0
Answers
-
You'd have to:
1 - sort the line dataitem by document number (which is part of the primary key)
2 - every time that the document number changes, you get the associated header, and you move the values you need into global variables, although it might work to reference fields of a record variable (haven't tried that one yet)
You program this in the OnBeforeExport trigger of the line.0 -
DenSter wrote:You'd have to:
1 - sort the line dataitem by document number (which is part of the primary key)
2 - every time that the document number changes, you get the associated header, and you move the values you need into global variables, although it might work to reference fields of a record variable (haven't tried that one yet)
You program this in the OnBeforeExport trigger of the line.
Thanks. This is where i get stuck. I have limited knowledge of C\Side programming.
How do i move the values into global variables?
Do i use the Get function (how do i grab the actual values)
ie myvariable := ???????
Thanks0 -
Using the salesInvline as the dataitem. it would some thing like this.
Example Variables:
SalesInvHeader - Record - Sales Invoice Header
vName - Text - 60
vAddress - Text - 60
vCity - Text - 60
vZipCode - Text - 60
(you can add which ever fields you need to get)SalesInvHeader.Get("Document No."); vName := SalesInvHeader.Name; vAddress := SalesInvHeader.Address; vCity := SalesInvHeader.City; vZipCode - SalesInvHeader.ZipCode;
When you look at view->dataport fields
this is where you enter that variable names manually
vName
vAddress
vCity
vZipCode
and the salesinv line fields you need
There is a whole section in the application designers guide on dataports if you need additional info. It's available online or your product cd.0 -
Savatage wrote:Using the salesInvline as the dataitem. it would some thing like this.
Example Variables:
SalesInvHeader - Record - Sales Invoice Header
vName - Text - 60
vAddress - Text - 60
vCity - Text - 60
vZipCode - Text - 60
(you can add which ever fields you need to get)SalesInvHeader.Get("Document No."); vName := SalesInvHeader.Name; vAddress := SalesInvHeader.Address; vCity := SalesInvHeader.City; vZipCode - SalesInvHeader.ZipCode;
When you look at view->dataport fields
this is where you enter that variable names manually
vName
vAddress
vCity
vZipCode
and the salesinv line fields you need
There is a whole section in the application designers guide on dataports if you need additional info. It's available online or your product cd.
Thanks Mate, you are a legend. Works perfectly.0 -
Glad to help - please put [Solved] in the orig post topic0
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
