• It'sSaurabh
  • 0 Points
  • Member since 2017

  • Chatter
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
  • 1
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);
    System.debug('see this '+str1);
    String str = Userinfo.getname(); 
    if(str1.contains(str) ){

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}" />

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

	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()));

public class accountsWithContactsClass {

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;