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
Yuvraj GanesanYuvraj Ganesan 

Upon saving opportunity record form using record-edit-form, navigate to priceboook selector page to add products.

I have custom Opportunity form using lightning-record-edit-form. I want to redirect to Pricebook selection page after successful saving the record. This is possible in classic pricebook selection page. But I need that in Lightning.
ANUTEJANUTEJ (Salesforce Developers) 
Hi Yuvraj,

>> https://salesforce.stackexchange.com/questions/229436/lightning-record-edit-form-is-not-going-to-detail-page-after-saving-record

I see that there is an example in the above link and I am attaching the code snippet that you can modify it as per your requirement.

You can modify it as per your use case:

After successfully editing/saving record you can handle on success event:
 
<aura:component implements="force:appHostable" >
<aura:attribute name="recordId" type="String" />
<div class="slds-p-bottom_large slds-p-left_large" style="width:500px">
    <lightning:recordEditForm 
        objectApiName="Contact"
        onsuccess="{!c.handleSuccess}">
        <lightning:messages />
        <lightning:inputField fieldName="FirstName" />
        <lightning:inputField fieldName="LastName" />
        <lightning:inputField fieldName="Birthdate" />
        <lightning:inputField fieldName="Phone" />
        <lightning:button aura:id="submit" type="submit" label="Save record" class="slds-m-top_medium" />
        </lightning:recordEditForm>
        <lightning:navigation aura:id="navService"/>
</div>

In Controller:
 
({
    handleSuccess : function(component, event, helper) {
    var payload = event.getParams().response;
    var navService = component.find("navService");

    var pageReference = {
        type: 'standard__recordPage',
        attributes: {
            "recordId": payload.id,
            "objectApiName": "Contact",
            "actionName": "view"
        }
    }
    event.preventDefault();
    navService.navigate(pageReference);  
    }    
})

Let me know if it helps you and close your query by marking it as solved so that it can help others in the future.  

Thanks.
Yuvraj GanesanYuvraj Ganesan
Hi Anutej,

Thanks for your answer. Once I hit the save, I would like to create an Opportunity Line-item So I can choose a Pricebook and Its related Products. Below is the standard popup which we used to add price book entry. Could please help me with how to open this standard price book selection upon saving the opportunity record.

Standard Pricebook Selector