• Arun pattnaik 17
  • NEWBIE
  • 35 Points
  • Member since 2018

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 6
    Replies
Hi All
Can any one help me on this
How to write the Test class for Export Data Controller

public class ExportDataCntrlPage {
  @AuraEnabled
    public static List<String> listAllObject(){
        List<String> objectList = new List<String>();
        For(Schema.sObjectType sobj: schema.getGlobalDescribe().values()){
            if(sobj.getDescribe().isQueryable())
              objectList.add(sobj.getDescribe().getName()+'####'+sobj.getDescribe().getLabel());
        }
        system.debug('objectlist: '+objectList);
        return objectList;
    }
    
    @AuraEnabled
    public static List<fieldDataWrapper> listAllFields(String objectName){
        List<fieldDataWrapper> wrapperList =  new List<fieldDataWrapper>();
        // Create Dynamic Query Start ..
        String theQuery = 'SELECT ';
        system.debug('select: '+theQuery);
        SObjectType sObjectName = Schema.getGlobalDescribe().get(objectName);
        system.debug('object Name: '+sObjectName);
        Map<String,Schema.SObjectField> mfields = sObjectName.getDescribe().fields.getMap();
        For(Schema.SObjectField field : mfields.values()){
            
               fieldDataWrapper wrapper = new fieldDataWrapper();
               theQuery += field.getDescribe().getName() + ',' ;
                wrapper.label = field.getDescribe().getLabel();
                wrapper.apiName = field.getDescribe().getName();
            
                wrapperList.add(wrapper);
            system.debug('wraplist:'+wrapperList);
            
        }
        return wrapperList;
        
    }
    
    public class fieldDataWrapper{
        @AuraEnabled
        public String label { get; set; }
        @AuraEnabled
        public String apiName { get; set; }
    }
}
  • December 26, 2018
  • Like
  • 0
i want to get all the list of child components in js controller.
In my lightning component I am having like this.

<aura:attribute name="claimType"  type="String" default="Pharmacy" description="some pharamcy"/>

I want the default value of the attribute in the controller.js file of the component for further processing.

Please tell me how to do this.

thanks
sheila

 
Hi All
Can any one help me on this
How to write the Test class for Export Data Controller

public class ExportDataCntrlPage {
  @AuraEnabled
    public static List<String> listAllObject(){
        List<String> objectList = new List<String>();
        For(Schema.sObjectType sobj: schema.getGlobalDescribe().values()){
            if(sobj.getDescribe().isQueryable())
              objectList.add(sobj.getDescribe().getName()+'####'+sobj.getDescribe().getLabel());
        }
        system.debug('objectlist: '+objectList);
        return objectList;
    }
    
    @AuraEnabled
    public static List<fieldDataWrapper> listAllFields(String objectName){
        List<fieldDataWrapper> wrapperList =  new List<fieldDataWrapper>();
        // Create Dynamic Query Start ..
        String theQuery = 'SELECT ';
        system.debug('select: '+theQuery);
        SObjectType sObjectName = Schema.getGlobalDescribe().get(objectName);
        system.debug('object Name: '+sObjectName);
        Map<String,Schema.SObjectField> mfields = sObjectName.getDescribe().fields.getMap();
        For(Schema.SObjectField field : mfields.values()){
            
               fieldDataWrapper wrapper = new fieldDataWrapper();
               theQuery += field.getDescribe().getName() + ',' ;
                wrapper.label = field.getDescribe().getLabel();
                wrapper.apiName = field.getDescribe().getName();
            
                wrapperList.add(wrapper);
            system.debug('wraplist:'+wrapperList);
            
        }
        return wrapperList;
        
    }
    
    public class fieldDataWrapper{
        @AuraEnabled
        public String label { get; set; }
        @AuraEnabled
        public String apiName { get; set; }
    }
}
  • December 26, 2018
  • Like
  • 0
<aura:method name="myMethod" action="{!c.executeMyMethod}">
     	<aura:attribute name="Cname" type="string" default="test"/> 
        <aura:attribute name="city" type="string" /> 
         <aura:attribute name="Assetcnt" type="string" />
         <aura:attribute name="CustomerId" type="string" />
         <aura:attribute name="children" type="list" />
         </aura:method>

Hi All,

I have created the Aura: Method tag, under I declared few attributes with default values. When i am trying to access the attributes with their name getting UNDEFINED values.

Aura: Method
<aura:method name="myMethod" action="{!c.executeMyMethod}">
     	<aura:attribute name="Cname" type="string" default="test"/> 
        <aura:attribute name="city" type="string" /> 
         <aura:attribute name="Assetcnt" type="string" />
         <aura:attribute name="CustomerId" type="string" />
         <aura:attribute name="children" type="list" />
         </aura:method>

JS Controller:
executeMyMethod : function(component, event, helper) {
         console.log('Beforeset: '+ component.get("v.myMethod"));  --- Undefined
          console.log('Beforeset: '+ component.get("v.Cname")); --- Undefined
         console.log('Beforeset: '+ component.get("v.myMethod.Cname")); --- Undefined
}

Regards,
VSK98​​​​​​​

 
  • December 20, 2018
  • Like
  • 0
i want to get all the list of child components in js controller.
I wanted to build following kind of table in salesforce lightning.
 
Terms and ConditionsOther 1Other 2
Standard  
    
    
    
    

Could anyone suggest how to proceed and help me out with any sample code.