web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Ax2012 Street address

(0) ShareShare
ReportReport
Posted on by

Hi there,  

I have a problem with the 2012 address format.  I need to create a flat file which I did using the textio class.

When I add the street field (salestable.deliveryAddress().street) to the write list it appears to have a CR LF on the end of it so my flat file wraps over 2 lines instead of being a long single line.

Is there any way I can strip the line feed from the street field?

Many thanks in anticipation

Paulina

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Community Member Profile Picture
    on at

    This may be happening due to '\n' character in street test

    you need to remove it before you write it to the text file

    you can use method strRem(str1, str2) before you write the street value to the test file

    str1 = salestable.deliveryAddress().street

    str2 = '\n'

    Please verify and let us know if it helps you

  • Suggested answer
    Martin Dráb Profile Picture
    239,084 Most Valuable Professional on at

    CSV typically can contain new line characters if the value is enclosed in double quotes. See section 2.5 in RFC4180. In that case, a single CSV record can take more than one line.

    Nevertheless if you don't want it, you can remove line breaks with strRem().

  • Suggested answer
    Denis Macchinetti Profile Picture
    16,444 on at

    Hi Paulina

    You can also use the "strRemoveCr" global method, like :

    TextIo.Write( strRemoveCr( salestable.deliveryAddress().street );

    That's it!

  • Community Member Profile Picture
    on at

    Thanks for your reply

    Interestingly I had tried this but it didn't do it.  I used the statement

    str daddress ;

    daddress = strRemoveCr(salesTable.deliveryaddress().street);

    and then used daddress in the write statement but still had the text wrap to a second line.

    As there is no documentation I could find about the StrRemoveCR function I assumed it was for another purpose.

    Paulina

  • Denis Macchinetti Profile Picture
    16,444 on at

    Hi Paulina

    Is very strange that StrRemoveCr doesn't work.

    Below the code involve. Is a static method of the Global Class.

    I have try on my local env and work fine.

    static str strRemoveCr(str s)

    {

       return strReplace(s, '\n', ' ');

    }

  • Martin Dráb Profile Picture
    239,084 Most Valuable Professional on at

    I'm confused, because the last issue hasn't been solved but the question is marked as answered.

    If you still have the problem, try replacing \r\n instead of \n alone. I think this is the problem.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Basit Profile Picture

Basit 1

#1
GL-01081504-0 Profile Picture

GL-01081504-0 1

#1
Roya Profile Picture

Roya 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans