Hi Guys,
Just a quick question, I wish to use an action (controlled by the press of a button) to extract information from a page then run a file.
I wish to extract the contents of the <No.> field on a page and write this information to an external text file. Is this possible? Does anyone have an example chunk of C/AL code that might do the job? It doesn't have to be pretty
<Action71> - OnAction()
_____________________________________________________
CODE TO EXTRACT THE CONTENTS OF THE<NO.> FIELD
CODE TO RUN AN EXTERNAL EXECUTABLE
_____________________________________________________
Many thanks as always
0
Comments
Have you some experince in NAV development?
If yes, I expect that you know how to work with variables/records/fields. If you want to run some external app, depends if you are using 2009 R2 or not. You can use the Automation for that or DotNet libraries.
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
Very simply:
CLEAR(MyFile);
MyFile.TEXTMODE(TRUE);
MyFile.WRITEMODE(TRUE);
MyFile.CREATE('c:\temp\nav.txt');
MyFile.WRITE('testing 123');
MyFile.CLOSE();
This CODEUNIT is underneath a button on my Purchase Invoice Page which works fine, this example writes the text file which contains testing 123.
Instead of testing 123, what would be the correct syntax to extract THIS field to the text file so it contains 1006 /or whatever number is in that field. I need to use this CODEUNIT throughout which must always output the number in the No. field.
Life saver whoever can tell me, I'm stumped!
Page is a class, actual instance of the page is object, codeunit is another class, when calling it it is some instance of this class. You cannot read the value from the page withint the codeunit if the codeunit have no clue how to access the page, you can only push the values from page into the codeunit, you cannot pull them from within the codeunit...
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.