Dataport using two dataitems
shweta
Member Posts: 94
I am using two data items sales invoice header and sales invoice line when i indent sales invoice line and give the linking It is giving an error.
how I can do it
ITS URGENT
how I can do it
ITS URGENT
0
Comments
-
I don't know what to do if you don't post your error message."Money is likewise the greatest chance and the greatest scourge of mankind."0
-
Linking in Dataports are only for UPXML format (<4.03).
Take a look in OnlineHelp (C/SIDE Reference Guide)
RegardsDo you make it right, it works too!0 -
This is message about..if you want to use indenting then choose FileFormat - UpXml.
This is old message - in Nav 5/4Sp3 you can't even select this type of fileformat in property. XmlPort is designed for that.0 -
einsTeIn.NET wrote:I don't know what to do if you don't post your error message.
"you have indented data items but the file format is not UPXML for more information see the C/SIDE reference guide."
this error i got0 -
if you need to export a datastructure, use XMLPORT.
RegardsDo you make it right, it works too!0 -
are you trying to import or export or both? It can be done without linking them too.0
-
Sorry, I didn't see that you want to intend sales invoice line. The answer is already given by the other posters.shweta wrote:einsTeIn.NET wrote:I don't know what to do if you don't post your error message.
"you have indented data items but the file format is not UPXML for more information see the C/SIDE reference guide."
this error i got"Money is likewise the greatest chance and the greatest scourge of mankind."0 -
I think he just meant that you can have two different data items in a dataport (e.g. for Sales Header and Sales Line), but without indentation, and without any link between them.
So you can use filters to export only some specific Sales Headers, but (without coding) there’s no way to get just the Sales Lines for those headers.
For example, you can export all Sales Headers with Status = Open, but (without coding) you can’t export just the Sales Lines for open Sales Headers.
One way to set up such a link is with a temporary Sales Header table. Insert a record for each Sales Header that you export; then when exporting Sales Lines, check that there is a record in the temp table with the same Document Type and Document No.Alastair Farrugia0 -
thanks a lot,
but i want data in form of like.
sales header doc1
sales line doc1 line 1
doc1 line 2
sales header doc2
sales line doc2 line 1
doc2 line 2
i think that's can only possible with indent.0 -
Yes, that would require indentation.
This is not supported in dataports, because dataports export only the field values, without explicitly saying which table the data is from.Alastair Farrugia0 -
vijay_g wrote:thanks a lot,
but i want data in form of like.
sales header doc1
sales line doc1 line 1
doc1 line 2
sales header doc2
sales line doc2 line 1
doc2 line 2
i think that's can only possible with indent.
There is another way to do this without indentation which I've used in importing data from external sources, where the file is in header/line/line, header/line/line format. It requires some extra coding, and depends on whether you can tell from a specific field whether an input line is a header or a line item. Here's the basic flow:
1. Use the Integer table as your data item.
2. You have to set up your dataport to input all fields as text. Create fields F1, F2, F3, F4, etc. all as text fields, making them as long as the longest possible value.
3. Now, look at the field that tells you if it's a header or a line. As an example, let's say that the first field F1 has a value of HDR if it is a header and LIN if it is a line item. In your code, you have
IF F1 = HDR THEN
CreateSalesHeader
ELSE
CreateSalesLine
4. Now build 2 functions "CreateSalesHeader" and "CreateSalesLine", converting fields to numeric or date if necessary. Here's a short boilerplate for Header
SalesHeader.INIT;
SalesHeader."Document Type" := SalesHeader."Document Type"::Order;
SalesHeader."No." := F2; // Assuming field 2 is order number. You can also assign an order number by calling the appropriate No. Series commands
SalesHeader.VALIDATE("Sell-to Customer No.", F3); // Assuming field 3 is customer No.
SalesHeader.VALIDATE("Posting Date", DMY2DATE(COPYSTR(F4,4,2), COPYSTR(F4,1,2),COPYSTR(F4,7,4)); // Assuming field 3 is date in format MM/DD/YYYY
... etc.
SalesHeader.INSERT;
Numeric fields like Price or Quantity in the input file should be stored without commas or currency signs, or otherwise they will have to be stripped out in your code. If it is a straight numeric, then you can use the EVALUATE function, e.g.
OK := SalesLine.EVALUATE("Quantity", F11);
Hope this gives you some ideas...Ron0 -
thank you very much....
looking typical but i have to try with this procedure.
again thanx0 -
you can use a temporary table in the fisrt dataitem to insert all the filtered records then in the next dataitem on the beforeexport trigger use a conditional ie. if not tableTMP.get(....) then skip;0
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
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 253 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