You need to sign in to do that
Don't have an account?
Shirish Dwivedi
Opportunity Product Entry Page Customization - Want Pre-filter on this page
Hi guys,
I have customized the Opportunity Product Entry page with the help of Michealforce.org (http://www.michaelforce.org/recipeView?id=a0G30000006eVxVEAU)
But I want to have a pre-filter (just like in Standar Opportunity Product entry page) on my custom page that would show me the results specified according to that filter.
When I should click Add Product/Service button from the opportunity page it takes me to the custom page which I used from the link above. But I want the pre-filter to be automatically set with respect to "Some Field" = True and the results should be shown according to that filter. The image below shows the filter I am talking about and the Standard SF page.
I have customized the Opportunity Product Entry page with the help of Michealforce.org (http://www.michaelforce.org/recipeView?id=a0G30000006eVxVEAU)
But I want to have a pre-filter (just like in Standar Opportunity Product entry page) on my custom page that would show me the results specified according to that filter.
When I should click Add Product/Service button from the opportunity page it takes me to the custom page which I used from the link above. But I want the pre-filter to be automatically set with respect to "Some Field" = True and the results should be shown according to that filter. The image below shows the filter I am talking about and the Standard SF page.
Instead of doing that you can alter your search catogory.Have you noticed this in opportunityProductEntryExtension?
Let me know if you have any issues.
Mark it as best answer if ot works.
Thanks.
The thing is the field which I want to filter for is called ProductBundle__c and it is a custom field in Product Object.
When I changed the searchstring to this
if(searchString!=null){
qString+= ' and (Product.isProductBundle__c like \'%' + searchString + '%\' or Product2.Description like \'%' + searchString + '%\')';
}
I get the following error:
Didn't understand relationship 'Product' in field path. If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name. Please reference your WSDL or the describe call for the appropriate names.
Also how would the search box give me the result of all those Product/Service Name for which isProductBundle__c is True?
Please note that this field is a checkbox, so it returns a boolean value.
Further assitance will be highly appreciated.
Use product2 not Product.
Note that you have to pass either true or false to get results.
Let me know if you have any issues.
Mark it as best answer if ot works.
Thanks.
Thanks.
public void updateAvailableList() {
// We dynamically build a query string and exclude items already in the shopping cart
String qString = 'select Id, Pricebook2Id, Product2.isProductBundle__c, IsActive, Product2.Name, Product2.Family, Product2.IsActive, Product2.Description, UnitPrice from PricebookEntry where IsActive=true and Pricebook2Id = \'' + theBook.Id + '\'';
if(multipleCurrencies)
qstring += ' and CurrencyIsoCode = \'' + theOpp.get('currencyIsoCode') + '\'';
// note that we are looking for the search string entered by the user in the name OR description
// modify this to search other fields if desired
if(searchString!=null){
qString+= ' and (Product2.isProductBundle__c= + searchString + or Product2.Description like \'%' + searchString + '%\')';
}
When I type true in searchbox
But it gives me this error:
unexpected token: 'searchString'
Error is in expression '{!updateAvailableList}' in page opportunityproductentry: Class.opportunityProductEntryExtension.updateAvailableList: line 140, column 1
Thanks
try this Let me know if you have any issues.
Mark it as best answer if ot works.
THanks.
I am pretty sure there are products with isBundle__c= True;
but they are not showing up in the search field.
Any help would be highly appreciated.