You need to sign in to do that
Don't have an account?
SF Beginner 2019
getting null value on currentrecordid did i miss something
var action2 = component.get("c.getAccount"); action2.setParams({ "currentRecordId" : component.get("v.recordId") }); action2.setCallback(this, function(response) { var state = response.getState(); if (state === "SUCCESS") { component.set("v.account", response.getReturnValue()); console.log(response.getReturnValue()); } }); $A.enqueueAction(action2);
<aura:attribute name="account" type="Account" default="{ 'sobjectType': 'Account' }"/> <aura:attribute name="recordId" type="Id" /> <aura:handler name="init" value="{!this}" action="{!c.doInit}"/> <div id="Modal_Parent" style="height:640px; width:1500px;"> <section role="dialog" tabindex="-1" aria-labelledby="modal-heading-01" aria-modal="true" aria-describedby="modal-content-id-1" class="slds-modal slds-fade-in-open"> <div class="slds-modal__container"> <header class="slds-modal__header"> <h2 id="modal-heading-01" class="slds-text-heading_medium slds-hyphenate">Modal Test</h2> </header> <div class="slds-modal__content slds-p-around_medium" id="modal-content-id-1"> <p>Display the Name </p> <force:outputField value="{!v.account.Name}"/> {!v.account.Name} <p></p> </div> </div>
@AuraEnabled public static List<Account> getAccount(String currentRecordId) { System.debug('AccountRecord' + currentRecordId); return [select Id, Name from Account where Id =: currentRecordId]; }
All Answers