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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Assign a value to string(memo) from container

(0) ShareShare
ReportReport
Posted on by 700

Dear community,

I would like to assign a container value to a field of type string (Memo):

myTable.StringMemoField = con2Str( myContainer );

myTable.doUpdate();

When I do this, the string (Memo) field gets cut at around 20th line. The container is a large one and has around 500 lines.
How can I assign the string (Memo) field correctly?

[EDIT]: con2Str has a limitation of a 1000 signs. How can I declare the return type of a function to string memo?

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Vilmos Kintera Profile Picture
    46,149 on at

    It is unlikely that you are hitting the boundary limit of a Memo field due to the enormous size it can take in:

    community.dynamics.com/.../216473

    Did you try to debug the conversion? It is a method in the Global class, place a breakpoint in there and check if the full container length is correctly processed, and if the value of the string it stores content in does change indeed.

    Maybe it is just a display issue once you bind it to a form string control.

  • OrangeRocks Profile Picture
    700 on at

    con2Str cuts my value at the place of 1000 signs.

    I would like to create my own function like con2Str, but declare the return type not

    str 1000

    but something like

    str (Memo)

    Is there a way?

  • Verified answer
    Vilmos Kintera Profile Picture
    46,149 on at

    In later AX versions the Memo is an SQL Server BLOB column, but if my memory does not fail me, in AX 4.0 they might have just used a large string that has 1000 characters length indeed (by default, if you do not change it).

    If you increase that in the System data types form, that can have negative performance implications and could drop your fields in the DB on synchronization to recreate it with a different length, so be careful here.

    The solution is to use a container field instead of string.

  • Suggested answer
    OrangeRocks Profile Picture
    700 on at

    A simple code did the trick, no use if con2Str whatsoever:


    myTable.StringMemoField += conPeek( myContainer, counter ) + " "; myTable.doUpdate();

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans