Thursday, May 28, 2009

Implementing Title Case using Java Script

Today I recieved a query to implement title case for the name fields in CRM.
This can simply be achieved by writing a custom Java Script method as below:
Add this code on the OnChange event of First Name attribute in Contact:

// JScript source code - TitleCase
var strTitleCase
var str = crmForm.all.firstname.DataValue
str.Substring(toUpperCase();
if(str != null)
{
strTitleCase = toTitleCase(str);
crmForm.all.firstname.DataValue = strTitleCase;
}
function toTitleCase(str)
{
return str.replace(/\w\S*/g, function(txt){return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();});
}

Wednesday, May 13, 2009

Setting up the Product Catalog

Hi All,
It is sometimes really confusing to setup the product catalog in MSCRM, how the current prices are calculated in the quotes depending upon the discount lists, unit groups and price lists
So, hoping this article will be beneficial in clearing doubts.
Product catalog Consists of 4 areas:-
- Discount List
- Unit Groups
- Price lists
- Products

*** It is recommended, to set up the areas in the order Listed.

Discount List
It allows discounts to be given based on quantity.
Discount list items can be set up as:
Beginning Quantity Ending Quantity Percentage Discount 1,000 5,000 3.50 5,001 25,000 5.00 25,001 100,000+ 7.50
You can create as many discount lists as necessary and, although not required, associate them with different price lists and price list items.

Unit Groups
The typical example of unit groups is a can of soda. It is possible to purchase a single can, a 6-pack, and a case consisting of 12 or 24 cans, etc.
Each of these quantities consists of a primary/base unit. For example list items can be set up as:
Name Base Unit Quantity Single Single 1 Small Pack-6 Single 6 Large Pack-24 Small Pack-6 4
Unit Groups are associated with products, as well as the default unit for the product.

Price List
Price lists make up groupings of products with associated pricing lists (like Standard Price list, default price list, or similar).
Each price list item can be associated with a product of a specific unit group item and a specific discount list as chosen.
Pricing method field in the price list item form decides how the price for a particular product will be calculated.
Pricing method options:
- Currency Amount
This option uses a fixed amount.
- Percent of List
This option uses a percent of the list price.
- Percent Markup - Current Cost
This option uses a percent of the markup on the product's current cost. The percent markup can range from 0 to 99,999.99 percent.
- Percent Margin - Current Cost
This option uses a percent of the margin on the product's current cost. The percent margin can range from 0 to 99.99 percent.
- Percent Markup - Standard Cost
This option uses a percent of the markup on the product's standard cost. The percent markup can range from 0 to 99,999.99 percent.
- Percent Margin - Standard Cost
This option uses a percent of the margin on the product's standard cost. The percent margin can range from 0 to 99.99 percent.

Amount
If you selected Currency Amount from the Pricing Method list, type the amount. This is a monetary amount and must be a number between 0.00 and 1,000,000,000.00
Percentage
If you selected any value from the Pricing Method list other than Currency Amount, type the percentage for the pricing method that you want

Product
Each product can be associated with price lists, a unit group and a default unit.
So, when we use a particular product in any form, we can extract the product information like current associated price depending up on the price list which in turn is associated with the default unit of a particular unit group and also on the discount list (depending up on the quantity).
Below are the essential pricing values that are provided during the set up of a product:
List Price
This is a monetary amount that is based on the list or sales price
Standard Cost
This is a monetary amount that is based on the typical cost of the item.
Current Cost
This is a monetary amount that is based on the current or temporary cost of the item.

Note: Depending up on the pricing method selected while creating price list item for a particular product and the above mentioned prices of the product, the total price value for the quote, order, and invoice is calculated.

Example: Consider a product of current cost $1000. The pricing method selected in the associated price list item is “Percent Margin - Current Cost “and the percentage field value is 10%. So, when a quote is created with this product as the quote product, the total price for the quote is calculated from the above mentioned details. For e.g. If the ‘unit’ selected is the primary unit (one) and the quote quantity is 1, the calculated price value becomes:-
10% of $1000 + $1000 = $1100.
If any discount is there in the discount list, associated with the product, it will be discounted from the above mentioned total price.