Use an Object by reference?

foreverblue80
Member Posts: 11
Hi,
I don't remembered if is possible to run a Object by reference and call the object's function?
For example: I am write a process report to import and process data. Report calls different XMLPort based on a setup table. The underline table for XMLPort is a temporary table and I have function to pass the record out. I am use XMLPort.IMPORT("XMLPort No.", InStream), but I can't call the function to get the record back in the process report. In the future, if there is a new format of text file, all I need to do is create a new XMLPort and update setup table. I don't want to create new xmlport variables in the report.
Thank you,
I don't remembered if is possible to run a Object by reference and call the object's function?
For example: I am write a process report to import and process data. Report calls different XMLPort based on a setup table. The underline table for XMLPort is a temporary table and I have function to pass the record out. I am use XMLPort.IMPORT("XMLPort No.", InStream), but I can't call the function to get the record back in the process report. In the future, if there is a new format of text file, all I need to do is create a new XMLPort and update setup table. I don't want to create new xmlport variables in the report.
Thank you,
0
Answers
-
If it is a temp table, store it in a single instance codeunit onpostxmlport. Get the content of the table from the cu after the XMLport is run.0
-
I don't think I have the same instance after xmlport is run.
XMLPort.IMPORT(50000, InStream);
After this line, the instance is gone.0 -
BTW, I don't have development license. Everything I do is in Report and XMLPort.0
-
> @foreverblue80 said:
> BTW, I don't have development license. Everything I do is in Report and XMLPort.
In that case.. my suggestion is not the solution.0 -
@TallyHo
Could you show me how would you write it? Maybe I take the idea and modify it. I am using process report like codeunit.
Currently my program is process report on the page. The process report will call different xmlport based on a setup table to import different format of files.
0 -
I'm sorry, my idea is only possible using a codeunit. Only a codeunit has the 'SingleInstance' property. If you activate this, the instance of your temp rec can be saved in this codeunit, not only during runtime of your process, but during the whole current active NAV session.0
-
I totally forgot about that. lets see if I can borrow license from my ex-coworker. LOL. Thanks.
I wish Nav can reference any Objects like RecordRef and FieldRef to tables.0 -
You're welcome, good luck with it!0
-
I have the program done, but would like to refine it. I just don't like import, process data, and save to a real table in the xmlport. More than 70% of coding is been duplicate every time I create a new xmlport.0
-
Do you have the XML Buffer table in your version, maybe that can help.
https://community.dynamics.com/nav/b/olofsimrendynamicsnavblog/archive/2017/03/27/xml-buffer-and-csv-buffer-tablesFollow me on my blog juhl.blog0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K 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
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions