Setting a default value on a lookup field in Microsoft Dynamics CRM 4.0 October 27, 2009
Posted by jarrettexpertcrm in Microsoft CRM General.Tags: crm, microsoft crm, crm tips, Microsoft CRM 4.0, Dynamics4, Dynamics Four, Microsoft, jscript, look up fields
4 comments
I got a request to set the “Unit” on an Opportunity Product to always default to “Primary unit” when a product is created. Setting default values on lookup fields seems to be a common request, so i decided to post the code to achieve this. This is an Onload Event.
//Create an array to set as the DataValue for the lookup control.
var lookupData = new Array();
//Create an Object add to the array.
var lookupItem= new Object();
//Set the id, typename, and name properties to the object.
lookupItem.id = ‘{299F37C4-6D9D-4628-ADF9-9479A6F209BA}’;
lookupItem.typename = ‘uom’;
lookupItem.name = ‘Primary Unit’;
// Add the object to the array.
lookupData[0] = lookupItem;
// Set the value of the lookup field to the value of the array.
crmForm.all.uomid.DataValue = lookupData;
If you want to use this code for other lookups, here is what you need to change:
//Create an array to set as the DataValue for the lookup control.
var lookupData = new Array();
//Create an Object add to the array.
var lookupItem= new Object();
//Set the id, typename, and name properties to the object.
lookupItem.id = ‘{Fields Guid}’;
lookupItem.typename = ‘Entity Name’;
lookupItem.name = Lookup Value;
// Add the object to the array.
lookupData[0] = lookupItem;
// Set the value of the lookup field to the value of the array.
crmForm.all.FieldName.DataValue = lookupData;
Enjoy!!
For more information about Dynamics Four you can contact us at http://www.dynamics4.com
Hiding multiple tabs based on picklist value in Microsoft CRM 4.0 October 5, 2009
Posted by jarrettexpertcrm in Microsoft CRM General.Tags: crm, microsoft crm, crm tips, Microsoft CRM 4.0, Dynamics4, Dynamics Four, Microsoft, hiding tabs, jscript, hiding tabs at runtime
add a comment
Being able to hide tabs until a certain value is selected in a picklist is becoming a common request. So i decided to post how you can accomplish that. Apply this code on the onload and onchane events (replace with your field names).
if
(crmForm.all.new_fieldname.DataValue == 1)
{
crmForm.all.tab1Tab.style.display = ‘none’;
crmForm.all.tab2Tab.style.display = ‘none’;
crmForm.all.tab3Tab.style.display = ‘inline’;
crmForm.all.tab4Tab.style.display = ‘inline’;
crmForm.all.tab5Tab.style.display = ‘none’;
crmForm.all.tab6Tab.style.display = ‘none’;
crmForm.all.tab7Tab.style.display = ‘none’
}
else if
(crmForm.all.new_fieldname.DataValue == 2)
{
crmForm.all.tab1Tab.style.display = ‘none’;
crmForm.all.tab2Tab.style.display = ‘none’;
crmForm.all.tab3Tab.style.display = ‘inline’;
crmForm.all.tab4Tab.style.display = ‘none’;
crmForm.all.tab5Tab.style.display = ‘inline’;
crmForm.all.tab6Tab.style.display = ‘none’;
crmForm.all.tab7Tab.style.display = ‘none’
}
else if
(crmForm.all.new_fieldname.DataValue == 3)
{
crmForm.all.tab1Tab.style.display = ‘none’;
crmForm.all.tab2Tab.style.display = ‘none’;
crmForm.all.tab3Tab.style.display = ‘inline’;
crmForm.all.tab4Tab.style.display = ‘none’;
crmForm.all.tab5Tab.style.display = ‘none’;
crmForm.all.tab6Tab.style.display = ‘inline’;
crmForm.all.tab7Tab.style.display = ‘none’
}
else if
(crmForm.all.new_fieldname.DataValue == 4)
{
crmForm.all.tab1Tab.style.display = ‘none’;
crmForm.all.tab2Tab.style.display = ‘none’;
crmForm.all.tab3Tab.style.display = ‘inline’;
crmForm.all.tab4Tab.style.display = ‘none’;
crmForm.all.tab5Tab.style.display = ‘none’;
crmForm.all.tab6Tab.style.display = ‘inline’;
crmForm.all.tab7Tab.style.display = ‘none’
}
For more information about Dynamics Four or to contact us please visit http://www.dynamics4.com
Microsoft CRM 4.0 in Firefox August 15, 2009
Posted by jarrettexpertcrm in Microsoft CRM General.Tags: crm, microsoft crm, crm tips, Microsoft CRM 4.0, Dynamics4, Dynamics Four, Microsoft, firefox, firefox and crm
add a comment


For those Microsoft CRM users that prefer using Firefox as your browser, this post is for you. First you need to install the IE tab add- on https://addons.mozilla.org/en-US/firefox/addon/1419.
Once the install is done you will be prompted to restart Firefox. Once restarted go to your CRM site and right click on screen and select “view page in IE tab” and thats it!
For more information about Dynamics Four or to contact us please visit http://dynamics4.com
Showing records when offline in Microsoft CRM 4.0 Outlook Client August 4, 2009
Posted by jarrettexpertcrm in Microsoft CRM General.Tags: crm, microsoft crm, crm tips, Microsoft CRM 4.0, Dynamics4, Dynamics Four, Microsoft, Outlook Client. Offline sync
add a comment

