- for a FREE MKS Toolkit Evaluation

WebProWorld Dev Forum

RSS News Feeds
I have a test RSS file on our company server which I am trying to get Yahoo to read, it's called news.xml but some how it doesn't give me the news page?
Click to read more...

Trying to Find a Script
I'm in need of a simple script to help me organize and help my visitors search for words/phrases in a collection of verses (similar to poems).
Click to read more...


Recent Articles

Understanding GRML
HTML is the primary markup language used on the web. After its first release, it lacked many of the features taken for granted today on the web. It took many years for HTML to become what it is.

Making PHP Read as HTML
In a recent article I wrote, I mentioned a neat way to track when Google visits your Web site.

Developers Beware: The Dragon Lurks
I am a software developer. I work in a profession in denial. I work in a profession that has hard times ahead and no one can see it. I see the iceberg off the bow, but can't get anyone else to view it as a threat. I see my job going overseas and I'm looking for my lifeboat now.


10.27.04


Programming Email Activity Attachment

By Boris Makushkin

Microsoft CRM is now on the scene and it is increasing its market share, due to Microsoft Business Solutions muscles and marketing strategy.

It is tightly integrated with other Microsoft Business Solutions products such as Microsoft Great Plains, Solomon, Navision. Being relatively inexpensive in comparison to competitors, like Siebel, Oracle - Microsoft CRM opens you the door for worldwide operations automation. In this small article we would like to give you, software developer, some hints on Microsoft CRM customization.

Today's topic is Activity of email type programming - you usually deal with these customizations when you improve Microsoft Exchange CRM connector. How do you create email attachment - this is the main discussion topic. We'll use C#.Net.

In Exchange handler/event sink you create Activity of email type in MS CRM and one of the tasks is transfer the attachment(s) from the body of the incoming email to the attachment(s) in the Activity. You can realize it through direct access to Microsoft CRM DB. Let's see C# code:

1. First we are getting access to the letter via ExOLEDB:

CDO.Message iMessage = new CDO.MessageClass();
CDO.IBodyPart iPrt;

iMessage.DataSource.Open(bstrURLItem, null, ADODB.ConnectModeEnum.adModeRead,

ADODB.RecordCreateOptionsEnum.adFailIfNotExists, ADODB.RecordOpenOptionsEnum.adOpenSource, "", "");


Increase your Link Popularity across major search engines. Get your Free linking popularity report.

2. Next - we come through the attachment list, get their names and save their bodies into temporary catalogue:

for(int i = 1; i <= aNum; i++) {
         string fName = iMessage.Attachments[i].FileName;
         string eName = fName.Substring(fName.Length-3, 3).ToUpper();

         log.Debug("Attachment: " + fName);

         iPrt = iMessage.Attachments[i];
         string attName = Path.GetTempPath() + fName;
         iPrt.SaveToFile(attName);

         attachments.Add(Guid.NewGuid(), attName);

         iPrt = null;
}


3. Then we cycle through the cache, containing attachments info and add them to the Activity created:

if (attachments != null) {
         ICollection keys = attachments.Keys;
         int attCounter = 0;

         foreach (Guid o in keys) {
            string attName = (string)(attachments[o]);

crmConnector.AddAttachmentToActivity(emailId, attName, (new FileInfo(attName)).Length, attCounter);

File.Delete(attName);
attCounter++;
}
}


Read the Rest of The Article.


About the Author:
Boris Makushkin is senior software developer in Alba Spectrum Technologies – US nation-wide Great Plains, Microsoft CRM customization company, based in Chicago and having locations in multiple states and internationally (www.albaspectrum.com ), he is Unix, SQL, C#.Net, Crystal Reports, Microsoft CRM SDK and Exchange Server SDK developer. You can reach Boris: borism@albaspectrum.com

About DevNewz
DevNewz has assembled experts around the world to deliver helpful advice to application developers. Our in-house news staff focuses on keeping you updated with the latest new software and trends in application development. DevNewz provides Knowlege For Application Developers.

DevNewz is brought to you by:

SecurityConfig.com NetworkingFiles.com
NetworkNewz.com WebProASP.com
DatabaseProNews.com SQLProNews.com
ITcertificationNews.com SysAdminNews.com
LinuxProNews.com WirelessProNews.com
CProgrammingTrends.com ITCertificationNews.com


-- DevNewz is an iEntry, Inc. publication --
iEntry, Inc. 880 Corporate Drive, Lexington, KY 40503
2004 iEntry, Inc.  All Rights Reserved  Privacy Policy  Legal

archives | advertising info | news headlines | free newsletters | comments/feedback | submit article

Knowlege For Application Developers DevNewz News Archives About Us Feedback DevNewz Home Page About Article Archive News Downloads WebProWorld Forums Jayde iEntry Advertise Contact