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 NAV (Archived)

Text Constants

(0) ShareShare
ReportReport
Posted on by

I have written the code to send an email. In this I need to create a message but the text uses more then 250 characters. How can I add two text Constants to the email message. 

This is what I tried but it still argues it's over 250 characters. it isn't unless they're joined together. 


cuSMTP.EmailRecordMessageFileandFolder(strEmailNo, recPurchaseOrderTMP."Buy-from Vendor No." + '.xlsx' ,recTiogaSetup."Job Queue Document Folder");
cuSMTP.EmailRecordMessageLineBlank(strEmailNo,2);
VendorBookEmailtext := Text016 + Text019;
cuSMTP.EmailRecordMessageLine(
strEmailNo,
STRSUBSTNO(
// Text016,
VendorBookEmailtext   // This contains both the Text Constants 
),
'',
FALSE
);

cuSMTP.EmailRecordMessageEnd(strEmailNo);
END;

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Amol Salvi Profile Picture
    18,698 on at

    Check the Length of variable 'VendorBookEmailtext'  

  • Community Member Profile Picture
    on at

    Thank you that was my first idea, it's set to 380 (More then enough)

  • Suggested answer
    Mohana Yadav Profile Picture
    60,999 Super User 2025 Season 2 on at

    I am checking in 2016 and I didnt find function EmailRecordMessageLine in Codeunit 400.

    Is it standard function? it seems parameter is declared with 250 length only

  • Suggested answer
    Amol Salvi Profile Picture
    18,698 on at

    Then check the variable defined in function where you are passing the value from VendorBookEmailtext

  • Community Member Profile Picture
    on at

    Hi we're developing in 2013 and it's custom code.  All text variables within the function are set to size 1024.

  • Suggested answer
    Mohana Yadav Profile Picture
    60,999 Super User 2025 Season 2 on at

    variables and parameters also?

    Please activate the debugger to find exact place of error

  • Community Member Profile Picture
    on at

    It errors on this line

    EmailRecordMessageLine(strEmailNo : Code;strLine : Text;strLine2 : Text;blnTableStart : Boolean)

     // TIO000003

     CLEAR(recEmail);

     recEmail."Email No." := strEmailNo;

     recEmail."Email Marker" := recEmail."Email Marker"::Line;

     recEmail."Email Line" := strLine; // ERROR HERE

     recEmail."Email Line Col 2" := strLine2;

     recEmail."Email Table Start" := blnTableStart;

     recEmail.INSERT(TRUE);

    These are the parameters in the function

    Var Name DataType Subtype Length

    No strEmailNo Code 20

    No strLine Text 1024

    No strLine2 Text 1024

    No blnTableStart Boolean

  • Suggested answer
    Rajasekhar@MS Profile Picture
    5,569 on at

    Hi

    Have you checked the length of the "Email Line" field in recEmail table . in table you can not have a field length more than 250.

  • Suggested answer
    Mohana Yadav Profile Picture
    60,999 Super User 2025 Season 2 on at

    what is the length of field "Email Line" in recEmail table?

  • Community Member Profile Picture
    on at

    The Length is set to 250.. I tried changing it and it won't allow for a value greater then 250.

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 NAV (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans