Export Navision Contact as vCard for Lotus Notes, Outlook...

The_Geepz
Member Posts: 17
Export Navision Contact as vCard for Lotus Notes, Outlook, The Bat, Applebook, Mozilla etc...
The only thing you need is a simple function - let's call it GetVCard() - returning a string containing vCard-version of the current contact. Idealy we place this function directly on Table 5050, Contact. This function could look as follows.
Simple. That's all. Now we can for example give the user possibility to export currect contact directly on Form 5050, Contact Card. We just add some MenuItem with code like this:
I guess, there is no need to explain any other details and parts of this code. Original post could be found at http://drabek.info/blog/blog.php?bid=15, its German mutation at http://drabek.info/blog/blog.php?bid=16.
Enjoy it!
The Geepz
The only thing you need is a simple function - let's call it GetVCard() - returning a string containing vCard-version of the current contact. Idealy we place this function directly on Table 5050, Contact. This function could look as follows.
GetVCard() tResult : Text[1024] // Prepare CR Characters c10 := 10; c13 := 13; ltEndline := FORMAT(c13) + FORMAT(c10); // Open vCard v2.1 tResult := 'BEGIN:VCARD' + ltEndline; tResult += 'VERSION:2.1' + ltEndline; // Name IF Type=Type::Person THEN BEGIN tResult += STRSUBSTNO('N:%1;%2;%3;%4;'+ltEndline,Surname,"First Name","Middle Name","Job Title"); // Title IF lrOrgLevel.GET("Organizational Level Code") THEN tResult += STRSUBSTNO('TITLE:%1'+ltEndline,lrOrgLevel.Description); END ELSE tResult += STRSUBSTNO('N:%1;%2;;;'+ltEndline,Name,"Name 2"); // Full Name tResult += STRSUBSTNO('FN:%1'+ltEndline,Name); // Organization/Company tResult += STRSUBSTNO('ORG:%1'+ltEndline,"Company Name"); // Phone Nos. tResult += STRSUBSTNO('TEL;WORK;VOICE:%1'+ltEndline,"Phone No."); tResult += STRSUBSTNO('TEL;WORK;FAX:%1'+ltEndline,"Fax No."); tResult += STRSUBSTNO('TEL;CELL;VOICE:%1'+ltEndline,"Mobile Phone No."); // E-Mail tResult += STRSUBSTNO('EMAIL;PREF;INTERNET:%1'+ltEndline,"E-Mail"); // URL tResult += STRSUBSTNO('URL;WORK:%1'+ltEndline,"Home Page"); // Address tResult += STRSUBSTNO('ADR;WORK;PREF:;;%1;%2;%3;%4;%5'+ltEndline,Address,City,County,"Post Code","Country Code"); // Close vCard v2.1 tResult += 'END:VCARD'+ltEndline+ltEndline;
Simple. That's all. Now we can for example give the user possibility to export currect contact directly on Form 5050, Contact Card. We just add some MenuItem with code like this:
CONTROL1104804 - OnPush() // Get some File Name ltFName := cuCDMgt.OpenFile(lTxt001,Name+'.vcf',4,lTxt002,1); IF ltFName = '' THEN EXIT; // Open Export Stream CLEAR(lfExport); lfExport.TEXTMODE(TRUE); IF NOT lfExport.CREATE(ltFName) THEN ERROR(lErr001,lrLNSetup.ToUnixPath(ltFName)); // Write it out; lfExport.WRITE(cuCDMgt.Ascii2Ansi(GetVCard)); // Close Export Stream lfExport.CLOSE;
I guess, there is no need to explain any other details and parts of this code. Original post could be found at http://drabek.info/blog/blog.php?bid=15, its German mutation at http://drabek.info/blog/blog.php?bid=16.
Enjoy it!

The Geepz
0
Comments
-
Lovely, no synchronization, good example of KISS.
If you open it with hyperlink, Outlook will open it automatically.0 -
question can you post a link to an object we can import?
Or post a list of the variable declairation
thnx0 -
question??
lfExport.WRITE(cuCDMgt.Ascii2Ansi(GetVCard));
cuCDmgt = codeunit Common Dialog management , yes ?
the function Ascii2Ansi ???
And is there and import of vCard function ?0 -
There are many solutions to convert VCF file into outlook. But depends on the number of contacts. As you have mentioned, that you want to convert multiple VCF files into outlook then, manually you can transfer the data from Import and Export settings.
More :- Import VCF to Outlook0
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