I tried to create a dataport from two tables and export the data. I indent ed the second table (Drop Shipment) and doing the dataitem link with the first table(Sales Header), but the system gives an error. What I need to fo is to filter out the sales order in which the shipping date is not today and take all the data from the other table Drop shippment, in which the sales order no has relationship with No of Sales Header. Any hint? Thanks!
0
Comments
Initially MS was tried to implement this but then they changed their mind and implemented xmlports.
I would write a Codeunit to create a file and write all the needed data.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
You will have to add code on the second dataitem in the OnPreDataItem trigger of the Drop Shipment
You cannot indent DataItems in a Dataport.
Albert
Here is what I am going to do on this and I don't know if it works.
Drop Shipment( firstData Item) Since I need to export the fields from this Table.
Sales Header(Second Dataitem) Since I need to filter out those records in which the shipment date is not today, no fields will be exported from this table.
So based on Albertvh' advice, I will the code this in Drop Shipment:
"Sales Header".COPYFILTER("No.","Order No.");
I need to add another two lines as I want to filter out those records from Drop Shipment in which the shipment is not today:
If "Sales Header". shipdate <>0D then
currDataport.skip;
But it seems that these two lines don't work.
There is no shipment date in Sales Header table and that's why I want to link this table with Sales Header table. If copyfilter funtion has the same effect of dataitem link, perhaps it works. If it doesn't, how to filter out those records from Drop Shipment, in which shipment date is not today? Appreciate it!
Ok if you are not going to be exporting any fields from the sales header then I suggest you do this
1) Only one DataItem Drop Shipment
2) OnBeforeExportRecord
Hope this helps.
Albert
IF ("sales header"."Ship to Customer Date" <> TODAY) THEN
CurrDataport.SKIP;
and then export, no record was exported. Any suggestions? Thanks!
http://www.mibuso.com/forum/viewtopic.p ... highlight=
i essentially turned a report into a dataport. it lets me indent and get the data out that i needed. i've used this trick half a dozen times already.
good luck!
I created a report indenting data items as needed, and defined variable values throughout. for the dataitem line i wanted to finally output (all variable values defined), i added the following code to the OnAfterGetRecord trigger. note that you have to manually build the flat file and the delimiters (**|** in my case).
i admittedly created a lot of variables where i could have just referenced the field data itself, but whatever...
the EDIOutstream variable is a global of type Outstream. i also had to do some other stuff with defining the filepath to create, etc. all learned from searching this forum and looking at the intrastat report for hints and structure.
My answer is the same as before but add a variable
SalesHeader datatype record subrtpe Sales Header
in the BeforeExport Trigger
Albert