F.url in mailmessage

BGI
Member Posts: 176
I want to send an automatic mail message with the url in it to an item(very simple example).
When i use the Mail.Newmessage(...) and put the result of f.url function in it , it doesn't show up as an shortcut in my mailmessage.
I'm using Outlook 2000.
Is there any one who knows how to do this ?
Al i want to do is upon item creation send someone a mailmessage with the text 'new item created, clik on the following link to view it'
Rgds
Benny Giebens
When i use the Mail.Newmessage(...) and put the result of f.url function in it , it doesn't show up as an shortcut in my mailmessage.
I'm using Outlook 2000.
Is there any one who knows how to do this ?
Al i want to do is upon item creation send someone a mailmessage with the text 'new item created, clik on the following link to view it'
Rgds
Benny Giebens
Rgds
Benny Giebens
Benny Giebens
0
Comments
-
Isn't this blocked by Outlook because it thinks the url is potentially unsafe?No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)0
-
No, all attachments are unblocked.
Rgds
BennyRgds
Benny Giebens0 -
Maybe you can try it this way:
</font><blockquote><font size="1" face="Verdana, Arial">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">OBJECT Codeunit 50000 Test hyperlink
{
OBJECT-PROPERTIES
{
Date=13/09/02;
Time=17:48:20;
Modified=Yes;
Version List=;
}
PROPERTIES
{
OnRun=BEGIN
Item.FIND('-');
MakeHyperlink(FORM::"Item Card",Item.GETVIEW,Item.GETPOSITION);
Mail.NewMessage('you@web.com','','New item has been created','Please click on the link in the attachment',AttachmentName,FALSE);
END;
}
CODE
{
VAR
HyperlinkText@1000000001 : Text[1024];
AttachmentStream@1000000003 : OutStream;
AttachmentFile@1000000002 : File;
AttachmentName@1000000004 : Text[250];
Item@1000000005 : Record 27;
Mail@1000000006 : Codeunit 397;
PROCEDURE MakeHyperlink@1010001(ObjectID@1010000 : Integer;View@1010001 : Text[250];Position@1010002 : Text[250]) : Text[1024];
BEGIN
// Attachment made with File & outstream
AttachmentFile.CREATE('c:\temp\NewItem.url');
AttachmentName := AttachmentFile.NAME;
AttachmentFile.CREATEOUTSTREAM(AttachmentStream);
AttachmentStream.WRITETEXT('[InternetShortcut]');
AttachmentStream.WRITETEXT(); // write blank line
HyperlinkText :=
'URL=' + CONTEXTURL +
'&target= Form ' + FORMAT(ObjectID) +
'&view=' + View +
'&position=' + Position;
// Replace special chars
ReplaceTextInString(' ','%20',HyperlinkText);
ReplaceTextInString('\','%5C',HyperlinkText);
ReplaceTextInString('&','%26',HyperlinkText);
AttachmentStream.WRITETEXT(HyperlinkText);
AttachmentFile.CLOSE;
END;
PROCEDURE ReplaceTextInString@1010002(FromText@1010001 : Text[30];ToText@1010002 : Text[30];VAR SourceText@1010000 : Text[1024]);
VAR
i@1010003 : Integer;
BEGIN
// replace spaces with %20
i := STRPOS(SourceText,FromText);
WHILE i <> 0 DO BEGIN
SourceText := COPYSTR(SourceText,1,i -1) + COPYSTR(SourceText,i + 1);
SourceText := INSSTR(SourceText,ToText,i);
i := STRPOS(SourceText,FromText);
END;
END;
BEGIN
END.
}
}
</pre><hr /></blockquote><font size="2" face="Verdana, Arial">PS: How can one unblock all attachments in Outlook?No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)0 -
I uploaded a little utility to unblock attachments. Once installed you get an additional tab in outlook options, where you can choose witch attachments are safe and witch are not.
Rgds
BennyRgds
Benny Giebens0 -
Thnx
Works great !Rgds
Benny Giebens0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions