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
Anita 8Anita 8 

lightning display account name instead of id display on custom field in salesforce

Hello Guy, 
I'm tried with this code .
<aura:attribute name="opp" type="Opportunity"/>
<li class="slds-page-header__detail-block">
          <p class="slds-text-heading--label-normal accInfoLabel slds-truncate slds-m-bottom--xx-small" title="Billing Account">Billing Account</p>
          <p>
            <span title="{!v.opp.Billing_Account__c}">{!v.opp.Billing_Account__c}&nbsp;</span>
          </p>
        </li>

I try to display Account.Name that Billing Account field is look up to account , but when I get it show me as ID . 
So I don't know how to display Account Name on custom field instead ID of Account?? 

Please, help me .
Thanks in advance.
Best Answer chosen by Anita 8
RaidanRaidan
Anita,

If Billing_Account__c is a lookup, then it will show you the ID. To show the name you will have to use Billing_Account__r.Name. I don't know how you prepare the data, but if you use a query, you will have to query this field as well.
 

All Answers

RaidanRaidan
Anita,

If Billing_Account__c is a lookup, then it will show you the ID. To show the name you will have to use Billing_Account__r.Name. I don't know how you prepare the data, but if you use a query, you will have to query this field as well.
 
This was selected as the best answer
Anita 8Anita 8
Hello Raidan,
Thank you so much for your kindly.
Now it's work fine .