web
You’re offline. This is a read only version of the page.
close
Skip to main content
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)
  • Martin Dráb Profile Picture
    235,814 Most Valuable Professional on at
    RE: Ax2012 Street address

    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.

  • Denis Macchinetti Profile Picture
    16,444 on at
    RE: Ax2012 Street address

    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', ' ');

    }

  • Community Member Profile Picture
    on at
    RE: Ax2012 Street address

    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

  • Suggested answer
    Denis Macchinetti Profile Picture
    16,444 on at
    RE: Ax2012 Street address

    Hi Paulina

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

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

    That's it!

  • Suggested answer
    Martin Dráb Profile Picture
    235,814 Most Valuable Professional on at
    RE: Ax2012 Street address

    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().

  • Verified answer
    Community Member Profile Picture
    on at
    RE: Ax2012 Street address

    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

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Mansi Soni – Community Spotlight

We are honored to recognize Mansi Soni as our August 2025 Community…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Syed Haris Shah Profile Picture

Syed Haris Shah 9

#2
Mea_ Profile Picture

Mea_ 4

#3
KP-31070522-0 Profile Picture

KP-31070522-0 3

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans