How to insert a Navision Link in an email

kenlkenl Member Posts: 182
Hello,

I am using CodeUnit 397 to send email within Navision 4.0. Now I have the following questions.

1) The method NewMessage only take 1 body text (250 characters) which is very short, how can we add more text to the email? I try to use a method called AddBodyLine() but never success.

2) I would like to insert a Navision Link in the email. Eg. When user click to link system will open Navision and point to a form and a record.

[url=navision://client/run?servername=NAServer%26database=Navision40BIN%26company=CRONUS%20International%20Ltd.%26target=Form%2042%26view=SORTING(Field1,Field3]navision://client/run?servername=NAServ ... ld1,Field3[/url])%20WHERE(Field5796=1(''..24/01/01))%26position=Field1=0(1),Field3=0(101005)%26servertype=MSSQL

Do you know how to do it?

Thank you very much.

Comments

  • kinekine Member Posts: 12,562
    Standard Navision functionality is not able to send HTML emails - you cannot enter hyperlinks. Use another way (smtp, your own Outlook interface etc...)
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • SaalekSaalek Member Posts: 181
    Hi
    It is posible to send Hyperlinlks creating an HTML file

    Filename := 'c:\Hyperlink.htm';
    IF EXISTS(Filename) THEN ERASE(Filename);
    HFile.TEXTMODE(TRUE);
    HFile.CREATE(FileName);
    HFile.WRITE('<HTML><HEAD><TITLE>Enlace Navision</TITLE></HEAD>');
    HFile.WRITE('<FRAMESET border=0 cols=0 frameBorder=NO frameSpacing=0 rows=0><FRAME frameBorder=NO name=menu noResize');
    HFile.WRITE('scrolling=no src=');
    HFile.WRITE('"'+Your form URL+'"');
    HFile.WRITE('></FRAMESET></HTML>');
    HFileCLOSE;
    

    If you send a mail with this file, when you receive the mail, you can open this file and Navision starts.

    But there is a little problem. If you have more than one Navision Version in the same pc, this Hyperlink try to open Navision with the last navision installed in your PC (installation order not version. Example, if i Install 3.70, 4.00 and after 3.60, it trys to open with 3.60)

    Bye
  • lzrlzr Member Posts: 264
    1) Change the NewMessage parameter length to 1024, I did with Navision 4.0 and it worked
    Navision developer
  • b2b_Vijayb2b_Vijay Member Posts: 76
    Thanx Buddy....

    Your code is wonderful.

    Thanx once again...

    Vijay
    Regards,
    Vijay
  • sarmigsarmig Member Posts: 89
    Sorry for undigging this topic, but I couldn't find another that was related to the question I have.

    Is it possible that, using the Mail Codeunit, I could "AddBodyLine" a Navision link ([url=navision://...]navision://...[/url].) and, when I automatically open Outlook (that's the function of the button where this code is), the navision link I added is in Hyperlink format?

    I noticed that if I add a (http://...) link, it automatically shows as hyperlink. How can I make a navision link have the same behaviour?
Sign In or Register to comment.