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: Open-Source Software Is in Crisis IEEE Spectrum Artificial intelligence software at Zuckerberg S.F. General Hospital helps flag stroke risk San Francisco Chronicle DOD taps ‘integrated software enablers’ to help fully realize ambitious Replicator plans DefenseScoop London startup Agemo has exited stealth. Now, it's building AI reasoning for software to take on Poolside and Magic. Business Insider Keysight Providing Software to Enable Researchers through the Microelectronics Commons Business Wire Business Insider's Rating Methodology for Tax Software Business Insider RatedPower expands efficiency and precision with solar project design software release - PR Newswire AV Unveils Advanced Software Updates to Enhance Puma UAS Capabilities in Contested Environments Business Wire The Generative Software Cycle is Here: OutSystems Introduces the Power of Low-Code x AI Business Wire Schrödinger Announces Multi-Target Collaboration and Expanded Software Licensing Agreement with Novartis Business Wire Anduril Lattice Software Enhances US CENTCOM Air Defense Exercise The Defense Post TestSprite nabs $1.5M to build autonomous AI software testing platform SiliconANGLE News LEAP, globally popular software for energy, climate mitigation, and air pollution planning, to be offered free to an additional 54 countries Stockholm Environment Institute Salesforce Loses Top Artificial Intelligence Executive, Says Analyst Investor's Business Daily AI-based ARIA detection software could bring 'renewed hope' for people undergoing Alzheimer's treatment Health Imaging DMDE review: How good is this free data recovery software? Digital Trends Precisely Named a Leader in IDC MarketScape: Worldwide Data Intelligence Platform Software, 2024 Yahoo Finance EasyODM Launches AI-Powered Machine Vision Software Vision Systems Design Epic software helps veterans access VA benefits Verona Press Joget Earns GovStack Software Requirements Compliance ENGINEERING.com Enterprise Software in the Age of Generative AI GP Bullhound Fast 50 2024: Fearless aims beyond software after first acquisition The Business Journals Exclusive | FBI used ‘software tools’ to search social media for election-related talk: analyst New York Post Best Human Resources Software - 2024 Reviews & Pricing Software Advice Amundi buys wealth software firm Aixigo Financial News KIC Launches Game-Changing TAS Software Platform to Address Emerging Thermal Process Challenges AZoRobotics Take-Two Interactive Software Chief Financial Officer Lainie Goldstein Sells 35% Of Holding Simply Wall St Aviation Software Market Revenue to Attain USD 21.55 Bn by 2033 Precedence Research Samsung Galaxy S25 to offer 7 years of One UI software updates: Will you use it for that long? Sammy Fans Indian payments platform Razorpay launches B2B software fund - Global Corporate Venturing Danfoss Power Solutions launches ACL 3.2 software Industrial Vehicle Technology International PTV updates truck route-planning software Traffic Technology Today MSU, Web Software Engineer II, Bozeman Daily Chronicle From self-driving cars to AI that writes enterprise software: Cogna founder raises $15M - TechCrunch Nucleus Software Exports Limited Just Missed EPS By 23%: Here's What Analysts Think Will Happen Next Simply Wall St Montclair Council Passes Cell-Tower Ordinance, Tables Storm Water Regulation and Software Agreement TAPinto.net The Intellectual Property Software Market Reach USD 31.3 Billion by 2032 Growing with 15.6% CAGR EIN News Snyk founder’s Tessl raises $125M to revolutionise AI native software creation with spec-centric model Tech Funding News Danfoss software enables autonomous control Power Progress |
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 |