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 :
Finance | Project Operations, Human Resources, ...
Answered

How to get a string more than 250 symbols

(0) ShareShare
ReportReport
Posted on by

Hello community,

I have a string data type. In documentation(https://docs.microsoft.com/en-us/dynamicsax-2012/developer/strings) said 

Size of data type

 - Dynamic or fixed length

 I thought dynamic length is the length of unlimited size. But when I try to create a string moe than 250 symbols I get a message like Maximum length is 250 symbols.

Example: str var = @"<any string more than 250 symbols>";

is this a limitation of programing language or I can disable this limitation on Axapta.

Please help to handle this issue.

I have the same question (0)
  • Martin Dráb Profile Picture
    239,035 Most Valuable Professional on at

    I'm not aware of such a limitation - I was easily able to assign many thousands of characters to a string variable in AX 2009.

    When exactly do you get the error?

  • Community Member Profile Picture
    on at

    I get this error when I'm trying copypaste a string more than 250 symbols to X++ editor.

    I get this error when I'm trying copypaste a string more than 250 symbols to X++ code editor.
    I add a class. Then I add a method. I add to the method a line:
    str val = @"<here I paste a string. Length of this string mote than 250 symbols>";
    When I'm trying to paste a string instead fhis<....> to line above I got this error.

  • Verified answer
    nmaenpaa Profile Picture
    101,166 Moderator on at

    I think the maximum length of one line of code is 250 characters in AX2009.

    But here I'm able to create a string that is longer than 250 characters:

       str myStr = "aifjahadsofhdfoasfhdofdsahfidfhdifhsifshfsifhsihsifghsifgsughidfsghsfighsfdighfgiushgsfighsfigusdhgiyvdvj sjvdjsvosjvsofjsjsogshgohgoshgfsjfosdfjsodfjsdofjsofsjdfosjfosijfosjfosfjsofjosjfsoifjsofsdjfosfjdsofsjofsjofsjodjofsjfos";
        myStr  = "aoifjollkjlkjlkjlkjlklklkjlkjlkjkjljlkjlkjlkjlkjfhoh";
        
        info(int2str(strLen(myStr)));

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 > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 659

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 465 Super User 2026 Season 1

#3
Syed Haris Shah Profile Picture

Syed Haris Shah 304 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans