Apex controller:
public class plController {
@AuraEnabled
public static integer IsDataAvailable() {
integer count=[select count() FROM Bank__c where IsActiveFlag__c=: true and BankCompleteFlag__c=: true and BankStatus__c!='Incomplete'];
return count;
}
@AuraEnabled
public static List<PipelineResponse> getBankOrigination() {
List<PipelineResponse> objRes=new List<PipelineResponse> ();
List<Bank__c> obj=new List<Bank__c>();
List<Client__c> objallclient=new List<Client__c>();
List<Bank__c> objBankid=new List<Bank__c>();
try{
objBankid=[SELECT Id FROM Bank__c where IsActiveFlag__c=: true and BankCompleteFlag__c=: true and BankStatus__c in('Proposal','Waiting for Full Package') ];
obj= [SELECT Id,Name,BankNumber__c,BankStatus__c ,LastModifiedDate FROM Bank__c where IsActiveFlag__c=: true and BankCompleteFlag__c=: true and BankStatus__c in('Proposal','Waiting for Full Package') ORDER BY BankStatus__c];
objallclient=[SELECT Name,First_Name__c, Last_Name__c,BankId__c FROM Client__c where Primary_Client_for_the_Bank__c =: true and BankId__c IN:objBankid ];
for(Bank__c lc:obj)
{
PipelineResponse obj1=new PipelineResponse();
obj1.Bankid=lc.ID;
if(lc.BankNumber__c ==null || lc.BankNumber__c =='')
{
obj1.BankNumber=lc.Name;
}
else
{
obj1.BankNumber=lc.BankNumber__c;
}
for(Client__c c:objallclient)
{
if(c.BankId__c==lc.ID)
{
obj1.FullName= c.Name;
}
}
/****/obj1.BankStatus=lc.BankStatus__c; //How can I get a value
instead of API Name for this Picklist
obj1.BankDate=lc.LastModifiedDate.date().format();
objRes.add(obj1);
}
}
catch(exception e){}
return objRes;
}
}
Lightning Component:
<aura:iteration items="{!v.Bank}" var="Bank">
<tr >
<td data-label="Bank Number" >
<div class="slds-truncate table-body">
<b><a id = "{!Bank.Bankid}" onclick="{!c.PipeLineMenu}">{!Bank.BankNumber}</a>
</b></div>
</td>
<td data-label="Name" >
<div class="slds-truncate table-body"><b>
{!Bank.FullName}</b></div> </td>
<td data-label="Status" >
<div class="slds-truncate table-body"><b>{!Bank.BankStatus} /***/
</b></div>
</td>
<td data-label="Bank Status DateTime" >
<div class="slds-truncate table-body"><b>{!Bank.BankDate}
</b></div>
</td>
</tr>
</aura:iteration>
BankStatus__c is a Picklist field, I get the API value as output, how can I get field label as output. Thanks!