Ask Search:
Victoria KurthVictoria Kurth 

I would like a report that a product manager could type in a product and return the invoiced sales info without using visualforce

I would like to have a report for product managers:
They can type in the product number and it would return the sales for that product based upon the part number and time frame they specified.
I understand where to put the time constraint on the report but not how to do the part number without them altering a filter in a report everytime.
Best Answer chosen by Victoria Kurth
Deepak AnandDeepak Anand
Well, here is how I would do:

Say for example I have a report like this:

User-added image

If you look at the Filters, you would notice that I have two of them in place. Both of them are Field Filters. The first one seems to be filled while the second one seems to be incomplete. It says -

ProductCode contains .......

This was left blank intentionally. Do you know that we can set these filters via the URL ? The filters are designated like this:
User-added image

So in our case, it would be pv1. Now, if I run the report with my filter set dynamically via the URL, it would look this:
 
User-added image

This could now be utilized to create a Find Product for my Product List Views like this:
  • Setup | Customize | Products | Buttons & Links
  • Click in New Button or Link
  • Name it - Find Product
  • BehaviourExecute JavaScript
  • Content Source: OnClick JavaScript
  • Display Type: List Button
  • JavaScript will be:
var pCode = prompt('Please Enter a Product Code:');

if( pCode != undefined && pCode.trim() != ''){
    location.replace('/00O90000005Csh6?pv1=' + pCode);
}
  • Save it.
Now let us add it to the Search Layout -
  • Setup | Customize | Products | Search Layouts
  • Click Edit next to the Products List View Layout
  • You will find the Find Product button in the Available Buttons list. Move it to the Selected Buttons list.
  • Save it.
This is what you will have:

User-added image

Click OK to see the magic!

All Answers

Deepak AnandDeepak Anand
Well, here is how I would do:

Say for example I have a report like this:

User-added image

If you look at the Filters, you would notice that I have two of them in place. Both of them are Field Filters. The first one seems to be filled while the second one seems to be incomplete. It says -

ProductCode contains .......

This was left blank intentionally. Do you know that we can set these filters via the URL ? The filters are designated like this:
User-added image

So in our case, it would be pv1. Now, if I run the report with my filter set dynamically via the URL, it would look this:
 
User-added image

This could now be utilized to create a Find Product for my Product List Views like this:
  • Setup | Customize | Products | Buttons & Links
  • Click in New Button or Link
  • Name it - Find Product
  • BehaviourExecute JavaScript
  • Content Source: OnClick JavaScript
  • Display Type: List Button
  • JavaScript will be:
var pCode = prompt('Please Enter a Product Code:');

if( pCode != undefined && pCode.trim() != ''){
    location.replace('/00O90000005Csh6?pv1=' + pCode);
}
  • Save it.
Now let us add it to the Search Layout -
  • Setup | Customize | Products | Search Layouts
  • Click Edit next to the Products List View Layout
  • You will find the Find Product button in the Available Buttons list. Move it to the Selected Buttons list.
  • Save it.
This is what you will have:

User-added image

Click OK to see the magic!
This was selected as the best answer
Phil WaltonPhil Walton
Round of applause for @Deepak!!!
Victoria KurthVictoria Kurth
sorry I got lost.  
I have a report it is based on invoices and invoice lines. 
Invoices does look up to products.
I did this because I am trying to show sales.
I did create the Find Product button on the Products. 
Find Products is visible on the All Products List View
It is in the system.
I set the filter on my report to be ProductCodeField contains....blank
Now I am lost!
The Find Product button is showing on the Correct List view.
How is this getting to my report?


Deepak AnandDeepak Anand
Good question! If you look at this JavaScript:

var pCode = prompt('Please Enter a Product Code:');

if( pCode != undefined && pCode.trim() != ''){
    location.replace('/00O90000005Csh6?pv1=' + pCode);
}

and especially this line - location.replace('/00O90000005Csh6?pv1=' + pCode);. The bold face text - 00O90000005Csh6 stands for the Report ID. Copy that from your Report (you will find it on the URL) and then paste it right into the Code.
Victoria KurthVictoria Kurth
OK...  You are right BUT of course I have a special issue:

something I did not mention the product code field that I am using is on the invoice line so I can see $.
this product code field is custom and looks up to the product code listed in the product object. 
It is not actually the product code on the product object.
Victoria KurthVictoria Kurth
thanks so much for your help. I di dcreate this report and use the button because it is still helpful.  But could you help with my above listed question or am I just screwed.  I am thinking maybe I need to do Visualforce page to reflect the information that they are wanting.  I have never done one and not sure how too.  I did get into Developer Environmnet and do some reading.  BUT wow.

Deepak AnandDeepak Anand
Sorry! I forgot to reply. Well, can you post a screenshot of your report and also with markings that would help understand which field are we concerned with and so on.
Victoria KurthVictoria Kurth
User-added image

The Product Code Field seen in this report,is the custom field that is returned from the Prodcuts object.
This was added to the invoice line so I can return sales.
The Product Code  on the Product obect is a custom field that was created by consultants to map the code.
It is not the standard out of the box Product Code provided on the Product by SF.
User-added image

custom field for code on product object
User-added image