Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX forum
Answered

String Size in AX ..??

Posted on by Microsoft Employee

I am looking to increase the size of purchline.Name(string of size 1000 EDT-ItemFreeTxt). I tried to change the EDT character to Memo where I ran into DB Sync error on other dependencies(ProjTransView and so on...) 
My requirement is to allow it to atleast 5000 characters. What is the maximum size that's allowed on a string in AX ..? What will be the consequences of changing the size of base EDT of type String..?


Some developers suggested to add a new custom field of type memo and hide the standard one. This will be a major customization because the process would start from a requisition and should be changed in many tables, reports and views which is a long process.

Please suggest.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: String Size in AX ..??

    Faheem Ahmed

    Either way this is not working out(by creating a custom EDT and adding it to field or changing the length of EDT), its resulting in DB synchronization errors. its causing exceptions in standard views

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: String Size in AX ..??

    ievgen Miroshnikov

    Adding a note to a purchase requisition line is getting transferred to a PO line as well.  so that when a PO is created from a PR , users does not have to reenter the notes.

  • Suggested answer
    Vilmos Kintera Profile Picture
    Vilmos Kintera 46,149 on at
    RE: String Size in AX ..??

    I think you do not understand key concepts of AX and SQL Server.

    A memo field should only be used as a last resort, because it is not designed the same way as a regular database column. It can hold data up to ~4 GB, and the largest disadvantage is that it cannot be indexed. Now because PurchLine is used in so many Queries with DynamicFields = Yes, a memo would automatically be included, making them very slow (performance penalty overall in your system for the Account Payable module).

    Same goes if you increase the string length to your desired value. In AX the largest string Extended Data Type is around 1200, you may find it in your AOT starting with "str". I would not advise to go higher than that.

    What you should do instead is create a new table (or set of tables if you want it to be used both on requisition and PO), like PurchReqLineExtMemo and PurchLineExtMemo with a primary key-based foreign key relation on the matching table, and upon record insert/delete put a value in those tables as well. Place your memo field on those tables, so they would not be automatically fetched for standard Queries, and you would not slow down your forms in general. You could just include it wherever required.

  • Verified answer
    Mea_ Profile Picture
    Mea_ 60,278 on at
    RE: String Size in AX ..??

    Another option would be to use document attachment to PO line, attaching terms and conditions doc, if you have one, or using note.

  • Suggested answer
    Martin Dráb Profile Picture
    Martin Dráb 228,588 Most Valuable Professional on at
    RE: String Size in AX ..??

    Yes, I know it's not a product name.

    So you indeed want to use the Name field for something else, namely for terms and conditions. You should at least create a separate field, although a separate table would likely be a better solution, especially if some terms are conditions repeat for multiple lines. Keeping it away form the PurchLine will make sure that it doesn't have to be fetched from DB every time when a PurchLine is loaded and you'll be able to associate a single definition with several lines.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: String Size in AX ..??

    Hi Martin,

    Its not actually a product name field. Its the item description in a Purchase Requisition.

    The process starts from PurhReq to a PurchOrder with workflows on both process.

    PurchReqLine.Name  is the line item description in a PR. When a PR is converted to a PO , this description is transferred to PurchLine.Name

    Why do you need a 5000 character description:.? When a PO is made to a vendor who comes to site and do construction , there may be cases to mention different terms and conditions on each line item based on its nature.

    The consequence would be performance penalty, the necessity to review all forms and reports to be able to display all the data and so on.  -I am ready to review the forms and reports as there is a requirement. Is changing the EDT to Custom EDT of type String with 5000 characters an acceptable solution..?

    performance penalty- does it occur if I change the EDT type in base tables or even if I add a new field of type memo ..? Adding a new field of Type memo is going to big customization. I would prefer the first one.

  • Martin Dráb Profile Picture
    Martin Dráb 228,588 Most Valuable Professional on at
    RE: String Size in AX ..??

    How does it happen that you need 5000 characters for PurchLine.Name? I can't imagine what you may want to put there, and who would ever read such names. Aren't you trying to reuse the field for some other purpose?

    If a client asked me to do that, I would ask them these questions, because I can't think of any legitimate reason for a Name with 5000 characters.

    The consequence would be performance penalty, the necessity to review all forms and reports to be able to display all the data and so on.

  • Suggested answer
    faheem Ahmed Profile Picture
    faheem Ahmed 450 on at
    RE: String Size in AX ..??

    Hi mouni,

    You need to consider couple of thing, what is the scope of your name field is it limited to only purchase order view than increasing the length is not a big deal but if it should go on to next logical process like receiving and invoicing then it will have a ripple effect like on reports, forms and every stage of process different table hold same information and it will be truncated.

    String length is limited

    It cannot contain more than about 25.5 Million characters. You get an error "Error executing code: Insufficient memory to run script." if you try more.

     

    Secondly do not disturb standard EDT. Create your own and use them if you must.

     

    Another thing you might need to increase buffer size in configuration to avoid un wanted error.

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

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,554 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,588 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans