August 2018

Salesforce

How to get record id from lighting:recordForm in Salesforce?

Sample Code: Component: <aura:component >              <div class="slds-box slds-theme_default">                      <lightning:recordForm  objectApiName = "Opportunity"                                  layoutType = "Full"                                   columns = "2"                                  onsuccess = "{! c.handleSuccess }"/>                      </div>          </aura:component>   Component Controller: ({              handleSuccess : function(component, event, helper) {                      var params = event.getParams();           alert(params.id);                  }          })   Output: