- Pricelist in opportunities
- Posted by abagnoud on November 13th, 2007
We sell software and services we therefore have two pricelists.
When we create an opportunity whether I pick one price list or the other the
product selection when adding products to the opportunity remains the same.
Why do I have the exact same product selection no matter which price list I
pick?
What is the point of having several price lists?
thanks for your help
- Posted by Michael Höhne on November 13th, 2007
The purpose of different price lists is having different prices for the same
product. However the product lookup does not use the selected price list as
a filter, which is your problem. There are two ways to change this behavior:
Thanks to Nergock, you can use an undocumented feature in CRM:
http://groups.google.de/group/micros...43db2536caac00.
The other option is http://www.stunnware.com/crm2/?area=customLookup. It
does a lot more and solves some issues of the first solution, but you have
to pay for it whereas the former is free.
Both solutions require a FetchXml statement, which you can create using the
FetchXml Wizard: http://www.stunnware.com/crm2/topic....d=FindingData6.
--
Michael Höhne, Microsoft Dynamics CRM MVP
Web: http://www.stunnware.com/crm2
Feed: http://www.stunnware.com/crm2/atom.aspx
Custom Lookup Dialog: http://www.stunnware.com/crm2/?area=customLookup
The JavaScript Snippets Directory:
http://www.stunnware.com/crm2/topic.aspx?id=JS13
----------------------------------------------------------
"abagnoud" <abagnoud@discussions.microsoft.com> schrieb im Newsbeitrag
news:A753D2BD-58EB-4FB9-AAD5-A4048A944A8C@microsoft.com...
- Posted by GrizzlyTech on December 6th, 2007
In the code reference that Michael points to, it says the filtering by Price
List is possible but doesnt give the exact code.
Thanx to Nergock for posting this;
crmForm.all.phaseid.lookupbrowse = 1; // This turn on filter
crmForm.all.phaseid.additionalparams = "fetchXml=<fetch
mapping='logical'><entity name='phase'><all-attributes/><filter
type='and'><condition attribute='tractid' operator='eq' value=' " +
crmForm.all.tractid.DataValue[0].id+"' /></filter></entity></fetch> ";
But I can't figure out how to turn it into a product lookup. (how does it
access the ProductPriceList anyway, since that's not an entity for
OpportunityProduct)?
Can someone help me with the code?
--
Thanx
Glen
"Michael Höhne" wrote:
- Posted by GrizzlyTech on December 20th, 2007
I figured I might post this myself. Here's the script that filters the
Products by pricelist;
//Declare Variables.
var lookupItem = new Array;
var PriceListID;
var PriceListName;
if ((window.opener != null) && (window.opener.parent != null) &&
(window.opener.parent.document != null) &&
(window.opener.parent.document.crmForm != null))
{
var parentForm = window.opener.parent.document.crmForm;
lookupItem = parentForm.all.pricelevelid.DataValue;
if (lookupItem[0] != null)
{
PriceListID = lookupItem[0].id;
PriceListName = lookupItem[0].name;
}
alert(PriceListID);
crmForm.all.productid.lookupbrowse = 1;
var fetch ="";
crmForm.all.productid.additionalparams = "fetchXml=<fetch
mapping='logical'><entity name='product'><all-attributes/><link-entity
name='productpricelevel' to='productid' from='productid'><filter
type='and'><condition attribute='pricelevelid' operator='eq' value='" +
PriceListID + "' /></filter></link-entity></entity></fetch> ";
}
--
Glen
"GrizzlyTech" wrote: