Software Information |
|
Microsoft CRM Programming Secrets - Tips For Developers
This article is for advanced Microsoft CRM SDK C# developers. It describes the technique of direct SQL programming, when SDK doesn't have the functionality to do the job. Introduction. Looks like Microsoft CRM becomes more and more popular, partly because of Microsoft muscles behind it. Now it is targeted to the whole spectrum of horizontal and vertical market clientele. It is tightly integrated with other Microsoft Business Solutions products such as Microsoft Great Plains, Solomon, Navision (the last two in progress).Here we describe the technique of creating closed activity-email using MS CRM SDK and direct SQL programming. Imaging something like this. You need to handle incoming email before it is committed to MS Exchange database. You need to analyze if incoming email doesn't have GUID in its Subject (GUID will allow MS CRM Exchange Connector to move email to Microsoft CRM and attach it to the Contact, Account or Lead) - then you still need to lookup MS CRM in case if one of the accounts, contacts or leads has email address that matches with sender email address - then you need to create closed activity-email in MS CRM, attached to the object and placed into general queue. How to create MS Exchange handler is outside of the scope, please see this article:http://www.albaspectrum.com/Customizations_Whitepapers/Dexterity_SQL_VBA_Crystal/ExchangeHandlerExample.htm Now the code below is classical MS CRM SDK and it will create activity email: public Guid CreateEmailActivity(Guid userId, int objectType, Guid objectId, string mailFrom, CRMUser crmUser, string subject, string body) {try { log.Debug("Prepare for Mail Activity Creating"); // BizUser proxy object Microsoft.Crm.Platform.Proxy.BizUser bizUser = new Microsoft.Crm.Platform.Proxy.BizUser(); ICredentials credentials = new NetworkCredential(sysUserId, sysPassword, sysDomain); bizUser.Url = crmDir + "BizUser.srf"; bizUser.Credentials = credentials; Microsoft.Crm.Platform.Proxy.CUserAuth userAuth = bizUser.WhoAmI(); // CRMEmail proxy object Microsoft.Crm.Platform.Proxy.CRMEmail email = new Microsoft.Crm.Platform.Proxy.CRMEmail(); email.Credentials = credentials; email.Url = crmDir + "CRMEmail.srf"; // Set up the XML string for the activity string strActivityXml = ""; strActivityXml += ""; strActivityXml += "") + "]]>"; strActivityXml += ""; strActivityXml += userId.ToString("B") + ""; strActivityXml += ""; // Set up the XML string for the activity parties string strPartiesXml = ""; strPartiesXml += ""; strPartiesXml += "" + crmUser.GetEmailAddress() + ""; strPartiesXml += "" + Microsoft.Crm.Platform.Types.ObjectType.otSystemUser.ToString() + ""; strPartiesXml += ""+ crmUser.GetId().ToString("B") + ""; strPartiesXml += ""; strPartiesXml += Microsoft.Crm.Platform.Types.ACTIVITY_PARTY_TYPE.ACTIVITY_PARTY_TO_RECIPIENT.ToString(); strPartiesXml += ""; strPartiesXml += ""; strPartiesXml += ""; strPartiesXml += "" + mailFrom + ""; if (objectType == Microsoft.Crm.Platform.Types.ObjectType.otAccount) { strPartiesXml += "" + Microsoft.Crm.Platform.Types.ObjectType.otAccount.ToString() + ""; } else if (objectType == Microsoft.Crm.Platform.Types.ObjectType.otContact) { strPartiesXml += "" + Microsoft.Crm.Platform.Types.ObjectType.otContact.ToString() + ""; } else if (objectType == Microsoft.Crm.Platform.Types.ObjectType.otLead) { strPartiesXml += "" + Microsoft.Crm.Platform.Types.ObjectType.otLead.ToString() + ""; } strPartiesXml += ""+ objectId.ToString("B") + ""; strPartiesXml += ""; strPartiesXml += Microsoft.Crm.Platform.Types.ACTIVITY_PARTY_TYPE.ACTIVITY_PARTY_SENDER.ToString(); strPartiesXml += ""; strPartiesXml += ""; strPartiesXml += ""; log.Debug(strPartiesXml); // Create the e-mail object Guid emailId = new Guid(email.Create(userAuth, strActivityXml, strPartiesXml)); return emailId;}catch (System.Web.Services.Protocols.SoapException e) {log.Debug("ErrorMessage: " + e.Message + " " + e.Detail.OuterXml + " Source: " + e.Source);}catch (Exception e) {log.Debug(e.Message + "rn" + e.StackTrace);}return new Guid();} Now I would like to share the trick with you - there is no method to make this activity closed in MS CRM SDK 1.2 (if somebody knows the one - I owe you small pocket aquarium - smile!). Obviously Microsoft doesn't support if you do direct SQL programming bypassing SDK. However I would say this is not direct objects creation - this is rather flags correction. So here is what we have - this procedure will do the job and make activity closed: public void UpdateActivityCodes(Guid emailId) {try { OleDbCommand command = conn.CreateCommand(); command.CommandText = "UPDATE ActivityBase SET DirectionCode = (?), StateCode = (?), PriorityCode = (?) WHERE ActivityId = (?)"; command.Prepare(); command.Parameters.Add(new OleDbParameter("DirectionCode", Microsoft.Crm.Platform.Types.EVENT_DIRECTION.ED_INCOMING)); command.Parameters.Add(new OleDbParameter("StateCode", Microsoft.Crm.Platform.Types.ACTIVITY_STATE.ACTS_CLOSED)); command.Parameters.Add(new OleDbParameter("PriorityCode", Microsoft.Crm.Platform.Types.PRIORITY_CODE.PC_MEDIUM)); command.Parameters.Add(new OleDbParameter("ActivityId", emailId)); log.Debug("Prepare to update activity code " + emailId.ToString("B") + " in ActivityBase"); command.ExecuteNonQuery(); } catch(Exception e) { log.Debug(e.Message + "rn" + e.StackTrace); }} Happy customizing! if you want us to do the job - give us a call 1-866-528-0577! help@albaspectrum.com Andrew Karasev is Chief Technology Officer in Alba Spectrum Technologies - USA nationwide Microsoft CRM, Microsoft Great Plains customization company, based in Chicago, Boston, San Francisco, San Diego, Los Angeles, Houston, Atlanta, New York, and Miami and having locations in multiple states and internationally (www.albaspectrum.com), he is Dexterity, SQL, VB/C#.Net, Crystal Reports and Microsoft CRM SDK developer.
MORE RESOURCES: 3 High-Growth Software Stocks to Gift for Christmas Yahoo Finance This Software Stock With 88% Expected Profit Growth Offers Entry Investor's Business Daily CPPIB bets on U.K.-based Octopus Energy, Kraken software to drive customers’ embrace of renewable energy The Globe and Mail Enterprise Software Stocks Atlassian, Asana, and Docusign Are All Suddenly Soaring. Which Is the Best Buy for 2025? The Motley Fool Delivering efficiencies through automated software testing Federal News Network SAGT IPO News - Malaysian point of sale software provider Sagtec Global files for a $9 million US IPO Renaissance Capital Valsoft Corporation Secures $150M to Further Accelerate Growth in Vertical Market Software Sector AccessWire Tupelo Code Enforcement gets software upgrades Northeast Mississippi Daily Journal NAVAIR Issues RFI for PMA-281 Hardware & Software ExecutiveBiz Why Trump DOGE Initiative Is A Wild Card For Palantir Stock, Software Makers Investor's Business Daily Software security in 2025 - Four encouraging trends App Developer Magazine Moho Animation Software Releases Moho 14.3 Mantis Shrimp Animation World Network Why this self-made software engineer left Silicon Valley to focus on investing in women Technical.ly Cybersecurity Stocks To Watch Heading Into 2025 Investor's Business Daily PlayStation's 2024 in review: Software and hardware underwhelm, but Sony’s never been stronger TechRadar Exploring AI in Software Development Trends AppleMagazine Stream Deck Plus Reverse Engineered Hackaday 11 Best Enterprise Software Stocks to Invest In Insider Monkey 2024.45.32 Official Tesla Release Notes - Software Updates Not a Tesla App Palantir and Elastic: Daniel Ives Picks the Top AI Software Stocks to Buy as ‘Revolution Hits the Next Gear’ Yahoo Finance Software Is the Next Big AI Opportunity: 1 AI Stock Highly Recommended by Wall Street to Buy Now Yahoo Finance Turkish defense contractor wins top software exporter award for NATO intelligence project TurkishMinute An Exchange of Avanquest Software Shares Held by Eric Gareau for Claranova Shares, With No Dilutive Effect for Shareholders Business Wire Oracle Financial Services Software Limited (NSE:OFSS) On An Uptrend: Could Fundamentals Be Driving The Stock? Simply Wall St Palantir Stock: Why Software Stock Rally Will Extend Into 2025 Investor's Business Daily Symplr plans major technology rollout but cools M&A talk for now The Business Journals A Look Back at Automation Software Stocks’ Q3 Earnings: UiPath (NYSE:PATH) Vs The Rest Of The Pack Yahoo Finance EyeVision Develops Inspection Tool for Fastener Threads Vision Systems Design Sewing the digital thread for more sustainable AM VoxelMatters Software Is the Next Big AI Opportunity: 1 Brilliant AI Stock to Buy Ahead of 2025, According to Wall Street The Motley Fool Austin Software Dev Earned Her First Million with Chainlink & Solana – Now Eyes BlockDAG for More Gains Analytics Insight City: New meeting agenda software eases visually disabled's access to records - Santa Fe New Mexican City: New meeting agenda software eases visually disabled's access to records Santa Fe New Mexican Is Paycom Software, Inc.'s (NYSE:PAYC) Latest Stock Performance A Reflection Of Its Financial Health? Simply Wall St The Age of Quantum Software Has Already Started The Wall Street Journal Valsoft Corporation Secures $150M to Further Accelerate Growth in Vertical Market Software Sector Galveston County Daily News Q3 Earnings Highs And Lows: Salesforce (NYSE:CRM) Vs The Rest Of The Sales Software Stocks Yahoo Finance Microsoft Stock Gets a Fresh Price Target Amid Software Review Wall Street Pit |
RELATED ARTICLES
Does Microsoft have any real competition? Does Microsoft Have any Real Competition? Copyright (c) 2003 Gregory S. Diehl In a word, yes. Cisco Certification: Introduction To ISDN, Part IV In part III of this ISDN primer, we learned that PPP has two main methods of authentication that Cisco certification candidates need to know how to configure: PAP and CHAP.PAP has very few advantages over CHAP. Accounts Payable: A Powerful Document Management and Workflow Solution Accounts payable is just one area of office management where problems arise because of the sheer complexity of transactions, and the vast amount of paperwork that is generated.A disproportionate amount of time and administrative resources is consumed just getting invoices approved for payment. eCommerce development for Microsoft Great Plains: tools and highlights for programmer Microsoft Business Solutions Great Plains, former Great Plains Software Dynamics and eEnterprise was designed in earlier 1990th as ERP, which can be easily transferable to the winning Database and OS platform and it was originally available on Mac and PC - Mac OS and Microsoft Windows respectively. Graphical platforms battle is pretty much over and now with eCommerce demands, we should look at Great Plains Dynamics tables structure:? Naming Convention. Microsoft CRM or Siebel Siebel is traditional CRM market leader, however and mostly due to recession 200-2003, Siebel lost sizable portion of CRM market to new tiger, such as Microsoft CRM. Microsoft CRM s recent (2001) CRM answer from Microsoft and attempt top get market share from traditional vendors: Siebel, Oracle, Onyx. Microsoft Great Plains: If You are Orphan Client - What to Do and FAQ Microsoft Business Solutions Great Plains, former Great Plains Software eEnterprise, Dynamics and Dynamics C/S+ is very popular ERP and since 1994 has been successfully implemented for mid-size and mid-size to large companies in the USA, Canada, UK, Australia, New Zealand, South Africa and Middle East. During the economic recession time 2001-2004 the majority of businesses cut to virtually zero their IT/computer support expenses and stayed with hardware and software. Adware and Spyware Blockers The most important things you can do for your computer right now is to install adware and spyware blockers. Everyone is aware of computer viruses and run an anti-virus program to guard your computer against them. Microsoft Great Plains: Government & Non-Profit Organization - Workflow Implementation Usually workflow & messaging is realized in CRM and then transactions are just logged into Accounting/ERP/MRP. In the case of Microsoft Business Solutions products: Microsoft Great Plains, Navision, Solomon, Axapta the natural CRM choice would be Microsoft CRM. Three Steps To Windows Safety Heaven Now there are Three Steps To HeavenJust listen and you will plainly seeHow virus and hackers attack and destroyYour precious internet-connected computer toyJust follow steps one, two and threeStep one - Run windows update automatically each dayStep Two - Always keep your antivirus running and updatedStep Three - Install and configure a firewallFaster VirusToday can many viruses find and infect a computer connecting to internet in less then 5 minutes, even if the computer connects to internet using a modem. And how much time will the 24/7 connected computer not give the bad guys?So leaving a computer without proper protection is not advisable. The Truth: Netzero 3G We've all seen the ads on TV for Netzero 3G. You know the ones, "speeds so fast you sworn it was broadband" Well if your using it, you may not think it really is. The Opera Alternative Security flaws have long plagued Internet Explorer (IE), the market-dominating web browser from Microsoft. IE won the early browser wars, not only because it was free and bundled with Windows, but because it had some features and capabilities that its only real competitor, Netscape, didn't have. String in Java Handling character strings in Java is supported through two final classes: String and StringBuffer. The String class implements immutable character strings, which are read-only once the string has been created and initialized, whereas the StringBuffer class implements dynamic character strings. Great Plains Dexterity - Microsoft Great Plains Customization Overview Microsoft Business Solutions Great Plains, former Great Plains Software Dynamics and eEnterprise are Dexterity-written applications. Also small business line: Microsoft Small Business Manager or Small Business Financials is written in Dexterity and uses the same code base as Great Plains. Free Software: How Not To Get More Than You Bargained For! I completed an experiment recently. I wanted to find out exactly what software I could get free on the Internet. Microsoft Great Plains as ERP and Microsoft CRM as CRM If you have Microsoft Great Plains and support it for your company then you need to know some technical details about Great Plains version upgrade and what is going on behind the scenes, which options do you have in case of Dexterity, VBA, SQL customization, additional complexity comes with migration from ctree/Pervasive to MS SQL/MSDE.What is upgrade in the language of technology? Upgrade has server and client sides. Microsoft Great Plains: Offshore Customization & Development - Overview for Consultant When you visit department stores and see that majority of the apparels are produced in other countries, not US - you probably do not worry about this fact. About 10 years ago, when Clinton's high tech era was at the inception - we saw the signs of high tech professionals inflow in the USA from overseas. Four Easy Ways To Prevent Spyware How would you like to prevent spyware and adware from getting into your computer? You need to stop adware and spyware before it gets into your files. That way you're protecting your private information such as passwords, credit card numbers and other documents that you don't want to share with anyone. Collaboration Software: Index of Collaboration Software Technologies Collaboration SoftwareCollaboration Software, also known as group collaboration software or groupware, is software which allows cooperation on a business document between multiple parties on multiple computers. Collaboration software also allows the integration and merging of document changes and versions on a business document. Crystal Reports - Microsoft SQL Server Microsoft SQL Server is the leader for inexpensive and middle size SQL solutions. Plus it is now capable to serve large enterprise on Microsoft Windows platform. Protect Your Computer...and Your Business! We all take the computer for granted. I mean, all we have to do is switch it on and it's ready to go. |
home | site map |
© 2006 |