• rishabh rathor 18
  • NEWBIE
  • 20 Points
  • Member since 2019

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 9
    Questions
  • 13
    Replies
====Component===========
<aura:component controller="AccountTabsCntrl" implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction" access="global" >
        <aura:handler name="init" value="{!this}" action="{!c.doinit}" />
         <aura:attribute name="Accounts" type="List" />
    
    <lightning:tabset>
     <aura:iteration items="{!v.Accounts}" var="acc">
        <lightning:tab  label="{!acc.Name}">
            {acc.Phone}
        </lightning:tab>
     </aura:iteration>
       
    </lightning:tabset>
</aura:component>
    
=========js controller=========
({
    doinit : function(component, event, helper) {
    console.log('load');
    var action = component.get('c.getAccounts');
    action.setCallback(this, function(response){
            var result =response.getReturnValue();
            console.log(result);
            component.set("v.Accounts",result);
            console.log(result);
    });
    
    $A.enqueueAction(action);
},
})
===========Apex controller==============
public class AccountTabsCntrl {
    @AuraEnabled
    public static list<Account> getAccounts(id accountIds){
    List<Account> accLIst = new List<Account>();
        accLIst = [Select id, Name,Phone from account where Id=:accountIds Limit 5];
        return accLIst;
    }

}
for:-
https://trailhead.salesforce.com/content/learn/modules/lightning-web-components-basics/add-styles-and-data-to-a-lightning-web-component
Here Its my Code:-
========Apex Controller=============
public class AccordianCntrl {
    public String selectedaccountId { get; set; }
    public  List<Contact> Contacts{get;set;}
    public AccordianCntrl(){
        Contacts = new List<Contact>();
    }
    public List<Account> getListOfAccounts()
    {
     List<Account> AccountList = [select id,Name,Phone,AccountNumber,Industry from Account Limit 10] ;
      return AccountList;
       }
    
    // Return Accounts
    public pagereference contactNames()
    {
         system.debug('id '+selectedaccountId);
        
          Contacts = [Select FirstName, LastName, Email , Phone From Contact where Accountid=:selectedaccountId];
        //List<Contact> results1 = [Select FirstName, LastName, Email , Phone From Contact ];
        
        System.debug(Contacts);  
        return null;
        
    }
}


