Given the questions you currently ask in other threads as well, this might be a bit heavy for you at the moment.
Generally, you should search for similar tasks handled in standard NAV already and learn from those existing objects. In this case I suggest you start by analyzing XMLPort 99008514 and how it is used.
Basically, the external data is read into staging tables, then checked and finally processed.
Always make sure you validate the data when filling it into tables used by NAV's business logic.
Never import into tables that only are populated while posting/registering. If your data needs to go there, always fill in source documents or journal lines and post or register them.
then use virtual table integer as dataitem in your report
then open the textfile in trigger onprereport in read mode.
for details follow my answer in http://forum.mibuso.com/discussion/67184/import-text-file
read the lines in onaftergetrecord trigger
there parse line, create purchase invoice
stop import when file.read gives 0
best regards
Franz Kalchmair, MVP
Alias: Jonathan Archer
Answers
Generally, you should search for similar tasks handled in standard NAV already and learn from those existing objects. In this case I suggest you start by analyzing XMLPort 99008514 and how it is used.
Basically, the external data is read into staging tables, then checked and finally processed.
Always make sure you validate the data when filling it into tables used by NAV's business logic.
Never import into tables that only are populated while posting/registering. If your data needs to go there, always fill in source documents or journal lines and post or register them.
purchase header
purchase line
for details follow
https://m.youtube.com/watch?v=UFnOHQ8VOSY
http://navguides.blogspot.co.at/2013/07/create-dataport.html
https://msdn.microsoft.com/en-us/library/dd339001.aspx
Franz Kalchmair, MVP
Alias: Jonathan Archer
please like / agree / verify my answer, if it was helpful for you. thx.
Blog: http://moxie4nav.wordpress.com/
No I want to to use reports not data ports.
then open the textfile in trigger onprereport in read mode.
for details follow my answer in http://forum.mibuso.com/discussion/67184/import-text-file
read the lines in onaftergetrecord trigger
there parse line, create purchase invoice
stop import when file.read gives 0
Franz Kalchmair, MVP
Alias: Jonathan Archer
please like / agree / verify my answer, if it was helpful for you. thx.
Blog: http://moxie4nav.wordpress.com/
Can you elaborate more.plz its very urgent form me