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]
0
Answers
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.
RIS Plus, LLC
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 := ???????
Thanks
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)
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.
http://www.BiloBeauty.com
http://www.autismspeaks.org
Thanks Mate, you are a legend. Works perfectly.
http://www.BiloBeauty.com
http://www.autismspeaks.org