Link to home
Start Free TrialLog in
Avatar of Marius0188
Marius0188

asked on

Dynamics AX - Tab Delimited File

Dear Experts,

I am requested to build a small job that will output some dataset values based on a CustAccount and a Date Range to a tab delimited text file.

I got as far as to create the form, add all my controls to the form:
DateFrom, DateTo, CustAccount and a Button.

On the Button'c clicked method I assume I should implement my code for this.
Please advise and also show me an example on how to retrieve lines from CustInvoiceTrans based on the form input and write these lines to a TAB delimited text file.

Your help appreciated. :)
ASKER CERTIFIED SOLUTION
Avatar of Valeri
Valeri
Flag of Bulgaria image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
>> custLine must be of type String custLine = data1 + "\t" + data2 + "\t" + data3 + "\t";
it should be
String custLine = new StringBuilder(data1).append("\t").append(data2).append("\t").append(data3).toString());
without the last "\t" as well.
Avatar of Marius0188
Marius0188

ASKER

Ok I will give this a try.
Not sure if I need a new question for this but let me try:

In the same project as above.
I want to run my code on the Button clicked method.
How do I reference the StringEdit controls on my form from within the clicked method?

Please show example.

Thanks.
Is it web app or something else?
What is "StringEdit controls"? <textarea></textarea> ? or something else?
If it is <textarea name="MyTextArea"></textarea>, when you click on Button and submit the form, read the content of this textarea in this way :
String myTextAreaText = request.getParameter("MyTextArea");
If it's already tab delimited then it's your "custLine" from msg 33627133.
Nope not a webapp, in MS Dynamics AX I've added a form and added control to the form.
The control type is a StringEdit.


Hi Marius0188, what version of AX are you using?

In AX 4.0 or later you can set the AutoDeclaration property of the control to true
and then you can get/set the control's value like this:

info(StringEdit.text());
StringEdit.text("ABC");

For exporting data to a CSV file you can use the AsciIo class.