Friday, November 20, 2009

Change the default entity in Lookup Window

For instance, in Opportunity form of Microsoft CRM if you want to change the “Potential Customer” field’s default entity from Account to Contact. You need to use the following piece of code in onLoad event of the Opportunity Form.

if ( crmForm.all.customerid != null )
{
    crmForm.all.customerid .setAttribute(”defaulttype”, “2″);
}

Remember to enable the event and then save and publish the opportunity entity.
 Following are codes of basic entities of Microsoft CRM 3 ;
  • Account    1
  • Contact     2
  • Lead         4
Thanks to Umar for pointing out this.

Happy Coding...

Labels: , , , , , ,

Multiple Column Sort in Dynamics CRM


Take a look at one of your views.
Select a Column so that the system is sorting on that column
Now move to another column and using the SHIFT, CNTL, MOUSE CLICK you can setup a secondary sort
Now move to another column and do it again..
Guess what: You now have three columns set to sort
So the question of the day then becomes. Which is the primary ?

Labels: , , , ,

Display a Google Map for an Account

Find the below code to add google map for an account in Dynamics CRM 4.0.

Make a new tab with an iFrame, add a custom bit value (yes or no radio buttons) called "shmap" and add this code as an onchange event.


if (crmForm.all.address1_postalcode.DataValue != null){
crmForm.all.IFRAME_gmap.src = "http://maps.google.com/maps?q=" +
crmForm.all.address1_line1.DataValue + "+" + crmForm.all.address1_city.DataValue + ",+" + crmForm.all.address1_postalcode.DataValue;
}
else
{
crmForm.all.IFRAME_gmap.src = "about:blank"
}

Thanks to Glen..

Happy Coding...

Labels: , , , , ,

ASP.NET Application Deployment Resources

Deployment is the process of distributing a completed application or component to be installed on other computers. Microsoft® ASP.NET is designed to make Web application deployment easy.
Explains how to distribute all files associated with your ASP.NET application to a production server.
Explains how to compile and distribute component assemblies to your ASP.NET application's \Bin directory.
Explains the global assembly cache and how to distribute shared component assemblies to it.
Explains how to distribute compiled assemblies that contain classes that implement the IHttpHandler and IHttpModule interfaces. This includes required configuration settings for including new HTTP handlers and HTTP modules in your application.

Happy Coding...

Labels: , , , , , ,

Visual Studio Error: The project file ' ' has been renamed or is no longer in the solution.

If you ever got this message "Visual Studio Error: The project file ' ' has been renamed or is no longer in the solution." while building a web application, probably you might have added an silverlight project to your solution earlier and removed it.

The cause for this problem is, visual studio removes the silverlight project from your solution when we delete that but the reference it created while adding that project will still exist.

So we have to manually remove the reference to that project.

It will be removed from the project properties window, silverlight projects tab.

Remove the unwanted references related to the projects which you removed from the solution.

Thats it, now you can build your web application.

Happy Coding...

Labels: , , , , , , ,