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.
Yes, I've faced this problem on account form (defaultpricelevelid field).
ReplyDeleteConsider adding such script "AddTransactionCurrencyParam(crmForm.all.pricelevelid);" on OnLoad event...
Seems to has fixed in Rollup 7: "No price list is displayed in the Price List lookup box if the pricelist attribute is removed and then added back to the Account form." (http://support.microsoft.com/default.aspx?kbid=971782)
ReplyDeletei added that line of code and nothing changed, still cant see price lists on opportunities. we are even running hotfix 9.
ReplyDelete