• It'sSaurabh
  • NEWBIE
  • 0 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 1
    Replies
We are utilising a CTI Product for Telephony capabilities but we have another service built within the Org which we want to call for Identity and verification puspose when ever any customer calls us, I am thinking to write a excute apex method on softphone layout which will pass the agent id to salesforce then i can make a callout to external service from salesforce, if anybody has worked on similar use cases kindly advise.
I Tried doing in below way, Please help


 List <DET_Allowed_users__mdt> Userlist = [SELECT Id, Users__c FROM DET_Allowed_users__mdt];
List<String> str1 = New list<String>();
   
    for (DET_Allowed_users__mdt Det:Userlist);
      str1.add(Det.Users__c);
    System.debug('see this '+str1);
   
    String str = Userinfo.getname(); 
    if(str1.contains(str) ){
Hi, 

I want to display list of accounts with contacts in lightning page. Here the code i have written. Here accounts are displaying but contacts are not display. Please help me to display the accounts with contacts.

Thank you.


 
<aura:component controller="accountsWithContactsClass" implements="flexipage:availableForAllPageTypes" access="global">
	 
    <aura:attribute name="accounts" type="Account[]" />
    <ui:button label="click this" press="{!c.myAction}" />
    <table>
            <tr><td><b>Name</b></td><td><b>Industry</b></td></tr>

    <aura:iteration items="{!v.accounts}" var="accs1" >
        <tr>   
        <td> {!accs1.Name}  </td>
         
      <td>   {!accs1.Industry}  </td> 
      <!--   <td>   {!accs1.Contacts.lastName}  </td> -->
        </tr>     
     <tr>   <aura:iteration items="{!v.accs1.contacts}" var="con1" >
            
             <td>{!con1.lastName} </td>
            
        </aura:iteration></tr>
     </aura:iteration>                                            
        </table>
    
</aura:component>








({
	myAction : function(component, event, helper) {
		var action =component.get("c.getAllAccounts");
        console.log('The action value is: '+action);
         action.setCallback(this, function(a){ 
             
            component.set("v.accounts", a.getReturnValue());
           //  console.log('The accs are :'+JSON.stringify(a.getReturnValue()));
            console.log('The accs are :'+JSON.stringify(a.getReturnValue()));
          
        });
        $A.enqueueAction(action);
	}
})











public class accountsWithContactsClass {

@auraEnabled
public static list<account> getAllAccounts()
    {
       list<account> accs =[select id,name,phone,industry,(select lastName from contacts) from account limit 10];
      //  list<account> accs =[select id,name,phone,industry from account limit 10];
     //   return [select Id,Name from account limit 10];
     return accs;
    }
}