• ANIL PAKKI
  • NEWBIE
  • 0 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 0
    Replies
I am trying to uplaod an image in lightning record which is having 50kb(for example), after upload the same image should shows the size is 10KB. Reduce file size for the image is available in php code, Can I reference php file in lightning component to results the same.
I am facing the problem with the above trailhead unit and the error is 
The component is missing the 'aura:iteration' component and my code is:
MycontactList.cmp
<aura:component controller = "MyContactListController" implements="flexipage:availableForRecordHome,force:hasRecordId" access="global" >
    <aura:attribute name="recordId" type="Id" />
<aura:attribute name="Account" type="Account" />
<aura:attribute name="Contacts" type="Contact" />
<aura:attribute name="Columns" type="List" />
<aura:handler name="init" value="{!this}" action="{!c.myAction}" />
<force:recordData aura:id="accountRecord"
                  recordId="{!v.recordId}"
                  targetFields="{!v.Account}"
                  layoutType="FULL"
                  />
<lightning:card iconName="standard:contact" title="{! 'Contact List for ' + v.Account.Name}">
    <!-- Contact list goes here -->
    <lightning:datatable data="{! v.Contacts }" columns="{! v.Columns }" keyField="Id" hideCheckboxColumn="true"/>
</lightning:card>
</aura:component>

 
public static testmethod void testuser()    {

      Account accountRecord1 = new Account(Name = 'Dell Products test',Core_Account_Type__c = 'Distributor',Core_Sales_Segment__c = 'Compute',Industry = 'Banking',BillingCity = 'Delhi',BillingCountry = 'USA',billingState = 'AK',billingStreet = 'Bratislava 1',Core_IPS_Active__c = true);
        insert accountRecord1;
        
        contact con = new contact(FirstName = 'Customer',LastName='john',Email='customer@john.com',AccountId=accountRecord1.id);
        insert con;
                      
        ApexPages.StandardController sc = new ApexPages.standardController(con);
        classcontroller obj = new classcontroller(sc); 
        
        List<User> userlst=[SELECT id,username,name,userroleid,contactid,profileid,Accountid,email,isactive from user where contactid=:con.id and profile.Name='Customer' ];
        Id CustRoleId=userlst[0].id;
        Test.starttest();
        obj.method(CustRoleId);
        Test.stoptest();      
        
        }  
@istest

    public class ABC_test {
    
        static testMethod void testABC() {
        
        ABC obj = new ABC();
        obj.method();        
             
      }
       
 }