I´m migratting a Nav5 Form to Nav6 CC/RTC.
When the user push a botton, the following code executes a dataport. The dataport ask th e user for a .txt file path and then import the data of the .txt file .
<Control1000000001> - OnPush()
DataPortImportN43.SetBanco("No.");
DataPortImportN43.RUNMODAL;
I read some toppics and it seems that we have 3 options:
1) Create a new report and program the code to read the txt file.
Problem: (To much hours programming, and 1 new report object).
2) Create a new report, without layout, ask the file path in the requestform and program to execute the existing dataport.
Problem: (1 new report object, works in RTC and CC????).
LInk founded:
http://www.dynamicsblog.at/index.php/20 ... -xml-ports
3) Create a new XmlPort that read the txtfile and import the data.
Problem: (Program or ?Convert? XmlPort , 1 new xmlPort object, What about execute in CC?, where to ask for the path?)
Do you know what is the best option? Is there another option?
Thank you very much.
Comments
I would go with xmlport option. Mainly so that I don't have to do any file handling and reading the file.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Do not forget that the XMLPort will run on Service tier, not on client PC. If the imported file is on client PC, you need to use UPLOADINTOSTREAM to read the file. This function include the open dialog automatically. It just return you the stream from which the XMLPort will read the data.
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
Do you know if this is possible and how? Thanks
Example:
Form / Page
The button of the form, and the action of the page, executes that code:
ReportImportN43.SetBank("No.");
ReportImportN43.RUNMODAL;
Report:
Report - OnPreReport()
//** How to send the var Bank2 to the dataport? I can´t declare a variable as dataport . So I can´t execute
// something like //N43DATAPORT.SetBank2(Bank2), that works in the previous versions.
DATAPORT.RUNMODAL(57100);
SetBank(Bank : Code[20])
Bank2 := Bank;
Dataport
SetBank2(Bank2 : Code[20])
BankCode := Bank2;
Is there any tool to convert Dataport to Xmlport? How to convert it?
Thanks
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n