Creating dataports with multiple tables

ebednez
Member Posts: 22
Can a dataport be created using multiple tables? Also, is there any good ducmentation on the subject? An example would be the Sales Shipment Header table and the customer table. I would want to export shipment information but include the customer name by linking the customer number in both tables.
Thanks,
Ed
Thanks,
Ed
0
Comments
-
The Sales Shipment Header already contains a field called "Name" which contains the customer name.
FYI..
if you are familiar with GET'S
Using just the Sales Shipment Header as a dataitem......
you could use a get like Customer.GET("Sell-to Customer No.");
then assign a variable to the field you want to export
PaymentTerms := Customer."Payment Terms Code";
then put the variable name in the dataport field list to export.
I haven't tried it but it sounds good on paper0 -
note: the Application Designers Guide has a whole section on Dataports.
It can be found on the product cd.0 -
I have a dataport that does that. I needed one a while back that let me do wildcard filtering on Item Category Code because I had a lot of categories that were similar but too large to specify using the normal method (drop-down linked to Item Category Code table).
I ended up creating a dataport on table Item Ledger Entries and using Customer.GET("Source No.") in the OnBeforeExportRecord() trigger to get my customer record details so I could have them in my CSV output along with all of the individual details I needed about their purchases for another project partner client doing promotions.
So when running my dataport I simply used whatever filters I needed at run-time.
FYI if you're not familiar with this you can get the related data you need by specifying a Global Variable Name:Customer, Type:Record, Table:Customer
Create global variables for the data you wish to GET from the customer record accordingly:
CustomerName
CustomerAddress
etc...
Then under OnBeforeExportRecord you would add:Customer.GET("Source No."); CustomerName := Customer.Name; CustomerAddress := Customer.Address;
etc...
Under Dataport Fields:
CustomerName
CustomerAddress
etc...
Hope this helps. I've learned a lot here since 2007, this forum has saved me many headaches. Good luck.Half-empy or half-full how do you view your database?
Thanks.0 -
Just as an addition the ILE source # can be a vendor # if type purchase & blank if positive or neg adjustment.
so just to insure no crashing you can wrap that code just a bit to stop any headaches.if Customer.GET("Source No.") then begin CustomerName := Customer.Name; CustomerAddress := Customer.Address; end;
0 -
Good idea. Never had any issues because I always apply entry type SALE and only ever made sales to customers only.
Thanks. I've modified my reports accordingly.Half-empy or half-full how do you view your database?
Thanks.0
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