Showing posts with label price list. Show all posts
Showing posts with label price list. Show all posts

Monday, July 13, 2009

Price List Lookup does not show up any Price Lists in Opportunity form

The Price List Lookup on the Opportunity form, displays the price lists for the currency selected on the Opportunity. If no price list has been created for the specified currency it would not show any price lists in the lookup.

In our case this was not the case. Here is what caused it…

We once happened to remove the Price List attribute from the Opportunity form as the customer was not going to use the Price Lists. We had plugns in place to set the Price List by default on the create event of the Opportunity.

But when we removed the Price List from the Form we got the following error

So we planned to put the field back on the form and explained to the customer that price lists would need to be provided on the form so you might as well select the appropriate price list manually from the form.

But what stunned us, is that after putting the field back on the form, the lookup no longer seems to work. It will always bring up an empty lookup window even though we have price lists created in the same currency as that of the Opportunity.



The Price List Lookup works on all other entities except this one as we had initially removed this attribute from the form and later added it back.

On further investigation we found that our adding the attribute back did not bring it to the same state as the original form provided by Microsoft. If you compare the customization file of the original Opportunity entity from MS with the one after you manually added the Price List attribute back… you would notice they are not the same. The original form has the following script that is missing when we added the attribute to the form

Script from our customized Opportunity entity:

<cell id="{2bf4485c-3d3e-444f-ac11-8a6262083d88}">
<labels>
<label description="Price List" languagecode="1033" />
</labels>
<events>
<event name="setadditionalparams" application="true" active="true">
<script><![CDATA[
var oLookup = event.srcElement;
AddTransactionCurrencyParam(oLookup);
]]></script>
<dependencies>
<dependency id="transactioncurrencyid" />
</dependencies>
</event>
</events>
<control id="pricelevelid" classid="{270BD3DB-D9AF-4782-9025-509E298DEC0A}" datafieldname="pricelevelid" />
</cell>

Script from our customized Opportunity entity:

<cell auto="false" showlabel="true" locklevel="0" rowspan="1" colspan="1" id="{2acdf564-bd2b-4392-9a93-52a133f856be}">
<labels>
<label description="Price List" languagecode="1033" />
<label description="Tarifs" languagecode="1036" />
<label description="Preisliste" languagecode="1031" />
<label description="Lista de precios" languagecode="3082" />
</labels>
<control id="pricelevelid" classid="{270BD3DB-D9AF-4782-9025-509E298DEC0A}" datafieldname="pricelevelid" disabled="false">
<<parameters>
<AutoResolve>true</AutoResolve>
</parameters>
</control>
</cell>

And this is the reason that the price list does not work after you add it back…

Resolution: Either populate this field through scripting by copying the customer pricelist to the Price List automatically(this does away with the need to lookup the price list) or replace the Original Opportunity customizations back from an unmodified CRM system.

Wednesday, April 15, 2009

Import Price Lists in Dynamics CRM


CRM 3.0 provided limited support for importing data from external files. We were only allowed to import data of few entities like Account, Contact, Lead etc.

This feature has been greatly enhanced in version 4.0. The import tool now allows to import data into most of the entities. It also allows for Mapping of attribute values especially for Picklist type of attributes.

One of the shortcomings though is that it doesn’t update existing records. It will always create new records from the import file. The work around for this would be to develop your own custom application using CRM SDK.

We found that companies receive Price Lists from their vendors on a regular basis and they were required to import and update the prices in CRM for the Products. Since the Import tool would not work in this scenario we had to develop an import tool.

Using SDK we create/update Price List Items (the entity that stores the prices). Price Lists Items are created as a unique combination of Product/Unit and Price List. A change in either of these 3 attributes will result in a new Price List Item record.

Once we were able to create/update Price List Item, we extended it further to take care of scenarios where the Product itself does not exist in CRM. In this case to import the price we were required to first create the Product in CRM and then create a Price List Item for that product. Note that Product entity has few of its attributes mandatory so you need to take care of this in the External file so that the product can be created successfully.

With a successful implementation of this, we went a step further to generalize this tool so that the tool could be used to import and set the values for any of the attributes of Product or Price List Item. This was not too difficult. The only requirement was that the column name in the external file should match the attribute's schema name in the Product or Price List Item entity. With this requirement satisfied you can now set the values for custom attributes on your product entity.

Any SDK developer with good knowledge of Dynamics CRM can take the above route and validation to develop an Import tool for repetitively importing product price list in CRM. For those who do not want to reinvent the wheel, you can contact us or any other third party developers who must have developed this product already. More information at

http://www.inogic.com/addons_price_list.htm