Change Line

marmar Member Posts: 17
Hi,

i've created a new table with some records and after the daily register those records are sent by mail ( outlook). My problem is to make the body of the mail to change line.
In c#, for example, we put '\n'. How can i do this in Navision?

Thanks

Comments

  • XypherXypher Member Posts: 297
    //crlf   Text    2
    
    
    crlf[1] := 13;
    crlf[2] := 10;
    


    (This is one way, and the usual way I go about doing it.)

    There are definitely ways to use the '\' character to get a new line in Navision but there are also other ways where it does not work. Which is why instead of fumbling with that I just go for the above method.
  • kinekine Member Posts: 12,562
    Which version? If you are using SMTP Mailing, than you can use HTML mail format and use the < br > tag to add end of line...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • garakgarak Member Posts: 3,263
    it is dependent on your version.
    For example you can send CR LF (ASCII 10 / ASCII 13) or in HTML Style <br>

    regards
    Do you make it right, it works too!
  • garakgarak Member Posts: 3,263
    a damned, kine is awake and was faster
    Do you make it right, it works too!
  • kinekine Member Posts: 12,562
    garak wrote:
    a damned, kine is awake and was faster
    8) sometime I am faster...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • marmar Member Posts: 17
    It's on Version 4.0.
    I've tried with '//' but it is not working...
  • kinekine Member Posts: 12,562
    mar wrote:
    It's on Version 4.0.
    I've tried with '//' but it is not working...

    // will never work. \\ may be... but in this case you need to use the CR+LF way... just create the string with the CR and LF strings and insert it into the text where you want to insert the empty string.
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • marmar Member Posts: 17
    // will never work. \\ may be... but in this case you need to use the CR+LF way... just create the string with the CR and LF strings and insert it into the text where you want to insert the empty string.

    what is the CR+LF way? This is the code, i want to change line after the FORMAT(Corresp.Valor);:


    nomeTo := text1;
    nome := '';
    Assunto:=text2;
    corpo := '';

    Corresp.SETRANGE(Data,TODAY);
    IF Corresp.FIND('-') THEN
    BEGIN
    REPEAT

    corpo += FORMAT(Corresp.Data)+' '+Corresp.Remetente+' '+Corresp.Assunto+' '+Corresp.Destinatário+' '+FORMAT(Corresp.Valor);
    Mail.AddBodyline(corpo) ;
    UNTIL Corresp.NEXT=0

    END;

    Mail.NewMessage(nomeTo,nome,Assunto,'',anexo, TRUE);




    thanks
  • einsTeIn.NETeinsTeIn.NET Member Posts: 1,050
    Oh dear, try to think a little bit yourself.

    Name = crlf
    DataType = Text
    Length = 2
    crlf[1] := 13; 
    crlf[2] := 10;
    
    ...
    
    corpo += FORMAT(Corresp.Data)+' '+Corresp.Remetente+' '+Corresp.Assunto+' '+Corresp.Destinatário+' '+FORMAT(Corresp.Valor) + crlf;
    
    "Money is likewise the greatest chance and the greatest scourge of mankind."
  • marmar Member Posts: 17
    It's working, thanks a lot!

    Sorry so many questions, but i don't know nothing about programing..

    Thanks O:)
  • sabzamsabzam Member Posts: 1,149
    Hi Everybody,

    I am creating an email and I'm Using the crlf thing to go to next line, but what should I do to skip a line?


    I want the body to look like this

    xxxxx

    xxxxx

    Is this possible?
Sign In or Register to comment.