I'm using xml port to import file that has | as a seperator and obviously without success. Anyone that know's about a workaround other than changing the file. I can import this if I change the file to a Tab delimited file.
Are you running it on RTC or classic? XMLPort can be used for other type of files but only on RTC not in classic. In classic it can only be used for xml files.
Ahmed Rashed Amini
Independent Consultant/Developer
Are you running it on RTC or classic? XMLPort can be used for other type of files but only on RTC not in classic. In classic it can only be used for xml files.
Are you shure about this. Isn't it possible to run a xml port through code units called from f.eks. application server that would import or export flexible text file.
I have a question for Microsoft - I hope one of their people is monitoring this.
If dataports are going away in version 7, then how will we handle text file imports using Navision Application Server (NAS) if NAS does not support using xmlports for text file imports?
Does Microsoft plan to add this capability or will NAS be replaced by another 3 tier client for handling background batch processing?
Or is this "Whoops - this never occurred to us?"
I have a question for Microsoft - I hope one of their people is monitoring this.
If dataports are going away in version 7, then how will we handle text file imports using Navision Application Server (NAS) if NAS does not support using xmlports for text file imports?
Does Microsoft plan to add this capability or will NAS be replaced by another 3 tier client for handling background batch processing?
Or is this "Whoops - this never occurred to us?"
You connot run dataport on NAS.
Ahmed Rashed Amini
Independent Consultant/Developer
As I have just found, you can import a flat file with XMLPort in RTC... but only, apparently, in RTC. That is, running my XMLPort in 2009 Classic gets a 'format error, column 1 line 1', but it works properly in RTC.
Heres how it's working for me: I'm importing this flat file into Payroll Journal Lines:
Here are the corresponding lines in my dataport grid:
Node Name Node Type Source Type Data Source
Root Element Text <Root>
PayrollJournalLine Element Table <Payroll Journal Line>(Payroll Journal Line)
JournalTemplateName Element Field <Payroll Journal Line>::Journal Template Name
LineNo Element Field <Payroll Journal Line>::Line No.
EmployeeNo Element Field <Payroll Journal Line>::Employee No.
PostingDate Element Field <Payroll Journal Line>::Posting Date
DocumentType Element Field <Payroll Journal Line>::Document Type
Description Element Field <Payroll Journal Line>::Description
PayPeriodEndDate Element Field <Payroll Journal Line>::Pay Period End Date
PayCycleCode Element Field <Payroll Journal Line>::Pay Cycle Code]
PayrollPostingGroup Element Field <Payroll Journal Line>::Payroll Posting Group
HoursMinutes Element Field <Payroll Journal Line>::Hours.Minutes
....
No global or local variables are needed. In the XMLPort properties set "Format" to "Variable Text". I have "field separator" as <,>; for pipe-separated I assume you'd substitute <|>.
I'm still hoping for an answer here on how to work with these variables in code triggers, but this ought to get you started. Remember, run it from the RTC. You can use a codeunit or call it directly from a page action, setting the RunObject propery of the action to the name of your XMLPort.
No global or local variables are needed. In the XMLPort properties set "Format" to "Variable Text". I have "field separator" as <,>; for pipe-separated I assume you'd substitute <|>.
That's the way to go, except from the <|> as a value for the "field seperator" Property. If you change a Property value to something other then std. you never use the < and > signs (exception is the <none> statement). So it's: "Field Seperator" : |
Comments
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Are you shure about this. Isn't it possible to run a xml port through code units called from f.eks. application server that would import or export flexible text file.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
If dataports are going away in version 7, then how will we handle text file imports using Navision Application Server (NAS) if NAS does not support using xmlports for text file imports?
Does Microsoft plan to add this capability or will NAS be replaced by another 3 tier client for handling background batch processing?
Or is this "Whoops - this never occurred to us?"
http://mibuso.com/blogs/davidmachanick/
You connot run dataport on NAS.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Heres how it's working for me: I'm importing this flat file into Payroll Journal Lines:
"PAYROLL","10000","11",11/30/2010,"Payment","Regular Hours",11/30/2010,"WEEKNEW","DRIVERS","25.49"....
"PAYROLL","20000","139",11/30/2010,"Payment","Regular Hours",11/30/2010,"WEEKNEW","PRODUCTIN","29.011"....
"PAYROLL","30000","14",11/30/2010,"Payment","Regular Hours",11/30/2010,"WEEKNEW","SUPERV","30.18"....
"PAYROLL","40000","170",11/30/2010,"Payment","Regular Hours",11/30/2010,"WEEKNEW","DRIVERS","40.00"....
"PAYROLL","50000","170",11/30/2010,"Payment","Overtime Hours",11/30/2010,"WEEKNEW","DRIVERS","01.37"....
"PAYROLL","60000","18",11/30/2010,"Payment","Regular Hours",11/30/2010,"WEEKNEW","MECH","36.18"....
Here are the corresponding lines in my dataport grid:
No global or local variables are needed. In the XMLPort properties set "Format" to "Variable Text". I have "field separator" as <,>; for pipe-separated I assume you'd substitute <|>.
I'm still hoping for an answer here on how to work with these variables in code triggers, but this ought to get you started. Remember, run it from the RTC. You can use a codeunit or call it directly from a page action, setting the RunObject propery of the action to the name of your XMLPort.
Good luck...
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n