+ Start a Discussion
SRajesh8SRajesh8 

Hide picklist values for opportunity product or opportunity line item

Hi,

 

I need to hide some picklist values for paticulat profile.But there is no recordtype in opportunity product.

 

please give any advice on it.

 

Thanks,

Rajesh.

Avidev9Avidev9
You dont need multiple recordtypes for this
You will have to create Page layouts on opp, remove the fields that you dont want then use the page layout assignment button to change the Profile Specific page layout to the new one for the required profiles.

For further details : http://na7.salesforce.com/help/doc/en/customize_layoutassign.htm
SRajesh8SRajesh8

HI,

 

Thanks for ur reply.I am talking about picklist values not fields.

 

Thanks,

Rajesh.

Avidev9Avidev9
Then you can create Recordtypes in your opp object. Do the pagelayout assignment(dont think you will need multiple page layouts).Then go to profiles and only give access to the required recordtype only(this will make sure recordtype selection page doesnt kicks in)
SRajesh8SRajesh8

Hi,

 

I think the pagelayout in opportunity product not display in opportunity record type(created) to assign.

 

Thanks,

Rajesh..

SRajesh8SRajesh8

Hi,

 

I will explain little bit more.

 

I have picklist field in Opportunity Product

for eg: Status

 

having pickllist values like :

 

Not Started

Started

Inprogress

completed.

 

Among above I need to hide Inprogress  value for paticulat profile. This can be done if there is record type in Opportunity product, but there is no option to create record type.

 

Then hw can we hide that picklist value .

 

Thanks,

Rajesh.

Avidev9Avidev9

Ahh my mistake!
I was thinking of Opportunity!


Just realized its Opportunity Product

 

 

yes recordtypes are not available for Opp product. I can suggest you a workaround though. Since page layouts are available you can create few dummy Status fields , with limited picklist values according to profiles. Now create Pagealyouts for the profiles and instead of the original status field place these dummy fields in the layouts. This way you can limit the values based on the layouts + dummy field combo

 

In the backend write a workflow to copy the value from this field to the Original Status field!

SRajesh8SRajesh8

Hi,

 

Thanks for sugesstion.

 

As u said to create two fields and one field is hide to other profiles in page layout.

 

I need to display field Status in vf pages..Based on profiles Inprogess should hide.

 

 

Thanks,

Rajesh.

Avidev9Avidev9

What I understood from you r question is you need to display limited sets of Value based on profile.

 

So say Field Status has values ==> A,B,C,D,E.

 

  • For Profile "Profile 1" you want to display => A,B
  • For Profile "Profile 2" you want to display ==> C,D,E
  • For Profile "Profile 3" you want to display ==>A,B, C,D,E

Now create two fields with label "Status" and following api names

  • Profile1_Status__c with value ==> A,B
  • Profile2_Status__c with value ==> C,D,E

Create Two Page layouts with the following assignment

  • Profile 1 will see ==> Page layout 1 ==> Include the field Profile1_Status__c in this layout, hide the original status field
  • Profile 2 will see ==> Page layout 2 ==> Include the field Profile2_Status__c in this layout, hide the original status field
  • Profile 3 will see ==> Page layout 3 ==>include the original status field

Use a workflow to sync the values to original Status field.

 

In this way you will be able to display different values based on profiles

SRajesh8SRajesh8

Hi,

 

Thanks for ur detail explanation.

 

what u said is right.But I am trying with single field Status i.e need to do some logic in extension so that based on profile it should be hide for other profiles.

 

with the help of <apex:select option > tag.

 

Please let me know if it can be done?

 


Thanks,

Rajesh.

Avidev9Avidev9
Well I guess you can avoid the VF page. As you may have to hardcode the values in the controller
SRajesh8SRajesh8

Hi,

 

My requirement is to display that picklist Status field in VF page.

 

for some profiles 'Inprogress' is to be hide and for other need to display in Status picklist field.

 

Thanks,

Rajesh.

Avidev9Avidev9
Go through this link http://www.salesforce.com/us/developer/docs/pages/Content/pages_compref_selectList.htm

Customize the getItems method to return value based on profiles