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
LakshmanLakshman 

Add, Edit, Delete and Save opportunity products inline through VFP on Opportunity layout

Hi All,

 

I have a requirement where I need to implement inline Add, Edit, Delete and Save opportunity products through VFP on Opportunity layout.

After doing this I want to Schedule each product when clicked through the custom Products section of Opportunity.

 

If any one has done this before, please help me.

Thanks in advance.

 

Regards,

Lakshman

Navatar_DbSupNavatar_DbSup

Hi,

 

You can use the <apex:inlineEditSupport> with <apex:outputField> for inline editing in VF page

 

You can use the following code for the reference

 

<apex:page standardController="Contact">

    <apex:form >

        <apex:pageBlock mode="inlineEdit">

            <apex:pageBlockButtons >

                <apex:commandButton action="{!edit}" id="editButton" value="Edit"/>

                <apex:commandButton action="{!save}" id="saveButton" value="Save"/>

                <apex:commandButton onclick="resetInlineEdit()" id="cancelButton" value="Cancel"/>

            </apex:pageBlockButtons>

            <apex:pageBlockSection >

                <apex:outputField value="{!contact.lastname}">

                    <apex:inlineEditSupport showOnEdit="saveButton, cancelButton"

                        hideOnEdit="editButton" event="ondblclick"

                        changedStyleClass="myBoldClass" resetFunction="resetInlineEdit"/>

                </apex:outputField>

                <apex:outputField value="{!contact.accountId}"/>

                <apex:outputField value="{!contact.phone}"/>

            </apex:pageBlockSection>

        </apex:pageBlock>

    </apex:form>

</apex:page>

 

 

Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved.

 

 

LakshmanLakshman

I have tried this approach, it is given in SF docs here. But it doesn't meets my requirement for some of the fields of products and the fields having relationship like OpportunityLineItems.PricebookEntry.Name cannot be inline edited. Also I need an inline add products on the Opportunity Product custom VF page present in opportunity page layout.

 

How can we do this?

Any sample code or blog reference is highly appreciated.

 

Regards,

Lakshman