• Sunil pal 29
  • 0 Points
  • Member since 2017

  • Chatter
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
  • 3

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;


In my web-to-case form, I want to specify a record type.  See html line below.  However, when I submit the form, the case record type is still set to the default record of the default case owner.  Do I have the correct syntax for the html line?  I checked the Support Settings and it is not set to override the type with the owner's default.

<input type=hidden name="RecordTypeId" value="01280000000G4N7AAK">



   I am developing a web application through visualforce. I have added a static resource javascript file which 

requires an image file to be called. I have put the images into /img folder and the javascript file(yyyyy.js) into /js folder and zipped folders into (XXXXXXX.zip) and added as a static resource with the name XXXXXXXZip

and added the code in my page as


 <script type="text/javascript" src="{!URLFOR($Resource.XXXXXXXZip, 'yyyyy.js')}"/>


But still i am not able to display the images.