Monday, February 16, 2009

Shortcut to open any record in CRM

There are a couple of generic urls that would let you open any type of record in CRM

  • If you need to open any type of record but don't know the URL. No worries just specify object type code (you can get object type code from CRM SDK under section" Entity Type Codes") and ID it will open your record. (Note that the parameter names are case sensitive here)

http://server:port/organization/CRMReports/viewer/drillopen.aspx?ID=objectid&OTC=objecttypecode

  • To open a record in ReadOnly mode

http://server:port/organization/_forms/readonly/readonly.aspx?objTypeCode=objecttypecode&id=objectid

You can call these from anywhere in CRM and it will identify the entity and open the relevant entity form. This does away the need or specifying url specific to the entity.

Shortcut to create activities for an account or contact

CRM Forms already have a button to quickly send an email. The "Follow up" button allows you to quickly create activities, however it does not show up the entire activity form.
If you instead wanted a way to create a task or some other activity and want the activity form to show-up without navigating to the Activities pane and click on New and select the appropriate entity, here is the code that will help


  • Send Email: locAddActTo(4202); // where 4202 = objecttypecode

  • Create Task: locAddActTo(4212)

The entire list of ObjectTypeCode for all entities in CRM can be found in the SDK

Friday, February 13, 2009

Shortcut to Add notes and attachments

You need to navigate to the Notes tab each time you need to add a note. Also the shortcut to add a quick note in CRM does not show up the note form that allows to fill in all details including subject and attachment in one go. If you want to add all information to the note it would involve atleast a couple or more of clicks to get all done.
You can add convenient shortcuts to add notes without having to navigate to the Notes tab and save a few clicks.


  • add a note : locAddObjTo(5); This will open up the new note form

  • attach a file : locAddFileTo(5); This will bring up the attach file form.

Shortcut to add new records for related entities

CRM navigation especially for adding related entities like activities/Contact/Quote Products etc is quite tedious and time consuming. You can add a shortcut for most of these on the main form and save quite a few clicks in the process.

First decide for which entity you need to add "Shortcut" button like if I need to create shortcut for "Existing Order Products" on order form.

So you need to create first URL. You can find URL by pressing CTRL+N on a form for which you need to create shortcut.


URL for adding existing order product:

/orgname/sfa/salesorderdetail/edit.aspx?_CreateFromType=&_CreateFromId=&locked=0

URL for adding write-in order product:

/orgname/sfa/salesorderdetail/edit.aspx?_CreateFromType=&_CreateFromId=&isproductoverridden=1

  • Every entity has an ObjectTypeCode associated with it. You can get the complete list in the SDK.

  • ObjectId above refers to the current entity id for which the child needs to be added.


You can add ISV button like shown in below on the Order entity,

<Button Icon="/_imgs/ico_18_1089.gif" JavaScript="window.open('/' + ORG_UNIQUE_NAME + '/sfa/salesorderdetail/edit.aspx?_CreateFromType=' + crmForm.ObjectTypeCode + '&amp;_CreateFromId=' + crmForm.ObjectId + '&amp;locked=0','my_ex_item_window','width=900,height=600,toolbar=no,status=yes,scrollbars=yes,resizable=yes')" PassParams="0" WinParams="" WinMode="0">

<Titles>

<Title LCID="1033" Text="Existing Item" />

</Titles>

<ToolTips>

<ToolTip LCID="1033" Text="Add existing order product" />

</ToolTips>

</Button>

Wednesday, February 11, 2009

Product/Inventory Kits in Dynamics CRM and its utilization

Dynamics CRM provides for setting up of "Kits". Kits are basically a group of items that are sold together always. Just like you can associate substitute items with a product, it is possible to associate all products that make up the Kit. The "Kit Products" option is only available for "Kit" type of items.

While this is not directly made available as a type of product like "Sales
Inventory", "Services" etc, it can be found as an option under More Actions
--> Convert to Kit


Once a product is converted to Kit it is possible to convert it back to "Product". A similar option as above called "Convert to Product" is available for Kit Products.

The Kit product is available just as any other product for selection in Opportunities/Quotes/Orders/Products.



One feature though missing and would truly help was if there was a way to determine the price of the Kit based on the price of its components. And if it were possible to explode the kit and have the individual components listed on the Quote (if someone needed to list out the components being supplied in the kit).

To overcome the above shortcoming of updating the price of the Kit based on the price of its components we proposed the following solution to one of our clients.

1. Write a Post-Update plugin on the Price List Item entity.
2. The plugin would read the Product, Unit and Price List from the Price list item.
3. With the Product and Price List in hand, search if this Product is a part of kit and if so, re-calculate the price of the Parent Kit product.


The following messages of the SDK would be helpful when dealing with Kits
* ConvertKitToProductRequest
* ConvertProductToKitRequest
* AddProductToKitRequest
* RemoveProductFromKitRequest


FilteredProductAssociation is the view that stores the list of Products that belong to a kit. There is no entity available called ProductAssociation that you can make an object of directly. But using link entity in query expression and linking it to ProductAssociation would work.