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, ...
Suggested Answer

How long is the str?

(0) ShareShare
ReportReport
Posted on by 1,993

Hi,

When we define a variable str text;

How many characters can this text field contain?

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

    You can think of is as unlimited. It accepts more than you should ever put in it, becuase you would be wasting a huge amount of RAM.

  • .. Profile Picture
    1,993 on at

    So it's better not to use it right ? It's better to create an EDT with a limited length

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

    It doesn't matter, as long as we're talking about a variable. The underlaying type is always System.String, whether you declare the type as str, str 20 or use an EDT.

    Therefore no, you can't say that using an EDT is better, because it doesn't make any difference for this scenario. If you're wasting resources by putting too much data to variables, don't believe that you can fix that by change the type in variable declaration. That's not the cause.

    Using EDTs may make your code easier to understand, but that's a different topic.

  • Suggested answer
    Florian Hopfner Profile Picture
    2,466 on at

    The documentation of the str primitive data type seems to hold the answer to the question:

    "A string can hold an unlimited number of characters, however, you can specify the maximum length of a string in the variable declaration. The string is then truncated to that maximum length."

    X++ primitive data types - str

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