tag:blogger.com,1999:blog-61147059426057343392024-03-08T14:33:21.166-06:00CRM WizardMerlinhttp://www.blogger.com/profile/02482547439659897193noreply@blogger.comBlogger15125tag:blogger.com,1999:blog-6114705942605734339.post-36105783167145318142011-08-19T12:52:00.003-05:002011-08-19T13:02:58.420-05:00The CRM 2011 SDK is wrong (ish)So that might be a slight exaggeration, but I just hate it when documentation is incorrect. In this situation, the culprit is the javascript to assign a value to a lookup field. According to the SDK, there are 3 properties you must set on your array to set the value on a lookup:<div><ul><li>id</li><li>name</li><li>entityType</li></ul>Unfortunately, if you try to set these three properties and then use the setValue() method to assign it to a lookup, you will either get nothing or an error stating that the "object does not support this property or method". That's because "entityType" doesn't actually exist.</div><div>
<br /></div><div>Instead, you must create your array, same as before, but set the id, name, and type. Just "type". Set this to the object type code for the entity (1 for account, 2 for contact, 8 for user, etc.) and suddenly the setValue() actually sets something.</div><div>
<br /></div><div>EDITED TO ADD:</div><div>So it seems I am only half correct. Upon reading the SDK more closely, it seems you CAN set entityType, but it should be a string for the entity instead of the type code. Got so used to the type codes in 4.0.... Anyway, if you set entityType to something like "account" or "systemuser" then it works.</div><div>
<br /></div>Merlinhttp://www.blogger.com/profile/02482547439659897193noreply@blogger.com0tag:blogger.com,1999:blog-6114705942605734339.post-66448409623202658252011-02-15T10:12:00.003-06:002011-02-15T10:44:47.874-06:00CRM 2011 Outlook client x64One of the great new features with CRM 2011 is support for 64-bit environments. With CRM 4.0, the Outlook client was x86 only, meaning that you had to install 32-bit Office (regardless of your operating system being x86 or x64) in order to install the CRM Outlook client. With CRM 2011, now x64 Office is supported, which is fantastic.<br /><br />Except that the installation doesn't work. Well, it works, but you can't connect to an organization. Here is what I discovered, and how I fixed it.<br /><br /><ol><li>The installation of the client runs just fine. The new installer is like other Office 2010 installs - you get a big button for "Install Now" and then another smaller one if you want options, which are essentially where to install and do you want to enable Offline access. No problems so far.</li><li>I ran the configuration wizard, selected CRM Online to connect to my organization, and entered my Live ID information. The wizard found all of the Online organizations my Live ID is associated with, and I picked the one I wanted and clicked OK.</li><li>The wizard did some initialization tasks, sat for a while, and then failed with an error: "There is a problem communicating with the Microsoft Dynamics CRM server. The server might be unavailable. Try again later. If the problem persists, contact your system administrator". </li><li>Since that error isn't terribly helpful, I did more research. In the log (which is buried in Windows 7 under C:\Users\user\AppData\Local\Microsoft\MSCRM\Logs\Crm50ClientConfig.txt), I found this error:<blockquote>Exception : Unable to load the native components of SQL Server Compact corresponding to the ADO.NET provider of version 8082. Install the correct version of SQL Server Compact. Refer to KB article 974247 for more details</blockquote></li><br /><li>Naturally, I checked out that article. The KB states that you might get this error if, on a 64-bit computer, you haven't installed BOTH the x86 and x64 versions of SQL Compact 3.5. Upon examination, this was true - the CRM client installation had only installed the 32-bit version. Fortunately, the KB article contained a link to the installers for SQL Compact 3.5 SP2.<br /></li><li>I installed the x64 version, and retried the configuration wizard. Still no dice, and the same error in the log. I revisited the KB article and noticed that you can get this error if the versions don't match between x86 and x64. SP2 is the most recent, BUT looking under Programs and Features, the x86 version installed by CRM is 3.5.8082.0 and stock SP2, which I had installed for x64, is 3.5.8080.0.</li><li>Searching for the version number, I discovered a hotfix for SQL Compact 3.5 SP2 which brings it up to .8082. Downloaded and installed the hotfix to get both versions to the exact same release. (I also tried downgrading the x86 version to .8080 and got the same ADO error in the log.)</li><li>Re-ran the configuration wizard, and after one stumble with actual network problems, it finally connected and works!</li></ol><div><br /></div><div>Long story shortened:</div><div><ul><li>The x64 installer for the CRM 2011 Outlook client does not include everything necessary for the client to work.</li><li>You must download the x64 installer for <a href="http://www.microsoft.com/downloads/en/details.aspx?familyid=E497988A-C93A-404C-B161-3A0B323DCE24&displaylang=en">SQL Compact 3.5</a>.</li><li>You must upgrade the x64 version of SQL Compact 3.5 to version 3.5.8082.0 with the <a href="http://support.microsoft.com/kb/2289547/en-us">hotfix</a>. </li><li>At this point the Outlook client should be able to connect to your CRM 2011 organization.</li></ul></div>Merlinhttp://www.blogger.com/profile/02482547439659897193noreply@blogger.com18tag:blogger.com,1999:blog-6114705942605734339.post-40390532025398756662010-06-21T16:23:00.003-05:002010-06-21T16:41:07.975-05:00Improved LinkedIn CRM integrationSo some of you may have the original style LinkedIn integration in CRM - it displays in an iframe somewhere on your account/contact/lead and displays any people at a given company that are members on LinkedIn. However, I was recently directed to find (and subsequently found) a better integration (at least it looks cooler and seems to be pretty slick) posted here:<br /><a href="http://marcoamoedo.com/blog/adding-linkedin-to-dynamics-crm/">http://marcoamoedo.com/blog/adding-linkedin-to-dynamics-crm/</a><br /><br />The code he lists here is for accounts - copy and paste and you have a new cute little icon next to the account name field! If I modify this to work with contacts or leads I will post it here as well.Merlinhttp://www.blogger.com/profile/02482547439659897193noreply@blogger.com2tag:blogger.com,1999:blog-6114705942605734339.post-59062433438950395792010-05-19T09:25:00.002-05:002010-05-19T09:36:48.246-05:00Error when reactivating a caseThis same sort of error might occur when reactivating any record, but the specific instance was an error when attempting to reactivate a case in CRM. The error returned in a trace is: <span style="font-weight:bold;">The object cannot be updated because it is read-only.</span> This error message doesn't help much, because of course the object is read-only. However, this message is actually being returned by an attribute on the case, and the problem at hand is some javascript. <br /><br />Thanks to the conversation <a href="http://social.microsoft.com/Forums/en-US/crm/thread/221cdd85-c845-4c43-9e63-4d639b0fb50a">here</a>, I was able to determine that the problem is in the OnLoad() script, where I was setting a few attributes to ForceSubmit = true. This script is actually firing when I open the read-only record, which normally has no effect because the record cannot be saved. However, upon trying to reactivate, the system is performing a save operation, but the ForceSubmit is trying to submit the value in the attribute before the record becomes read/write again. Hence the above error.<br /><br />The solution here is to simply wrap the ForceSubmit statements in an IF statement to make sure that they only fire on create or update forms and not on read-only forms.Merlinhttp://www.blogger.com/profile/02482547439659897193noreply@blogger.com1tag:blogger.com,1999:blog-6114705942605734339.post-80900503267658116702010-02-09T14:39:00.003-06:002010-02-09T14:45:45.673-06:00Server 2008 and the Email router with IFDToday I encountered an interesting issue with Server 2008 and the email router. The email router is running on the same server as CRM, and I had just configured CRM to run in IFD mode. This somehow broke the email router. When browsing the CRM URL from the server, I received the IFD login page. Thinking I had missed a subnet, I confirmed that all appropriate subnets (including the server subnet) were included in the IFD tool, and verified it was working by testing from another server. Everything checked out.<br /><br />And yet somehow, the request for CRM was coming from another IP not included in the subnet, but only when browsing from the CRM server itself. It turns out that the CRM server, when making the request to itself, was making that request using IPv6 instead of IPv4. The IP address was indeed different and was not in one of the included subnets. To resolve this issue, I disabled IPv6 on the ethernet connection (in the properties, I simply unchecked the IPv6 box) and tested again. Everything worked fine, and the router was fixed.<br /><br />So if you are using an IFD, keep in mind that Server 2008 may try to make requests in IPv6 to itself, and the CRM server will think these are external requests.Merlinhttp://www.blogger.com/profile/02482547439659897193noreply@blogger.com2tag:blogger.com,1999:blog-6114705942605734339.post-67163726250815513062010-02-08T12:13:00.002-06:002010-02-08T12:14:16.844-06:00Server 2008 and the IFD toolJust a quick note today - if you try to run the IFD tool for CRM on a 2008 server, it might not work. You will get no error, no warnings, but the settings will not be applied... unless you run the tool explicitly as an Administrator. UAC strikes again!Merlinhttp://www.blogger.com/profile/02482547439659897193noreply@blogger.com0tag:blogger.com,1999:blog-6114705942605734339.post-18671171948514124512009-12-02T13:15:00.003-06:002010-01-25T19:55:33.304-06:00Rollup 7 breaking workflow publishing?I can't be certain, but I think Update Rollup 7 for CRM is breaking my ability to publish workflows that contain email steps. So far I have encountered this twice, for two different customers, and it is really annoying. Fortunately, I have found the solution!<br /><br />The error that appears in the trace file (if you do a trace while attempting to publish the workflow) comes up something like this:<br /><blockquote><span style="font-size:85%;">>Crm Exception: Message: Workflow compilation failed:<br />WF1399: Activity 'SendEmailStep5_policy' validation failed: Property "RuleSetReference" has an invalid value. Rule set is invalid. Rule "main" validation failed. Type System.Globalization.CultureInfo is not marked as authorized in the application configuration file.<br />WF1399: Activity 'SendEmailStep7_policy' validation failed: Property "RuleSetReference" has an invalid value. Rule set is invalid. Rule "main" validation failed. Type System.Globalization.CultureInfo is not marked as authorized in the application configuration file., ErrorCode: -2147201023</span></blockquote><br />The error actually provides a clue as to the problem, but it wasn't entirely obvious to me. There is a line missing from the web.config file which, when added back, resolves the issue. The line is:<br /><blockquote><span style="font-size:85%;"><authorizedtype assembly="mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" namespace="System.Globalization" typename="CultureInfo" authorized="True"></authorizedtype></span></blockquote><br />I've just been adding it to the end of the list of authorized types for mscorlib. You don't even have to restart IIS - it just begins working as soon as you save the file. <br /><br />UPDATE: I had to put in the HTML escape characters for the brackets to show up in here - my apologies for the line not appearing before!Merlinhttp://www.blogger.com/profile/02482547439659897193noreply@blogger.com4tag:blogger.com,1999:blog-6114705942605734339.post-2540802593755718042009-10-30T14:33:00.002-05:002009-10-30T14:37:37.898-05:00SQL functions to convert between basesSo I had an application where I wanted to convert between decimal and hex values, and while I found a few ways to do this with SQL, they didn't really give me what I wanted (the varbinary datatype is NOT what I was looking for). The largest issue was that the way the javascript on my CRM form converted to hex and the way SQL converted to hex were apparently not the same, and it was very annoying.<br /><br />Thankfully, I found a couple of fantastic blog posts that help with this. Mr. Caldwell has created 2 functions for converting into and out of different bases, and they work wonderfully (and the same way that javascript does):<br /><a href="http://dpatrickcaldwell.blogspot.com/2009/05/converting-decimal-to-hexadecimal-with.html">Convert Decimal to any other base</a><br /><a href="http://dpatrickcaldwell.blogspot.com/2009/05/converting-hexadecimal-or-binary-to.html">Convert any base to Decimal</a><br /><br />Note that these are designed for SQL 2005 or above - I was able to apply one of the functions to SQL 2000 by changing the varchar(max) to varchar(255) (which was large enough for me.Merlinhttp://www.blogger.com/profile/02482547439659897193noreply@blogger.com3tag:blogger.com,1999:blog-6114705942605734339.post-12277910046540392052009-10-29T14:29:00.001-05:002009-10-29T14:31:00.394-05:00Cool script to display associated records in an iFrameI found a few of these scripts that applied to CRM 3.0, but for 4.0, this blog post has a simple and easy to configure script for displaying related records (like the contacts under an account) in an iFrame. You only need to change the values at the top and the script does the rest!<br /><br />http://mscrm4ever.blogspot.com/2009/05/crm-40-show-associated-view-in-iframe.htmlMerlinhttp://www.blogger.com/profile/02482547439659897193noreply@blogger.com0tag:blogger.com,1999:blog-6114705942605734339.post-59944639119739252812009-08-31T16:16:00.003-05:002009-08-31T16:56:59.650-05:00CRM Email Router and Forms AuthenticationOne of the single-most annoying issues when trying to get the CRM email router up and running is when you are trying to get the incoming connector to work and the OWA site in Exchange is set up to use Forms Authentication (which is nice for end users and doesn't work at all with the email router). The easiest solution I have found for Exchange 2007 is to simply create a second OWA site using Integrated Authentication and just use that for the email router, leaving the standard OWA site for end users and Forms Auth.<br /><br />To this end, I will refer to a blog post here: <a href="http://blog.networkfoo.org/?p=195">http://blog.networkfoo.org/?p=195</a><br /><br />This post has a list of handy PowerShell commands you can run to create the new site and all the information you need to configure it with the email router. This site has helped me a number of times, and I'm posting it here mostly as a bookmark for myself so I don't lose it again!<br /><br />In case this post ever goes away, the meat of the article is the following 4 commands (create a new IIS website FIRST):<br /><ul><li>New-OwaVirtualDirectory -OwaVersion:Exchange2007 -Name “owa” -WebSiteName “OWA-CRMRouter”</li><li>New-OwaVirtualDirectory -OwaVersion:Exchange2003or2000 -Name “Exchange” -WebSiteName “OWA-CRMRouter” -VirtualDirectoryType:Mailboxes</li><li>New-OwaVirtualDirectory -OwaVersion:Exchange2003or2000 -Name “Exadmin” -WebSiteName “OWA-CRMRouter” -VirtualDirectoryType:Exadmin</li><li>New-OwaVirtualDirectory -OwaVersion:Exchange2003or2000 -Name “Exchweb” -WebSiteName “OWA-CRMRouter” -VirtualDirectoryType:Exchweb</li></ul>There is also more information on this page:<br /><a href="http://technet.microsoft.com/en-us/library/bb124811.aspx">http://technet.microsoft.com/en-us/library/bb124811.aspx</a>Merlinhttp://www.blogger.com/profile/02482547439659897193noreply@blogger.com0tag:blogger.com,1999:blog-6114705942605734339.post-61925372637568322592009-08-19T15:48:00.005-05:002009-08-19T16:01:20.158-05:00Mappings between product line itemsSo this is a problem I've had to look up every time I have it, so I'm posting it here as a way to keep track. In order to map attributes between product line items (opportunity product to quote product to order product to invoice product), you have to access the secret mapping URL to set it up. Steps to perform:<br /><br />1. Find the GUID of the mapping you need to edit. In the Org_MSCRM database, run this query:<br /> <span style="color: rgb(255, 204, 102);">select * from entitymapbase where targetentityname = 'salesorderdetail'</span><br />Obviously, you might need to change the target entity value - the above will return all of the relationships where the order line item is the target. This returns a column that shows the "source entity name", so for a mapping from quote product to order product, pick the line where the source is "quotedetail". Copy the EntityMapId from this row.<br /><br />2. Enter the following URL into IE (modified with your servername):<br /><br /><pre class="FreeTextFull"><blockquote>http://<servername>[servername]/Tools/SystemCustomization/Relationships/Mappings/mappingList.aspx?mappingId=<guid>[GUID]</guid></servername></blockquote><servername><guid></guid></servername></pre>Be sure to replace your server name for CRM, and put the GUID from step 1 at the end.<br /><br />3. Create mappings and repeat as necessary!Merlinhttp://www.blogger.com/profile/02482547439659897193noreply@blogger.com0tag:blogger.com,1999:blog-6114705942605734339.post-69929116728956290462009-04-13T16:55:00.004-05:002009-04-13T17:00:00.555-05:00Unable to publish workflows after update rollupsI just encountered an interesting problem today where I was unable to publish a workflow - the friendly error message said "An error occurred when the workflow was being created. Try saving the workflow again". I found a handy discussion here: <a href="http://social.microsoft.com/forums/en-US/crm/thread/78a7f940-50de-4f83-a38d-54425dd0ec1c/">http://social.microsoft.com/forums/en-US/crm/thread/78a7f940-50de-4f83-a38d-54425dd0ec1c/</a> that explains the solution. This seems to have started with Update Rollup 2 (and in this case I just applied UR 3 last week) and just requires adding an assembly line to the web.config in the section <authorizedtypes>:<br /><br /><authorizedtype assembly="mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" namespace="System.Globalization" typename="CultureInfo" authorized="True"><br /><br />I didn't even need to reset IIS and the workflows started publishing again.Merlinhttp://www.blogger.com/profile/02482547439659897193noreply@blogger.com1tag:blogger.com,1999:blog-6114705942605734339.post-40203294282769034952009-04-07T13:49:00.002-05:002009-04-07T14:30:23.592-05:00SharePoint folder integrationCRM and SharePoint are natural companions - both are web-based applications, both use the same workflow engine (WinWF), and SharePoint provides a natural completion to CRM's abilities by providing document management. A great way to use this - documents attached to a specific CRM entity, such as agreements on an account, or perhaps customer-delivered documentation attached to specific opportunities. Most recently, I was asked to integrate with CRM campaigns, and use SharePoint as a location to store the creative, graphics, etc. that go along with a specific campaign. This way, when a user accesses a campaign in CRM, all of the relevant files will simply appear in an additional tab on the form, hosted inside an iFrame.<br /><br />In this case, I decided to store the documents for the campaign inside folders in the SharePoint document library - a folder for each campaign, all within a single library. I also decided that users won't need to access these folders from outside of CRM, so the name of each folder is simply the campaignid GUID to avoid duplicates or other problems. I also set up a special page to use in the iFrame that eliminates the SharePoint "chrome", giving me a bit more screen real estate to display the actual documents.<br /><br />So now to create the folders dynamically - I need to ensure a folder is created for each campaign automatically. The "standard" method for doing this was grabbed from someone else (sorry, I don't have a link) and involves using an ActiveX FileSystemObject control. This method accesses SharePoint via UNC path, checks to see if a folder by the right name is in the library, and creates one if it is not there. An example is here:<br /><br /><br /><span style="font-size:85%;"><span style="font-family: courier new;"></span></span><blockquote><span style="font-size:85%;"><span style="font-family: courier new;">var theIncidentId = crmForm.ObjectId;</span><br /><span style="font-family: courier new;">var oShell = new ActiveXObject("Scripting.FileSystemObject");</span><br /><span style="font-family: courier new;"> </span><br /><span style="font-family: courier new;"> if (! oShell.FolderExists("\\\\Netshare\\IncidentAttachments\\"+ theIncidentId) )</span><br /><span style="font-family: courier new;"> oShell.CreateFolder("\\\\Netshare\\IncidentAttachments\\"+ theIncidentId ) </span><br /><span style="font-family: courier new;"> else{</span><br /><span style="font-family: courier new;">}</span></span></blockquote><br /><br />Of course, you can use this code to access any fileshare - this is certainly not limited to SharePoint only. However, the fact that SharePoint document libraries are accessible via UNC means you can use this same functionality with SharePoint and it works great...<br /><br />...Unless you can't get UNC access to SharePoint. This might occur for a few reasons - if SharePoint is not installed on port 80, or maybe if you use a proxy between the end computer and SharePoint, or if using an IFD, or if you are using SharePoint Online. In my case, I couldn't get to SharePoint for an unknown reason via UNC, so rather than troubleshooting SharePoint (which I don't really have control over) I decided to look into an alternative - using the SharePoint web services.<br /><br />My inspiration came from here: <a href="http://blogs.msdn.com/crm/archive/2006/10/23/creating-folders-in-sharepoint-document-libraries.aspx">http://blogs.msdn.com/crm/archive/2006/10/23/creating-folders-in-sharepoint-document-libraries.aspx</a> . Their example used a callout, but this proved that the functionality was available in SharePoint. I had another example that involved finding a user's roles using a call to the CRM webservices (<a href="http://jianwang.blogspot.com/2008/01/crm-40-check-current-users-security.html">one example is here</a> - there are others) . I realized that both ends of the process were there - I simply needed something to bridge the gap and access SharPoint via webservice to create the new folder. Lucky for me, I was able to find a <a href="http://darrenjohnstone.net/2008/07/22/examples-for-the-sharepoint-and-office-live-javascript-api/">helpful blog by Darren Johnstone</a> that had created all of the javascript needed to talk to SharePoint - I just needed to modify it a bit and use it with CRM. Since Mr. Johnstone had broken the real work out into his classes, I had to do a bit of reverse-engineering to pull it back into an in-line function to make it work with CRM. The end result creates the folder in SharePoint with the webservices just like the FileSystemObject would, but now it will work with SharePoint anywhere! The only issue I haven't worked out yet is how to CHECK for the folder before attempting to create it, so right now I just let it error itself out (SharePoint won't create a duplicate folder) and ignore it. This could become a larger problem later, but it works for me for right now. <br />The final code is below:<br /><blockquote><br /><span style="font-size:85%;"><span style="font-family: courier new;">// Only run code on Update forms<br />if(crmForm.FormType == 2)<br />{<br />var objectId = crmForm.ObjectId;<br />objectId = objectId.replace(/[{}]+/g,'');<br /><br />// The service URL should go to the site with the document library<br />var varServiceUrl = "http://sharepoint/SiteName/Marketing/_vti_bin/lists.asmx";<br /><br />// This function takes the doc library name and the name of the new folder<br />// You can also pass a third parameter to specify a root folder<br />var res = createFolder("CRMIntegration", objectId);<br /><br />// Error catching, which I am currently ignoring<br />// if (res.status == 200)<br />// {<br /> crmForm.all.IFRAME_SPDocs.src = "http://sharepoint/SiteName/Marketing/CRMIframe/CampaignCreative.aspx?RootFolder=%2fSiteName%2fMarketing%2fCRMIntegration%2f" + objectId + "&FolderCTID=&View=%7bE2F9780A%2d0546%2d4254%2d92EA%2d31B1A584914E%7d";<br />// }<br />// else {<br /><br />// alert("error creating folder: " + res.statusText);<br />// }<br />}<br /><br /><br />// Functions to support SharePoint folder creation<br /><br />// Creates batch XML file for new folder<br />// (Includes optional rootFolder parameter - see Darren Johnstone's blog for usage)<br />function createFolder(listName, folderName, rootFolder)<br />{<br /> var batch;<br /> batch = "<Batch OnError='Continue'"<br /> if (rootFolder != null)<br /> {<br /> batch += " RootFolder='" + rootFolder + "'";<br /> }<br /> batch += ">";<br /> batch += "<method id="'1'" cmd="'New'">"<br /> +"<field name="'FSObjType'">1</field>"<br /> +"<field name="'BaseName'">" + folderName + "</field>"<br /> +"</method>"<br /> +"</batch>";<br /> return updateListItems(listName, batch);<br />}<br /><br />// Delivers message to SharePoint<br />// (Eliminated dependance on javascript classes)<br />function updateListItems(listName, updates)<br />{<br /> var oXMLHttpRequest = new ActiveXObject("Microsoft.XMLHTTP");<br /> var result = null;<br /> var resultName;<br /> <br /> oXMLHttpRequest.open("POST", varServiceUrl, false);<br /> oXMLHttpRequest.setRequestHeader("Content-Type", "text/xml; charset=utf-8");<br /> oXMLHttpRequest.setRequestHeader("SOAPAction", "http://schemas.microsoft.com/sharepoint/soap/UpdateListItems");<br /> <br /> var packet = ["<?xml version='1.0' encoding='utf-8'?>",<br /> "<soap:envelope xsi="\" xsd="\" soap="\">",<br /> "<soap:body>",<br /> "<updatelistitems xmlns="\">",<br /> "<listname>",<br /> listName,<br /> "</listname>",<br /> "<updates>",<br /> updates,<br /> "</updates>",<br /> "</updatelistitems>",<br /> "</soap:Body>",<br /> "</soap:Envelope>"<br /> ].join("");<br /> <br /> oXMLHttpRequest.send(packet);<br /> <br /> resultName = "UpdateListItems";<br /> var resBatch;<br /> var status;<br /> var statusText;<br /> <br /> status = oXMLHttpRequest.status;<br /> statusText = oXMLHttpRequest.statusText;<br /> <br /> if (status == 200)<br /> {<br /> // Check for SharePoint error code<br /> resBatch = oXMLHttpRequest.responseXML.getElementsByTagName(resultName);<br /> <br /> var codeEl = oXMLHttpRequest.responseXML.getElementsByTagName('ErrorCode');<br /> <br /> if (codeEl != null && codeEl.length > 0)<br /> {<br /> var spStatus = parseInt(codeEl[0].childNodes[0].nodeValue);<br /> <br /> if (spStatus != 0)<br /> {<br /> status = 0-spStatus; // Note we make this -ve to prevent confusion with the HTTP code<br /> <br /> var messageEl = oXMLHttpRequest.responseXML.getElementsByTagName('ErrorText');<br /> if (messageEl != null && messageEl.length >= 0)<br /> {<br /> statusText = messageEl[0].childNodes[0].nodeValue;<br /> }<br /> }<br /> }<br /> }<br /> <br /> result = {<br /> status : status,<br /> statusText : statusText,<br /> responseXML : oXMLHttpRequest.responseXML,<br /> responseText : oXMLHttpRequest.responseText,<br /> resultNode : (resBatch == null || resBatch.length == 0 ? null : resBatch[0])<br /> };<br /> return result;<br />}</span></span></blockquote>Merlinhttp://www.blogger.com/profile/02482547439659897193noreply@blogger.com1tag:blogger.com,1999:blog-6114705942605734339.post-26276344942069635112009-04-01T12:12:00.004-05:002009-04-01T13:44:36.713-05:00Recurring AppointmentsAnyone who has been using CRM for a while knows that there is no support (at this time) for recurring appointments. However, with the fantastic workflow engine in v4.0, it is possible to simulate the functionality of a recurring appointment, without actually creating them in the same fashion as Outlook allows.<br /><br />The first step in creating this functionality is to create a couple of extra fields on the appointment - one to specify the recur timeframe, and one to hold a date value. The recurrence field in my case was a picklist of yearly, quarterly, monthly, weekly. When set, this triggers the workflow. The date value will help us later in preventing a runaway workflow process.<br /><br />Now we can create our workflow. For my sample, I triggered the workflow when the appointment was created, and checked for a value in the recurrence field - if nothing is there I know this is not a recurring appointment and the workflow stops. Next, I checked my date field. The purpose of this field is to hold the date (and time) of the original appointment record - the one that is triggering the recurring appointment. Because I don't want this workflow to enter an endless loop, I wanted to wait for the date of the originating appointment to pass before I create my next appointment in the future. This prevents each subsequent appointment from triggering its own workflow and continuing ad infinitum.<br />So my next step is to see if my custom date field contains any data. If it does not, I know this is the first appointment in the series, and I can create the next in the series and stop. If it does, then I need to wait for that date to pass before creating the next in the series.<br /><br />Finally we get to the obvious part - for each value in my recurrence picklist, I simply have to specify the criteria for creating the next appointment. For example, if this field is set to "weekly" then I need to add 7 days to the appointment date fields when creating the new appointment. I also have to remember to set the original appointment date into my custom date field for use above. Everything else I copied over directly.<br /><br />The end result is that I now have a rolling cycle of 2 appointments in my series. The next to occur has already completed its workflow (it created #2 in the future) , while the second in the series is waiting for the date of the first one to pass before it creates the next in the series and stops, and so on. As each appointment passes, the second in the series becomes the next, and it creates its own successor to repeat the process.<br /><br />This workflow functions pretty well, but there are of course some limitations. If you need to make a change to the appointment, you have to make sure to change the second in the series, or that change won't get copied into any new appointments. You are also limited to only these two appointments in the series - if you have a weekly recurring appointment you will only see the next two weeks. Checking your calendar 2 months in advance won't show the appointment at all. You also have to set the recurrence field from the CRM appointment window and on a new appointment for anything you already have set up in Outlook (the Outlook client will not allow recurring appointments to be tracked at all). Limitations aside, however, this is a pretty decent workaround.<br /><br />Enjoy!Merlinhttp://www.blogger.com/profile/02482547439659897193noreply@blogger.com0tag:blogger.com,1999:blog-6114705942605734339.post-52522261168708960452009-04-01T11:48:00.000-05:002009-04-01T11:55:28.171-05:00Yes, another Microsoft CRM blogI have been working with Microsoft's CRM product since version 1.2. Over the years, I have been excited with each new release of the product and the capabilities provided to me as a customizer as well as to the businesses that use the software. In its current incarnation, version 4.0, CRM has become a very powerful relationship management tool. More than simply tracking customers and sales (essentially all you could do in v1.2), v4.0 is simply a convenient and easy-to-use interface for a relational database - and you can use this database to track any information your business needs. With this most recent version, the database aspects are, in my opinion, essentially complete - you can map out your data in almost any way you desire. The next version(s) of the product simply need to focus more on displaying and working with that data in even more ways to meet the needs of an even greater segment of the business world.<br /><br />I am beginning to blog about CRM because I would like to document and share my experiences with the product, both from a business standpoint and from a technical perspective. I think Microsoft CRM is a fantastic product that can do almost anything, and I intend to prove it here!Merlinhttp://www.blogger.com/profile/02482547439659897193noreply@blogger.com0