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
sfdc fishsfdc fish 

Unable to populate values on the page while passing the recordid in the URL.

Can any one help me on this....
In classic  while passing object record id in the URL will get the field values on the page ,how can we achieve this in the lightning.
Here am tryng same but unable to get field values and where can I pass the id in the lightning,below is my component and app.



<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes" access="global" >
    <aura:attribute name="expense" type="expense__c"/>
<p>Amount:<ui:outputCurrency Value="{!v.expense.Amount__c}"/></p>
<p>Client:<ui:outputtext value="{!v.expense.Client__c}"/> </p>
<p>Date:<ui:outputdate value="{!v.expense.Date__c}"/></p>
<p>Reimbursed?: <ui:outputcheckbox value="{!v.expense.Reimbursed__c}"/></p>
    <ui:outputText class="form-control" aura:id="recid" value="{!v.recordId}" />
</aura:component>


<aura:application >
  
    <c:expense/>
        
</aura:application>


Thanks in advance.
Abhishek Sagar 1Abhishek Sagar 1
Unfortunately you have to write controller code to fetch record details on the basis of record id. But I know in next release SF is going to launch one more tag (may be called lightning:recordPreview, thats what they told me alteast) where you can pass this id to get record values(like VF) without writing any code.