========VF Page===================
<apex:page controller="AccordianCntrl" docType="html-5.0" standardStylesheets="true" showHeader="false">
    <apex:slds />
    
    <style>
        .slds-scope .slds-section { position: relative; margin: 0px;}
        .slds-scope .slds-section:after { content: ""; width: 8px; height: 8px; border-bottom: 2px solid #000; border-left: 2px solid #000; position: absolute; transform: rotate(-135deg) skew(0deg); top: 13px; left: 12px; cursor: pointer;}
        .slds-scope .slds-section.slds-is-open:after { content: ""; width: 8px; height: 8px; border-bottom: 2px solid #000; border-left: 2px solid #000; position: absolute; transform: rotate(-45deg) skew(0deg); top: 12px; right: 10px; cursor: pointer;}
        .slds-scope .slds-section__title-action{ background: transparent; border-top: 1px solid #dddbda !important;}
        .slds-scope .slds-section:first-child .slds-section__title-action{ border-top:0px !important;}
        .slds-scope .slds-section.slds-is-open .slds-section__content{ padding:15px 30px;}
    </style>
    
    <!--jQuery CDN-->
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
    <!--Salesforce Lightning Design System Static Resource-->
        <apex:stylesheet value="{!URLFOR($Resource.SLDS, 'assets/styles/salesforce-lightning-design-system-vf.min.css')}" />
            <script>
            var j$ = jQuery.noConflict();
    </script>
    <html xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> 
        <head>
            <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
        </head>
        <!--The Salesforce Lightning Design System Wrapping Div with Scoping Class -->
        <div class="minerva18">
            
            
            <fieldset class="slds-box slds-theme--default slds-container">
                
                <!-- Single Section Wrapper With Three SLDS Sections, The Wrapper Div Class must be 'Minerva18SectionGroupSingle' -->
                <div class="Minerva18SectionGroupSingle" >
                    
                    <div class="slds-section">
                        <h3 class="slds-section__title">
                            <button class="slds-button slds-section__title-action">
                                <svg aria-hidden="true" class="slds-section__title-action-icon slds-button__icon slds-button__icon--left">
                                    <use xlink:href="{!$Resource.SLDS}/assets/icons/utility-sprite/svg/symbols.svg#switch"></use>
                                </svg>Accounts</button>
                        </h3>
                        <div class="slds-section__content">
                            
                            <apex:outputPanel id="table"> 
                                <table class="slds-table slds-table_cell-buffer slds-table_bordered" >
                                    <thead>
                                        <tr >
                                            
                                            <th class="" scope="col">
                                                <div class="slds-truncate" title="Name">Name</div>
                                            </th>
                                            
                                            <th class="" scope="col">
                                                <div class="slds-truncate" title="Account Number">Account Number</div>
                                            </th> 
                                            <th class="" scope="col">
                                                <div class="slds-truncate" title="Phone">Phone</div>
                                            </th>
                                            <th class="" scope="col">
                                                <div class="slds-truncate" title="Industry">Industry</div>
                                            </th>
                                        </tr>
                                    </thead>
                                    
                                    <tbody>
                                        <apex:repeat value="{!ListOfAccounts}" var="con">
                                            <tr class="slds-hint-parent">
                                                
                                                
                                                <td data-label="Account Number" >
                                                    <div class="slds-truncate" title="Account Number"> <Apex:outputfield value="{!con.AccountNumber}"/></div>
                                                </td> 
                                                <td data-label="Phone">
                                                    <div class="slds-truncate" title="Phone"> <apex:outputfield value="{!con.Phone}"/></div>
                                                </td>
                                                <td data-label="Industry">
                                                    <div class="slds-truncate" title="Industry"> <apex:outputfield value="{!con.Industry}"/></div>
                                                </td>
                                            </tr>
                                        </apex:repeat> 
                                    </tbody>
                                </table>
                                <apex:actionSupport event="onchange"  action="{!contactNames}" reRender="table"/>
                            </apex:outputPanel>
                        </div>
                    </div>
                    
                </div>
                <!-- Single Section Wrapper End-->
            </fieldset>
            
            
            <fieldset class="slds-box slds-theme--default slds-container">
                <div class="Minerva18SectionGroupSingle" >
                     
                    <div class="slds-section">
                         <h3 class="slds-section__title">
                                <button class="slds-button slds-section__title-action">
                                    <svg aria-hidden="true" class="slds-section__title-action-icon slds-button__icon slds-button__icon--left">
                                        <use xlink:href="{!$Resource.SLDS}/assets/icons/utility-sprite/svg/symbols.svg#switch"></use>
                                    </svg>
                                   Related contacts
                             </button>
                            </h3>
                            <div class="slds-section__content">
                                <p>
                                    Hello...
                                </p>          
                            </div>
                    </div>
                    
                </div>
                
            </fieldset> 
        </div>
        <script>
        /*SLDS Sections*/
        j$('.slds-section__content').hide();
        j$('.slds-section__title').find('button').find('svg').css('transition', '0.3s');
        j$('.slds-section__title').click(function(){
            if(j$(this).parent().parent().hasClass('Minerva18SectionGroupSingle')){
                if(j$(this).parent().hasClass('slds-is-open')){
                    j$(this).parent().removeClass('slds-is-open');
                    j$(this).parent().find('.slds-section__content').hide();
                }
                else{
                    j$(this).parent().parent().find('.slds-section').removeClass('slds-is-open');
                    j$(this).parent().parent().find('.slds-section__content').hide();
                    j$(this).parent().toggleClass('slds-is-open');
                    j$(this).parent().find('.slds-section__content').show();
                } 
            }
            else{
                j$(this).parent().toggleClass('slds-is-open');
                if(j$(this).parent().hasClass('slds-is-open')){
                    j$(this).parent().find('.slds-section__content').show();
                }else{
                    j$(this).parent().find('.slds-section__content').hide();
                }
            }
        });
        /*SLDS Sections*/
        </script>
    </html>
</apex:page>

Thanks & Regards!!
Rishabh Rathor
Plz Help me ASAP.
Here It is my code:- 
==========Apex Controller===================
public class DropdownContrl {
     @AuraEnabled
    Public static String accountId{get;set;}
   
     @Auraenabled
  public static List<Account> getAccounts()
  {
      List<Account> accList = new List<Account>();
      accList = [SELECT Id, Name FROM Account];
      system.debug('Accounts '+accList);
            return accList;
  }
      @Auraenabled
     public static List<Contact> getContact(List<Id> accountIds)
  {
      System.debug('Acclount Id '+accountIds);
      List<Contact> conlst = new List<Contact>();
      conlst = [SELECT  FirstName, LastName,Email,Phone from Contact WHERE 
                                    accountId in : accountIds];
      system.debug('contacts '+conlst);
            return conlst;
  }
    }

=========Component=========
<aura:component controller="DropdownContrl" implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction" access="global">
    <aura:attribute name="Accounts" type="List" />
    <aura:attribute name="Contacts" type="List" />
    <aura:handler name="init" value="{!this}" action="{!c.doinit}" />
    <h2 class="slds-page-header__title">Display Account List</h2>
    <lightning:layout>
        <article class="slds-card slds-m-bottom_medium">
            <div class="slds-media__body">
                <div>
                    <lightning:layoutitem>
                        <lightning:select aura:id="act" name="selectAccount" >
                            <option value="" label="--None--">
                            </option>
                            <aura:iteration items="{!v.Accounts}" var="item" >
                                <option value="{!item.Id}" label="{!item.Name}" >
                                    {!item.Name}
                                </option>
                            </aura:iteration>
                        </lightning:select>
                    </lightning:layoutitem>
                </div>
            </div>
        </article>
    </lightning:layout>
    <div>
            <lightning:button label="Get Contacts" title="Neutral action" onclick="{! c.getcontacts }"/>

                <!--     <button  class="slds-button slds-button_brand" style="height:30px;width: 50px;" label ="Get Contacts" onclick="{!c.getcontacts}" ></button>-->

    </div>
     <h2 class="slds-page-header__title">Related Contacts</h2>
     <div  aura:id="ContactRecordViewController" class="slds"> 
        <table class="slds-table slds-table--bordered slds-table--striped">
            <thead>
                <tr>
                    <th scope="col"><span class="slds-truncate">First Name</span></th>
                    <th scope="col"><span class="slds-truncate">Last Name</span></th>
                    <th scope="col"><span class="slds-truncate">Email</span></th>
                    <th scope="col"><span class="slds-truncate">Phone</span></th>
                 
                </tr>
            </thead>
            <tbody>
                <aura:iteration items="{!v.Contacts}" var="con" indexVar="index">
                    <tr>
                        <td data-index="{!index}">{!con.FirstName}</td>
                        <td data-index="{!index}">{!con.LastName}</td>
                        <td data-index="{!index}">{!con.Email}</td>
                        <td data-index="{!index}">{!con.Phone}</td>
                    </tr>
                </aura:iteration>
            </tbody>
        </table>
    </div>
</aura:component>
=============Helper==============
({
    fetchContacts : function(component, event, helper) {
        var action = component.get("c.getContact");
        console.log(action);
        var accountId = component.get("v.recordId");
        console.log(accountId);   
        action.setParams({
            accountIds: accountId
        });
        
        action.setCallback(this, function(response) {
            var state = response.getState();
            if(state === 'SUCCESS') {
                var contactList = response.getReturnValue();
                component.set("v.Contacts",contactList);
                console.log(contactList);
            }
            else {
                alert('Error in getting data');
            }
        });
        $A.enqueueAction(action);
    },

})

=====================Js controller============

({
doinit : function(component, event, helper) {
    console.log('load');
    var action = component.get('c.getAccounts');
    action.setCallback(this, function(response){
            var result =response.getReturnValue();
            console.log(result);
            component.set("v.Accounts",result);
            console.log(result);
    });
    $A.enqueueAction(action);
},
     getcontacts : function(component, event, helper) 
    {
        
        helper.fetchContacts(component, event, helper);
    } ,
})
Here It is my code:-
======Apex Controller========
public with sharing class AccountController1_picklistrendering { public String account { get; set; } public String selectedAccId{get;set;} public String selectedConId{get;set;} public List<SelectOption> getAccountNames() { List<SelectOption> accOptions= new List<SelectOption>(); accOptions.add( new SelectOption('','--Select--')); for( Account acc : [select Id,name from Account ] ) { accOptions.add( new SelectOption(acc.Id,acc.name)); } return accOptions; } public List<SelectContact> getContactNames() { System.debug('Entered ContactNames account id...........'+selectedAccId ); if(selectContact != null) contact con = [select name from contact where accountid=:selectedAccId ]; return con; } }


=============VF Page==================
<apex:page controller="AccountController1_picklistrendering"> <apex:form > <apex:pageBlock title="Account Name"> Account Names&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <apex:selectList value="{!selectedAccId}" size="1"> <apex:selectOptions value="{!AccountNames}"/> <apex:actionSupport event="onchange" reRender="a"/> </apex:selectList> <br/><br/> Related Contact Names&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <apex:pageBlockTable value="{!ContactNames}" var="items"> <apex:column value="{!items.name}"/> </apex:pageBlockTable> <apex:selectList value="{!selectedConId}" size="1" id="a"> <apex:selectOptions value="{!ContactNames}" /> </apex:selectList> </apex:pageBlock> </apex:form> </apex:page>
I am stucking on confuguration setup for google adwords and analytics to Salesforce..I got a link but that was too getting me confused..I have passed GCILD field and GA visitor Id in the web to lead custom firm with javascript support..but how to get that work so that I can receive conversions.
The pardot is commevted to google adwords and google analytics but the I am not getting importing of salesforce conversions in GA and vice versa..I have setup GCLID hidden field to the pardot forms but unable to capture this id..If anyone is having idea to setup onversions amd handling GCLID in web to lead form then pls tell me..
 How to import selected records using lightning component.
Here it is my code:-
==========controller===========
public class Dynamic_Table {
    
    public Map <String, Schema.SObjectType> schemaMap = Schema.getGlobalDescribe();

    public String selectedObject {get; set;}

    public String selectedField {get; set;}
   

    Public Dynamic_Table()
    {   
        selectedObject = 'account';
        
    }

    public List<SelectOption> getObjectNames() 
    {
        List<SelectOption> objNames = new List<SelectOption>();
        List<String> entities = new List<String>(schemaMap.keySet());
        entities.sort();
        for(String name : entities)
        {
            objNames.add(new SelectOption(name,name));
        }
        return objNames;
     }

     public List<SelectOption> getObjectFields() 
     {
            Map<String, Schema.SObjectType> schemaMap = Schema.getGlobalDescribe();
            Schema.SObjectType ObjectSchema = schemaMap.get(selectedObject);
            Map<String, Schema.SObjectField> fieldMap = ObjectSchema.getDescribe().fields.getMap();
            List<SelectOption> fieldNames = new List<SelectOption>();
            for (String fieldName: fieldMap.keySet()) 
            {  
                fieldNames.add(new SelectOption(fieldName,fieldName));
              //fieldMap.get(fieldName).getDescribe().getLabel();//It provides to get the object fields label.
            }
            return fieldNames;
      }   
  
}


===========vf page==============
<apex:page controller="Dynamic_Table" lightningStylesheets="true">
    <apex:form > 
      <apex:pageBlock >
          <apex:pageBlockSection columns="2">

              <apex:pageBlockSectionItem >
                  <apex:outputlabel value="Object Names :"/> 
                      <apex:actionRegion >      
                           <apex:selectList value="{!selectedObject}" size="1">
                                    <apex:selectOptions value="{!ObjectNames}"/>
                                    <apex:actionSupport event="onchange" rerender="myFields"/>
                            </apex:selectList>
                     </apex:actionRegion>                         
              </apex:pageBlockSectionItem>

              <apex:pageBlockSectionItem >
                      <apex:outputlabel value="Field Names :"/>   
                      <apex:outputPanel id="myFields">   
                        <apex:actionRegion >  
                           <apex:selectList value="{!selectedField}" size="1">
                                <apex:selectOptions value="{!ObjectFields}"/>
                            </apex:selectList>
                        </apex:actionRegion>      
                     </apex:outputPanel>
             
                  
              </apex:pageBlockSectionItem>

          </apex:pageBlockSection>
      </apex:pageBlock>
  </apex:form>
</apex:page>
 
Here It is my code:- 
==========Apex Controller===================
public class DropdownContrl {
     @AuraEnabled
    Public static String accountId{get;set;}
   
     @Auraenabled
  public static List<Account> getAccounts()
  {
      List<Account> accList = new List<Account>();
      accList = [SELECT Id, Name FROM Account];
      system.debug('Accounts '+accList);
            return accList;
  }
      @Auraenabled
     public static List<Contact> getContact(List<Id> accountIds)
  {
      System.debug('Acclount Id '+accountIds);
      List<Contact> conlst = new List<Contact>();
      conlst = [SELECT  FirstName, LastName,Email,Phone from Contact WHERE 
                                    accountId in : accountIds];
      system.debug('contacts '+conlst);
            return conlst;
  }
    }

=========Component=========
<aura:component controller="DropdownContrl" implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction" access="global">
    <aura:attribute name="Accounts" type="List" />
    <aura:attribute name="Contacts" type="List" />
    <aura:handler name="init" value="{!this}" action="{!c.doinit}" />
    <h2 class="slds-page-header__title">Display Account List</h2>
    <lightning:layout>
        <article class="slds-card slds-m-bottom_medium">
            <div class="slds-media__body">
                <div>
                    <lightning:layoutitem>
                        <lightning:select aura:id="act" name="selectAccount" >
                            <option value="" label="--None--">
                            </option>
                            <aura:iteration items="{!v.Accounts}" var="item" >
                                <option value="{!item.Id}" label="{!item.Name}" >
                                    {!item.Name}
                                </option>
                            </aura:iteration>
                        </lightning:select>
                    </lightning:layoutitem>
                </div>
            </div>
        </article>
    </lightning:layout>
    <div>
            <lightning:button label="Get Contacts" title="Neutral action" onclick="{! c.getcontacts }"/>

                <!--     <button  class="slds-button slds-button_brand" style="height:30px;width: 50px;" label ="Get Contacts" onclick="{!c.getcontacts}" ></button>-->

    </div>
     <h2 class="slds-page-header__title">Related Contacts</h2>
     <div  aura:id="ContactRecordViewController" class="slds"> 
        <table class="slds-table slds-table--bordered slds-table--striped">
            <thead>
                <tr>
                    <th scope="col"><span class="slds-truncate">First Name</span></th>
                    <th scope="col"><span class="slds-truncate">Last Name</span></th>
                    <th scope="col"><span class="slds-truncate">Email</span></th>
                    <th scope="col"><span class="slds-truncate">Phone</span></th>
                 
                </tr>
            </thead>
            <tbody>
                <aura:iteration items="{!v.Contacts}" var="con" indexVar="index">
                    <tr>
                        <td data-index="{!index}">{!con.FirstName}</td>
                        <td data-index="{!index}">{!con.LastName}</td>
                        <td data-index="{!index}">{!con.Email}</td>
                        <td data-index="{!index}">{!con.Phone}</td>
                    </tr>
                </aura:iteration>
            </tbody>
        </table>
    </div>
</aura:component>
=============Helper==============
({
    fetchContacts : function(component, event, helper) {
        var action = component.get("c.getContact");
        console.log(action);
        var accountId = component.get("v.recordId");
        console.log(accountId);   
        action.setParams({
            accountIds: accountId
        });
        
        action.setCallback(this, function(response) {
            var state = response.getState();
            if(state === 'SUCCESS') {
                var contactList = response.getReturnValue();
                component.set("v.Contacts",contactList);
                console.log(contactList);
            }
            else {
                alert('Error in getting data');
            }
        });
        $A.enqueueAction(action);
    },

})

=====================Js controller============

({
doinit : function(component, event, helper) {
    console.log('load');
    var action = component.get('c.getAccounts');
    action.setCallback(this, function(response){
            var result =response.getReturnValue();
            console.log(result);
            component.set("v.Accounts",result);
            console.log(result);
    });
    $A.enqueueAction(action);
},
     getcontacts : function(component, event, helper) 
    {
        
        helper.fetchContacts(component, event, helper);
    } ,
})
Here It is my code:-
======Apex Controller========
public with sharing class AccountController1_picklistrendering { public String account { get; set; } public String selectedAccId{get;set;} public String selectedConId{get;set;} public List<SelectOption> getAccountNames() { List<SelectOption> accOptions= new List<SelectOption>(); accOptions.add( new SelectOption('','--Select--')); for( Account acc : [select Id,name from Account ] ) { accOptions.add( new SelectOption(acc.Id,acc.name)); } return accOptions; } public List<SelectContact> getContactNames() { System.debug('Entered ContactNames account id...........'+selectedAccId ); if(selectContact != null) contact con = [select name from contact where accountid=:selectedAccId ]; return con; } }


=============VF Page==================
<apex:page controller="AccountController1_picklistrendering"> <apex:form > <apex:pageBlock title="Account Name"> Account Names&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <apex:selectList value="{!selectedAccId}" size="1"> <apex:selectOptions value="{!AccountNames}"/> <apex:actionSupport event="onchange" reRender="a"/> </apex:selectList> <br/><br/> Related Contact Names&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <apex:pageBlockTable value="{!ContactNames}" var="items"> <apex:column value="{!items.name}"/> </apex:pageBlockTable> <apex:selectList value="{!selectedConId}" size="1" id="a"> <apex:selectOptions value="{!ContactNames}" /> </apex:selectList> </apex:pageBlock> </apex:form> </apex:page>
Here it is my code:-
==========controller===========
public class Dynamic_Table {
    
    public Map <String, Schema.SObjectType> schemaMap = Schema.getGlobalDescribe();

    public String selectedObject {get; set;}

    public String selectedField {get; set;}
   

    Public Dynamic_Table()
    {   
        selectedObject = 'account';
        
    }

    public List<SelectOption> getObjectNames() 
    {
        List<SelectOption> objNames = new List<SelectOption>();
        List<String> entities = new List<String>(schemaMap.keySet());
        entities.sort();
        for(String name : entities)
        {
            objNames.add(new SelectOption(name,name));
        }
        return objNames;
     }

     public List<SelectOption> getObjectFields() 
     {
            Map<String, Schema.SObjectType> schemaMap = Schema.getGlobalDescribe();
            Schema.SObjectType ObjectSchema = schemaMap.get(selectedObject);
            Map<String, Schema.SObjectField> fieldMap = ObjectSchema.getDescribe().fields.getMap();
            List<SelectOption> fieldNames = new List<SelectOption>();
            for (String fieldName: fieldMap.keySet()) 
            {  
                fieldNames.add(new SelectOption(fieldName,fieldName));
              //fieldMap.get(fieldName).getDescribe().getLabel();//It provides to get the object fields label.
            }
            return fieldNames;
      }   
  
}


===========vf page==============
<apex:page controller="Dynamic_Table" lightningStylesheets="true">
    <apex:form > 
      <apex:pageBlock >
          <apex:pageBlockSection columns="2">

              <apex:pageBlockSectionItem >
                  <apex:outputlabel value="Object Names :"/> 
                      <apex:actionRegion >      
                           <apex:selectList value="{!selectedObject}" size="1">
                                    <apex:selectOptions value="{!ObjectNames}"/>
                                    <apex:actionSupport event="onchange" rerender="myFields"/>
                            </apex:selectList>
                     </apex:actionRegion>                         
              </apex:pageBlockSectionItem>

              <apex:pageBlockSectionItem >
                      <apex:outputlabel value="Field Names :"/>   
                      <apex:outputPanel id="myFields">   
                        <apex:actionRegion >  
                           <apex:selectList value="{!selectedField}" size="1">
                                <apex:selectOptions value="{!ObjectFields}"/>
                            </apex:selectList>
                        </apex:actionRegion>      
                     </apex:outputPanel>
             
                  
              </apex:pageBlockSectionItem>

          </apex:pageBlockSection>
      </apex:pageBlock>
  </apex:form>
</apex:page>
 
Hi Team,

trying to deisgn CSV uploder in lightning component and need to display in table after uploading CSV file and on click on save button need to save account reords in data base.
 
public class PMO_CsvUploaderController {
    public Blob csvFileBody{get;set;}
    public string csvAsString{get;set;}
    public String[] csvFileLines{get;set;}
    public List<Account> Acclist{get;set;}
    public PMO_CsvUploaderController(){
        csvFileLines = new String[]{};
            Acclist = New List<Account>(); 
    }
    
    public void importCSVFile(){
        try{
            csvAsString = csvFileBody.toString();
            csvFileLines = csvAsString.split('\n'); 
            
            for(Integer i=1;i<csvFileLines.size();i++){
                Account couObj = new Account();
                string[] csvRecordData = csvFileLines[i].split(',');            
                couObj.name = csvRecordData[1] ;        
                couObj.AccountNumber = csvRecordData[2];
                couObj.Phone = csvRecordData[3];
                couObj.Rating = csvRecordData[4];
                	/*
                    String temp_fees=csvRecordData[3];
                    couObj.Course_fees__c = Decimal.valueOf(temp_fees);
                    String temp_date=csvRecordData[4];
                    couObj.Course_Date__c = Date.parse(temp_date); 
                    */
                Acclist.add(couObj);   
            }
            insert Acclist;
        }
        catch (Exception e){
            System.debug(e.getCause());
            ApexPages.Message errorMessage = new ApexPages.Message(ApexPages.severity.ERROR,'An error has occured while importing data. Please make sure input csv file is correct');
            ApexPages.addMessage(errorMessage);
        }  
    }
}

Using these contoroller to create account.. help me to design lightning component
Hi All,

  I have requirement to upload CSV file into Salesforce using lightning component then this record will insert in Sobject records.Please guide me on this scenario.

Thanks,
Santhanam
I want to open the pdf in lightning component how it can be done please help me out for this 
I am working with the force:editRecord event to handle the edit of a list of objects in a lightning component. I am able to return and display the list of objects each list item has an edit button that calls a function like what is displayed in this article:
https://developer.salesforce.com/docs/atlas.en-us.200.0.lightning.meta/lightning/ref_force_editRecord.htm (https://developer.salesforce.com/docs/atlas.en-us.200.0.lightning.meta/lightning/ref_force_editRecord.htm" target="_blank)
I've only been able to get this to work in a developer org if I add the component to an object page.

The problem is I need to update the list with the newley updated values but haven't been able to find any reference to handling the save event on the editRecord Modal popup. Any assistance would be great. 

https://developer.salesforce.com/docs/atlas.en-us.198.0.lightning.meta/lightning/ref_force_recordSaveSuccess.htm

Here is basic example of what I am trying to do. Adding the component to the account page I can click the button edit the record and hit save. The Account compact data  in the top of the page updates but what's in the component does not.

Component Code:
<aura:component controller="editRecordSimulationController"
                implements="force:appHostable,
                            flexipage:availableForAllPageTypes,
                            force:hasRecordId">
    
    <aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
    
    <aura:dependency resource="markup://force:editRecord" type="EVENT" />
    <aura:handler name="handleEdit" event="force:editRecord" action="{!c.doInit}" />
    <aura:handler name="handleSaveSuccess" event="force:recordSaveSuccess" action="{!c.doInit}" />
    
    <aura:attribute name="recordId" type="string" />
    <aura:attribute name="accType" type="String" />
    
    
    <ui:inputText label="Record Id" value="{!v.recordId}" required="true"/>
	<ui:button class="btn" label="Submit" press="{!c.setOutput}"/>
    
    <br />
    <br />
    <br />
    Account Type: <ui:outputText value="{!v.accType}" />
</aura:component>

Component Controller Code:
({
    doInit : function(component, event, helper) {
        var recordId = component.get("v.recordId");
        var action = component.get("c.getTypeFromAccount");
        action.setParams({
            	recordId: recordId
        });
        action.setCallback(this, function(response){
            var state = response.getState();
            if (state === "SUCCESS") {
                var accType = response.getReturnValue();
                component.set("v.accType", accType);
            }
        });
        
        $A.enqueueAction(action);
    },
	setOutput : function(component, event, helper) {
        var editRecordEvent = $A.get("e.force:editRecord");
        editRecordEvent.setParams({
             "recordId": component.get("v.recordId")
        });
        editRecordEvent.fire();
	}
})

Apex Controller:
public class editRecordSimulationController {

    @AuraEnabled
    public static string getTypeFromAccount(string recordId)
    {
        Account acc = [select Type from Account Where Id = :recordId limit 1];
        return acc.Type;
    }
}




 

Hi All,

 

I require an urgent help.

 

The requirement is that i need to provide a custom button on the Default List View Page to send an Email to the selected record's Email Id field.

 

The records will be selected using the Action Checkbox provided i.e. i need to check the CheckBox provided under Action column to select the records, and after selecting the records click on the Custom button to send the Email to all.

 

Can it be done, if yes please let me know How....Its urgent Please..