function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
sandeep kumarsandeep kumar 

OpportunityLineItem not getting created if Profile permission for product is Read and Create only

Hi,

 

Thiis is really wierd. I am not being able to create an opportunittyLineItem record if the Profile permissions for Product are Read and Create only.

 

I have a VF page and a controller class. The VF page uses the Standard and custom controller. The Tag is

<apex:page standardController="OpportunityLineItem" extensions="AddOpportunityItemController" showHeader="true" >

 

The OpportunityLineItem record is in a wrapper Class "WrapperProductDisplay.cls" called from within the custom controller "AddOpportunityItemController". The wrapper class has two functioons as below

 

public OpportunityLineItem getOppLineItem()

{

PricebookEntry pre= getPricebkEntry();

if(pre!=null) //to innitialise Opp line item unit price to the product list price on Add line items and to have default functioonality for edit line itsms

{

if(oppLItem.UnitPrice==null)

{

oppLItem.UnitPrice=pre.UnitPrice;

}

}

return oppLItem;

}

public void setOppLineItem(OpportunityLineItem li)

{

 

oppLItem=li;

}

 

 

The VF page has a custom CommandButton "Save". Thiis save does not get fired for the above Profile. In effect when I looked at the OpportunityLineItem record all values posted back were null?

If the Profile is given "Edit"  permission for  the Standard Product Object then everything works fine.

 

Can anyone please HELP!