• Puvvada Veerendra
  • NEWBIE
  • 0 Points
  • Member since 2022
  • Mr
  • Self Employed

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies
Hi,
I need to create a Quote from Opportunity using Quick Action. Once new quote is created it should navigate to newly created quote record page. Record is getting created but navigation to Quote record is not happening. 
Component:
<aura:component implements="force:lightningQuickActionWithoutHeader,force:hasRecordId">      
<lightning:navigation aura:id="navigation"/>   
 <div class="slds-page-header" role="banner">        
<lightning:recordViewForm recordId="{!v.recordId}"  
                         objectApiName="Opportunity">       
 </lightning:recordViewForm>          
<lightning:messages/>      
<div class="slds-align_absolute-center" style="height:5rem">New Quote</div> 
    </div>    
 <lightning:recordEditForm aura:id="myform" objectApiName="SBQQ__Quote__c"  
                             onsubmit="{!c.handleSubmit}"     
                          onsuccess="{!c.handleSuccess}">        
 <lightning:messages/>         
<lightning:inputField fieldName="Invoice_To__c"/>         
<lightning:inputField fieldName="Ship_To_Location__c"/>        
 <lightning:inputField fieldName="Multi_Site_Quote__c"/>                 
<div class="slds-m-top_medium">             
<lightning:button label="Cancel" onclick="{!c.handleCancel}" />             
<lightning:button type="submit" label="Save" variant="brand"/>         
</div>     
</lightning:recordEditForm>      
</aura:component>

Controller:
({     handleCancel: function(cmp, event, helper)
 {         
$A.get("e.force:closeQuickAction").fire();     
},          
handleSubmit: function(cmp, event, helper)
 {         
event.preventDefault();         
var fields = event.getParam('fields');         
fields.SBQQ__Opportunity2__c = cmp.get("v.recordId");         
cmp.find('myform').submit(fields);     
},          
handleSuccess: function(cmp, event, helper)
 {         
var params = event.getParams();         
var quoteId = params.response.id;         
console.log(params.response.id);      
component.find("navigation")     
.navigate({         
"type" : "standard__recordPage",         
"attributes": {            
 "recordId"      : quoteId,            
 "actionName"    : actionName ? actionName : "view"   //clone, edit, view  
       } 
    }, true);   
  }  
})

Can anyone please correct me what I made wrong?
 
Thanks!

 
Regards
Santhiya