Skip to main content

Posts

Showing posts from 2009

MSMQ Processing Fails

This occurred when upgrading the Scribe integration product, along with changing the connection settings to a test environment. In this process, MSMQ messages were critical in processing the publisher bridges that create and pass XML messages to a hosted service. The queue for the message service was unable to process them due to the update, and ended up filling the queue, in several private message queues. The total amount of messages was over 1 GB. You can clear the messages from the MSMQ MMC, but if the process is failing due to resources, which this was, it will create dead-letter messages which have to be addressed. Backup the .mq files Note Before you run MQbkup.exe, select a folder to which you will back up the Message Queuing files. This folder must be located on a disk that has at least 2.5 GB of available space. Open a Command Prompt window. Change the directory to %WinDir%\System32. Run the following command: MQbkup.exe -b Drive :\ Folder to Put Backup Files Note t

Adding and Populating a N:1 Relationship

We need to create a way to capture the global parent account on the account entities for reporting. Since the accounts were already created, this would need to be enforced after the fact. This solution will work if you need to create a data relationship for any fields you want to add. It is not an elegant solution, but it works. The attribute or field that was created needed to have a relationship tied to the account. So, I created a many to 1 (N:1) attribute to hold the global parent f ield. I made this field a business recommended, as it would be on all forms. The workflow, that I will explain later, can be set to fire on an account create action to tie the created account to the global parent account. Here are the settings of the attributes. Since there was already a parental relationship set with the account entity, a referential enforced relationship would have to be created. In t his instance, this will be fine, as we do not want a tied record to be altered if the global pa

Change the CRM Loading Icon

Use this at your own risk. Ever want to change the loading icon from the green circle... to something more interesting? Well I found a great loading icon for CRM over at Ascentium, http://consulting.ascentium.com/blog/crm/Post189.aspx . Goto your CRM webserver, and open \CRMWeb\_imgs\AdvFind in Windows Explorer. Make a copy, or rename progress.gif. Save the graphic above as progress.gif to that directory. Clear your IE cache and the new icon will appear when you perform search or loading functions.

Script - Detecting OS Architecture

If you need to run different commands depending if the OS is 32 Bit or 64 Bit, you can insert the code below into your script. REM Check OS architecture ECHO %processor_architecture% | FIND "x64" IF ERRORLEVEL 1 (GOTO 64BIT) ELSE (GOTO 32BIT) :64BIT Insert your 64 Bit commands here GOTO EXIT :32BIT Insert your 32 Bit commands here GOTO EXIT :EXIT exit

Simple code to pull CRM info from PreImageEntity

This is simple code that I used in the process of a larger project that I am performing with CRM and SharePoint. I am used to using the dynamic entity class to pull any info I need in the post stage of a plug-in for use in my code. I was getting an issue where the plug-in would fire on an update method and it would kick back an error "The given key was not present in the dictionary". This is from the way I was trying to pull the attributes. Not being familiar with C#, it took me a while to find a solution for this. Browsing the web and the CrmSdk, I came across a method I could use, PreImageEntity and PostImageEntity, with the CRM Plug-In Registration tool. Code: public void Execute(IPluginExecutionContext context) { //Grab the account name from a preimage named "AccountEntity" DynamicEntity AccountEntity = (DynamicEntity)context.PreEntityImages["AccountEntity"];   //PreEntity passes values as an object so, force accountName variable as a strin

Restrict CRM 4.0 Form Fields via JavaScript

Recently had an issue where a series of calculated custom fields were inserted by a VAR, which would calculate the opportunity forecast value and another value for a forecast probability value. Code was placed on the OnLoad(), to perform this action, but changes to this form would not save. So users could edit further percentages, but reports and views would not reflect the new value. What I discovered, is that these fields were locked from saving data, as they were marked as read only. This was strange behavior, as new opportunities did not suffer from this, and the code that resided in the OnLoad() event was not coded to take account for only updates or create. I came across this post: , dealing with CRM 3.0. As a result, I customized the fields that were read only to normal. I then added this code to my OnLoad() event, to the Opportunity form, to disable the fields. var CRM_FORM_TYPE_CREATE = 1; var CRM_FORM_TYPE_UPDATE = 2; //Adjust the display of the calculated fields to inline //