Ever wonder why when going offline with the Microsoft CRM 4.0 Outlook Client you can only see records that you own? I made a video and and put it on youtube, Hopefully this video will shed some light.
For information about Dynamics Four or to contact us please visit http://dynamics4.com
Microsoft CRM 4.0 VPC July 23, 2009
Posted by jarrettexpertcrm in Microsoft CRM General.Tags: Microsoft crm 4.0 vpc
add a comment

For those of you looking to test Microsoft CRM 4.0 in a virtual environment, this post is for you. The Microsoft CRM VHD we will be using is from Litware Inc. The first step will be to download Microsoft Virtual PC 2007 http://www.microsoft.com/downloads/details.aspx?FamilyId=04D26402-3199-48A3-AFA2-2DC0B40A73B6&displaylang=en. Once downloaded go through the set up wizard. Now its time to download the CRM VHD, this can be found at http://www.microsoft.com/downloads/details.aspx?FamilyID=dd939ed9-87a5-4c13-b212-a922cc02b469&displaylang=en. Download all 8 files, i recommend creating a folder to store these.
After all files are downloaded, start up your Microsoft VPC. A set up wizard will come up, this is where you will configure your VPC. 
Click “next” then select “Create a virtual machine”. Next step is to give your virtual machine a name. Click next. Select the operating system (Server 2003) and click next. You can use the recommend RAM or adjust it to what you want. Click next. Select “An existing virtual hard disk” . Browse to where you saved the files and select the one that appears then click finish. Now you are able to start your VPC. After it starts it should look like this. 
Open up Microsoft CRM and enjoy! 
This is just for demonstration purposes, its available only for a few days.
For more information about Dynamics Four or to contact us please visit our site www.dynamics4.com.
Creating an IFRAME for Accounts to store Leads notes when converting in Microsoft CRM 4.0 July 18, 2009
Posted by jarrettexpertcrm in Microsoft CRM General.Tags: crm, crm tips, Dynamics Four, Dynamics4, microsoft crm, Microsoft CRM 4.0
add a comment

I have had quite a few clients asking if it was possible to bring over the leads notes when converting to an account. In this post I will explain how to do that. The first step is to go to Settings\Customizations\Customize Entities\select the account entity. On the window that comes up select “forms and Views”, then select “Form”. The next step is to create a section to put your IFRAME, I titled mine “Lead Notes” Next select “add an IFRAME” from the right common tasks. Under name type “LeadNotes”, URL type “about:blank”, select the check box under the URL as well. Under Security uncheck the box “Restrict cross-frame scripting”. Click OK.

Now that you have the IFRAME on your form you can apply the code. Click on Form Properties, on the window that pops up make sure “onload” is highlighted and click Edit. This is going to bring up the window where you need to apply the code. Insert this into the text box:
var lookupItem = new Array;
lookupItem = crmForm.originatingleadid.DataValue;
if (lookupItem != null)
{
crmForm.all.IFRAME_LeadNotes.src=”/_controls/notes/notesdata.aspx?id=”+ lookupItem[0].id + “&ParentEntity=3&EnableInlineEdit=false&EnableInsert=false”;
}
else
{
crmForm.all.IFRAME_LeadNotes.src=”about:blank”;
}
check the box “Event is Enabled” then click OK, save and close, and then publish.

When you convert a lead to an account that had notes it should now look like this:

I presented this demonstration using Litware Inc’s Microsoft CRM VPC. This is an excellent solution for those who want to test Microsoft CRM on a virtual pc.
For more information about Dynamics Four or to contact us please visit www.dynamicsfour.com
Windows 7 and Microsoft CRM 4.0 Online July 15, 2009
Posted by jarrettexpertcrm in Microsoft CRM General.Tags: crm, crm tips, Dynamics Four, Dynamics4, microsoft crm, Microsoft CRM 4.0, Windows 7
add a comment

As some of you windows 7 beta testers may know, when Windows 7 beta was released Microsoft CRM 4.0 Online was not fully compatible. For starters Outlook Client would not work. When selecting an item in CRM it would be blocked by a pop up blocker, adding it to your safe sites still did not help. Web Client on the other hand had different issues. For starters drop downs would not work when building workflows and custom entities. These problems were due to Internet Explorer 8. With Windows 7, to my knowledge, you are not able to run anything other then ie8. I am currently running Windows 7 build 7100 RC and all problems appear to be cleared! So if you are interested in running Windows 7 go for build 7100 RC. http://www.microsoft.com/windows/windows-7/download.aspx.
For more information about Dynamics Four or to contact us please visit www.dynamics4.com.
Microsoft’s President’s award for Dynamics Four! July 14, 2009
Posted by jarrettexpertcrm in Microsoft CRM General.Tags: crm, Dynamics Four, Dynamics4, Microsoft, microsoft crm, Microsoft CRM 4.0, Microsoft's President's Award
add a comment

I am proud to say that some of my colleagues are in New Orleans to accept the President’s Award on behalf of Dynamics Four.
For more information about Dynamics Four or to contact us please visit www.dynamics4.com