Price List selection logic available starting Dynamics CRM 2015 Update 1

By | August 27, 2015

Introduction

Traditionally Price List in any of the transactions like Opportunities, Quote, Orders or Invoices was set by reading it from Customer. If there was no price list set for the customer, it would be left blank and the user would be required to set it manually. Price List is critical and needs to be set since the line items on these transactions depend on the Price List selected. You are only able to add Products that have prices defined in the selected price list.

With the new release Microsoft has shipped in automation to process of setting Price List on these.

Price List Based on Territory

Another way to associate Price List that has been introduced in Update 1. In this Price List needs to be associated with Territory and User is associated with a Territory. The Price List would be set based on the logged in user’s territory if there is no default Price List set for the customer.

By default this feature is activated in all new CRM Online trials. You can check the settings in Settings windows.price listNext step is to associate Territories with Price List through Territory grid available in Price List (which is essentially connections re-purposed). You now find an OOB Connection role Territory Default Price List. Make sure to create the connection from within the Price List.price list1

Associate this territory with the User.

Now when a new Opportunity is created, and the customer does not have a default Price List set, it would be read from the Territory Default Price List connection.price list2

Note: If more than one price list is associated with a territory, then the price list is not populated. This should be enhanced to allow associating multiple pricelists with a territory for with a unique pricelist for each currency.

The region NA may need to serve customers in America as well as Canada and create opportunities in both these currencies. Depending on the currency of the customer, the Price List should be set from the territory.

If you have only one currency price list associated with a Territory and you try to create an opportunity for a customer in another currency you receive the following errorprice list3

Price List Based on Custom Logic

Another way to get the Price List for an Opportunity is through custom plugin. We now have a new message “GetDefaultPriceLevel” available on which Plugin can be registered.

Here is a snippet of how the pricelevel can be passed through the plugin

public void Execute(IServiceProvider serviceProvider)

{

try

{

IPluginExecutionContext pluginExecutionContext = (IPluginExecutionContext)serviceProvider.GetService(typeof(IPluginExecutionContext));

IOrganizationServiceFactory organizationServiceFactory = (IOrganizationServiceFactory)serviceProvider.GetService(typeof(IOrganizationServiceFactory));

//get the collection of price list based on your business requirement

EntityCollection priceListcoll = GetPriceList(organizationService);

//pass the price list collection to the output parameter

pluginExecutionContext.OutputParameters["BusinessEntityCollection"] = coll;

}

catch (FaultException<OrganizationServiceFault> ex)

{

throw new InvalidPluginExecutionException(“Execute: ” + ex.Message);

}

}

Register this plugin on GetDefaultPriceLevel. This will override the Price List selection on Opportunity, Quote, Order and Invoice as well.price list4

Note: Make sure to return only a single Price List in the collection in output parameter. If you return more than one, the Price List will not be set.

Conclusion:

Similar to the enhancement where the Pricing logic could be overridden using the CalculatePriceRequest Message, we now have the ability to select the Price List based on which the Pricing can be calculated.

There’s much more. For any assistance in implementation, customization, migration or upgradation of Dynamics CRM, get in touch with us on crm@inogic.com.

Leave a Reply