• venkat bojja
  • NEWBIE
  • 170 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 29
    Questions
  • 23
    Replies
Hi Team,
I  have requirement...
On loaded data in datatable i need to filter the columns data with search box. Based on any column we enter the text in search box the relavant record need to display.I need this in LWC(Lightning Web Components.
Thanks in advance...

Thanks & Regards,
Venkateswara Rao B.
Hi Team,
I have a requirement...
On Account object we have few record types, if the record type name is prospect or customer we can treat the record as "Product Account". 
I want to restrict the access for product Account record on below scenarios.
  1. The Record owner and Account Team Members can view and edit the Product Account.
  2. Users that do not own the Product Account and are not listed as Account Team Members can view, but CANNOT edit the Product Account
  3. Admins can view/edit all Product Accounts.

Thanks for your help….

Regards,
Venkat B.
 

Hi Team,
In my Org I have already installed package is there, for installed package profiles have the salesforce licence. Now just i want to chage the installed package Profile's Licence. When I'm trying to clone the Profile the licence field is in disable mode(notable to edit it). Can any one suggest me how can i achieve this profile licence changing for installed package.
Thanks in advance...

Thanks,
Venkat.

 

Hi Team,
When i am trying to hit the Closed Own / Closed Lost button on Opportunity getting the below error message.

An internal server error has occurred
An error has occurred while processing your request. The salesforce.com support team has been notified of the problem. If you believe you have additional information that may be of help in reproducing or correcting the error, please contact Salesforce Support. Please indicate the URL of the page you were requesting, any error id shown on this page as well as any other related information. We apologize for the inconvenience.

Thank you again for your patience and assistance. And thanks for using salesforce.com!

Error ID: 496485080-5196291 (1823944930)


 Please help me on this.

FYI:
User-added image

Thanks,
Venkat.
Hi Team,

Through the lightning Flows i need to update the look-up field with filter condition:
 Opportunity >type='Professional Service' AND the Account Name= Account Name(Self Loop-Up Relation).

Thanks,
Venkat.
Hi Team,

In my project i have the urgent requirement.

At the lookup Field we have an option to create New Record in Lightning View.  
Creating the New Record at Look-Up Field is a Standard Salesforce Out of the box functionality.
1)How can i restrict the user while trying to create the Record at Look-Up in lightning View ?

FYI:

User-added imageThanks in Advance...

Thanks,
Venkat.
Hi Team,
I am unable to see the Alphabet/Rolodex in Salesforce Lightning but which is available in Salesforce Classic. Please help me on this how could i get this feature in Lightning.

FYI:

User-added image

Thanks & Regsrds,
Venkat B.
 
Hi Team,
Please help me on below formula as each and every line with expaination.

IF( 
ISPICKVAL( Severity__c , "Critical")&& ISBLANK(Plan_Due_By_Date__c ), CASE( MOD(Today()-DATE(1900, 1, 7),7),0,Plan_Due_By_Date___c+2+10, 
1,Plan_Due_By_Date___c+4+10,  
2,Plan_Due_By_Date___c+4+10, 
3,Plan_Due_By_Date___c +4+10, 
4,Plan_Due_By_Date___c +4+10, 
5,Plan_Due_By_Date___c+4+10, 
Plan_Due_By_Date___c+3+10), 
IF( 
ISPICKVAL( Severity__c , "High")&&ISBLANK(Plan_Due_By_Date__c ), CASE( MOD(Today()-DATE(1900, 1, 7),7),0,Plan_Due_By_Date___c+2+10, 
1,Plan_Due_By_Date___c+4+10, 
2,Plan_Due_By_Date___c+4+10, 
3,Plan_Due_By_Date___c +4+10, 
4,Plan_Due_By_Date___c +4+10, 
5,Plan_Due_By_Date___c+4+10, 
Plan_Due_By_Date___c+3+10), 
IF( 
ISPICKVAL( Severity__c , "Medium")&&ISBLANK(Plan_Due_By_Date__c ), CASE( MOD(Today()-DATE(1900, 1, 7),7),0,Plan_Due_By_Date___c+6+20, 
1,Plan_Due_By_Date___c+8+20, 
2,Plan_Due_By_Date___c+8+20, 
3,Plan_Due_By_Date___c +8+20, 
4,Plan_Due_By_Date___c +8+20, 
5,Plan_Due_By_Date___c+8+20, 
Plan_Due_By_Date___c+7+20), 
IF( 
ISPICKVAL( Severity__c , "Low")&&ISBLANK(Plan_Due_By_Date__c ),CASE( MOD(Today()-DATE(1900, 1, 7),7),0,Plan_Due_By_Date___c+10+30, 
1,Plan_Due_By_Date___c+12+30, 
2,Plan_Due_By_Date___c+12+30, 
3,Plan_Due_By_Date___c+12+30, 
4,Plan_Due_By_Date___c+12+30, 
5,Plan_Due_By_Date___c+12+30, 
Plan_Due_By_Date___c+41),Plan_Due_By_Date__c 



)

Thanks in advance

Thanks,
Venkat.
Hi Team,

I have a requirement i want to clone the case with custom Action. Please provide me the reference component for this. While cloning the case i want to make sure few fiedls are blank with case status as NEW. 

                                      Thanks in advance 

Thanks,
Venkat.
Hi Team,

I am calling my component through the vf page asper my requirement, but i need to check the status field if the status is approved then only i need to call the component through vf page and if the status is rejected then it won't allowed to navigate to component.
Please help me on this thanks in advance...

Thanks
Venkat.
Hi Team,
I am learning integration with trailhead the module is Apex Web Services and Installed Cygwin tool. I gave the command into that tool like 

curl -v https://login.salesforce.com/services/oauth2/token -d "grant_type=password" -d "client_id=3MVG9YDQS5WtC11pyiouaZJOzMvd.Yvyx3tOb0pQguC0I7Hk6dJnfIO3DNvTFVJKjGycRZPCrQ2XKV0HbMWOS" -d "client_secret=3154661474188934965" -d "username=myusername" -d "password=mypwdCuyKLgVOI6Hf9IUJ2W1J0t2lX" -H 'X-PrettyPrint:1'
but getting error like command not found.Please anyone suggest me where i am missing.please find the below image for reference.
                                                             Thanks in advance...
User-added image

Thanks
Venkat.
Hi Team,

How to Display the current system date and Time with better UI template in lightning.Please help me on this.
                                 Thanks in advance....
Thanks
bvr.
Hi Team,

I have one question, how can i convince the client to migrate from salesforce classic to salesforce lightning. I searched a lot but I am getting regular points only like UI, responsive nature, reducing the server calls. But my team is asking me beyond this points. Can anyone please brief me in full technical terms. Why we are going for lightning?
Please help me on this.. Thanks in advance…

Thanks
Venkat.
Hi Team,
Any one is having the lightning documentation is done by their own.
If have please provide.. Thanks in advance\

Thanks 
Venkat.
Hi Team,
I Have one issue...
When i am tring to use var showToast = $A.get("e.force:showToast");  like this in my controller.Js  it is not working through the developer console.
But it is working into tab level. I required to work this into developer console. Is there any work aroud it. Please help me on this...
Thanks in advance...

Thanks
Venkat
Hi Team,

How we can Navigating from one application to another application in Lightning. What Are the Possible ways.Any code snippet.
Please help me on this.. Thanks in advance..

Thanks
Venkat
Hi Team,

How could we open a component into new tab from the same application in lightning.  What are the possibilities. Please help me on this.

Thanks
Venkat
Hi Team,
I am iterating the <a href="https://www.google.co.in/" target="_blank">My Google</a>. In hyper link how can we give the component URL. Is it possible...?.when i clicked on that hyper link i need to navigate to that particular component with record ID. I don't want to use the force:navigateToURL.
Please help me on this... Thanks in advance...
Reference Code:

 <aura:iteration items="{!v.ContactList}" var="acc">
                                        <tr>
                                            <th>
                                                <label class="slds-checkbox" id="{!acc.Id}">
                                                    <ui:inputCheckbox aura:id="checkContact" name="{!acc.Id}" text="{!acc.Id}" change="{!c.onCheckboxChange}" />

                                                    <span class="slds-checkbox--faux" />
                                                    <span class="slds-form-element__label"></span>
                                                </label>
                                            </th>
                                            <th scope="row">
                                                <div class="slds-truncate" title="">{!acc.Name}</div>
                                            </th>
                                            <td>
                                                <div class="slds-truncate" title="">{!acc.Phone}</div>
                                            </td>
                                            <th scope="row">
                                                <div class="slds-truncate" title="">{!acc.Email}</div>
                                            </th>

                                            <td>
                                                <div class="slds-truncate" title=""><a href="https://www.google.co.in/" target="_blank">My Google</a></div>
                                            </td>

                                            <th scope="row">
                                                <div class="slds-truncate" title="{!acc.PM_General_Notes__c}">{!acc.AccountId}</div>
                                            </th>

                                        </tr>
                                    </aura:iteration>

=============================================================
Ref Image:

User-added image
Thanks 
Venkat
I have Used jQuery DataTable Plugin In Salesforce Lightning Component . Now i want to remove unwanted sorting symbols in my table  from the loaded scripts.
So any one help me on this. Thanks in advance...

Ref Image:

User-added image
User-added image

Thanks
Venkat

 
I have Used jQuery DataTable Plugin In Salesforce Lightning Component . Now i want to remove unwanted css clases from the loaded scripts.
So any one help me on this. Thanks in advance...

User-added image

I Want to remove the highlighted css classes from the loaded scripts.
================================================================

Code Snippet:

.This  .dataTables_length {
    color: white!important;
}


User-added image

But in select option also i am getting white color, due to that i am unable to see the size of the paze like 10, 25, 50, 100. So i want to give another background color for select option only.This is all because of my page background color is black but it is mandatory.

Thanks 
Venkat


 
Hi Team,
Please help me on below formula as each and every line with expaination.

IF( 
ISPICKVAL( Severity__c , "Critical")&& ISBLANK(Plan_Due_By_Date__c ), CASE( MOD(Today()-DATE(1900, 1, 7),7),0,Plan_Due_By_Date___c+2+10, 
1,Plan_Due_By_Date___c+4+10,  
2,Plan_Due_By_Date___c+4+10, 
3,Plan_Due_By_Date___c +4+10, 
4,Plan_Due_By_Date___c +4+10, 
5,Plan_Due_By_Date___c+4+10, 
Plan_Due_By_Date___c+3+10), 
IF( 
ISPICKVAL( Severity__c , "High")&&ISBLANK(Plan_Due_By_Date__c ), CASE( MOD(Today()-DATE(1900, 1, 7),7),0,Plan_Due_By_Date___c+2+10, 
1,Plan_Due_By_Date___c+4+10, 
2,Plan_Due_By_Date___c+4+10, 
3,Plan_Due_By_Date___c +4+10, 
4,Plan_Due_By_Date___c +4+10, 
5,Plan_Due_By_Date___c+4+10, 
Plan_Due_By_Date___c+3+10), 
IF( 
ISPICKVAL( Severity__c , "Medium")&&ISBLANK(Plan_Due_By_Date__c ), CASE( MOD(Today()-DATE(1900, 1, 7),7),0,Plan_Due_By_Date___c+6+20, 
1,Plan_Due_By_Date___c+8+20, 
2,Plan_Due_By_Date___c+8+20, 
3,Plan_Due_By_Date___c +8+20, 
4,Plan_Due_By_Date___c +8+20, 
5,Plan_Due_By_Date___c+8+20, 
Plan_Due_By_Date___c+7+20), 
IF( 
ISPICKVAL( Severity__c , "Low")&&ISBLANK(Plan_Due_By_Date__c ),CASE( MOD(Today()-DATE(1900, 1, 7),7),0,Plan_Due_By_Date___c+10+30, 
1,Plan_Due_By_Date___c+12+30, 
2,Plan_Due_By_Date___c+12+30, 
3,Plan_Due_By_Date___c+12+30, 
4,Plan_Due_By_Date___c+12+30, 
5,Plan_Due_By_Date___c+12+30, 
Plan_Due_By_Date___c+41),Plan_Due_By_Date__c 



)

Thanks in advance

Thanks,
Venkat.
Hi Team,

I have a requirement i want to clone the case with custom Action. Please provide me the reference component for this. While cloning the case i want to make sure few fiedls are blank with case status as NEW. 

                                      Thanks in advance 

Thanks,
Venkat.
Hi Team,

How to Display the current system date and Time with better UI template in lightning.Please help me on this.
                                 Thanks in advance....
Thanks
bvr.
Hi Team,
Any one is having the lightning documentation is done by their own.
If have please provide.. Thanks in advance\

Thanks 
Venkat.
Hi Team,
I Have one issue...
When i am tring to use var showToast = $A.get("e.force:showToast");  like this in my controller.Js  it is not working through the developer console.
But it is working into tab level. I required to work this into developer console. Is there any work aroud it. Please help me on this...
Thanks in advance...

Thanks
Venkat
Hi Team,

How could we open a component into new tab from the same application in lightning.  What are the possibilities. Please help me on this.

Thanks
Venkat
Hi Team,
I am iterating the <a href="https://www.google.co.in/" target="_blank">My Google</a>. In hyper link how can we give the component URL. Is it possible...?.when i clicked on that hyper link i need to navigate to that particular component with record ID. I don't want to use the force:navigateToURL.
Please help me on this... Thanks in advance...
Reference Code:

 <aura:iteration items="{!v.ContactList}" var="acc">
                                        <tr>
                                            <th>
                                                <label class="slds-checkbox" id="{!acc.Id}">
                                                    <ui:inputCheckbox aura:id="checkContact" name="{!acc.Id}" text="{!acc.Id}" change="{!c.onCheckboxChange}" />

                                                    <span class="slds-checkbox--faux" />
                                                    <span class="slds-form-element__label"></span>
                                                </label>
                                            </th>
                                            <th scope="row">
                                                <div class="slds-truncate" title="">{!acc.Name}</div>
                                            </th>
                                            <td>
                                                <div class="slds-truncate" title="">{!acc.Phone}</div>
                                            </td>
                                            <th scope="row">
                                                <div class="slds-truncate" title="">{!acc.Email}</div>
                                            </th>

                                            <td>
                                                <div class="slds-truncate" title=""><a href="https://www.google.co.in/" target="_blank">My Google</a></div>
                                            </td>

                                            <th scope="row">
                                                <div class="slds-truncate" title="{!acc.PM_General_Notes__c}">{!acc.AccountId}</div>
                                            </th>

                                        </tr>
                                    </aura:iteration>

=============================================================
Ref Image:

User-added image
Thanks 
Venkat
Hi Team,

I am accessing the image in to my component  from the static resource. Now i want to implement the onMouseover event on that image.
When onMouseover on that image the background color should change to some other color.
Please help me on this. 
                                     Thanks in advance...
Code Snippet:

<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction" access="global" >
    <lightning:layout >

                                    <lightning:layoutItem size="3" padding="around-small">
                                        <div >
                                            <img style="height: 500px;" src="/resource/Mouseover/" /></div>
                                            
                                        
                                    </lightning:layoutItem>
    </lightning:layout>
</aura:component>
===================================
Reference Image:

User-added image
Hi Team,

I have a one data table with check boxes. Ineed to check only one check box at a time with the checked record ID.Please help me on this.
                                     Thanks in advance...

Reference code:

Component:

<aura:component  controller="ContactAuraController" implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction" access="global" >

    <!--Declare Event Handlers--> 
    <aura:handler name="init" action="{!c.doInit}" value="{!this}"/>
     
    <!--Declare Attributes-->
    <aura:attribute name="contactList" type="list" />   
    <aura:attribute name="isSelectAll" type="boolean" default="false"/>
      <aura:attribute name="recdId" type="String" /> 
    <div class="slds-m-around_xx-large">
        <h1 class="slds-text-heading--medium">Contacts</h1>
        <br/>
        <!--Contact List Table-->
        <table class="slds-table slds-table--bordered slds-table--cell-buffer" role="grid">      
            <thead>  
                <tr class="slds-text-title--caps">
                    <th>           
                        <label class="slds-checkbox">
                            <ui:inputCheckbox value="{!v.isSelectAll}" change="{!c.handleSelectedContacts}" aura:id="selectAll"/>
                            <span class="slds-checkbox--faux" />
                            <span class="slds-form-element__label"></span>
                        </label>
                    </th>
                    <th scope="col">
                        <div class="slds-truncate" title="Name">Name</div>
                    </th>
                    <th scope="col">
                        <div class="slds-truncate" title="Account">Account</div>
                    </th>
                     
                    <th scope="col">
                        <div class="slds-truncate" title="Phone">Phone</div>
                    </th>
                     
                    <th scope="col">
                        <div class="slds-truncate" title="Email">Email</div>
                    </th>
                </tr>
            </thead>
            <tbody>        
                <aura:iteration items="{!v.contactList}" var="con">
                    <tr>
                        <th>
                            <label class="slds-checkbox">
                                <ui:inputCheckbox aura:id="checkContact" value="" text="{!con.Id}"/>
                                <span class="slds-checkbox--faux" />
                                <span class="slds-form-element__label"></span>
                            </label>
                        </th>
                        <th scope="row">
                            <div class="slds-truncate" title="{!con.Name}">{!con.Name}</div>
                        </th>
                        <td>
                            <div class="slds-truncate" title="{!con.Account.Name}">{!con.Account.Name}</div>
                        </td>
                        <th scope="row">
                            <div class="slds-truncate" title="{!con.Phone}">{!con.Phone}</div>
                        </th>
                        <td>
                            <div class="slds-truncate" title="{!con.Email}">{!con.Email}</div>
                        </td>
                    </tr>
                </aura:iteration>
            </tbody>
        </table>
        <div>
            <br/>
            <!-- <lightning:button label="Submit" class="slds-button_brand" onclick="{!c.handleSelectedContacts }"  /> -->
        </div>
    </div>
</aura:component>

==================================
Controller.JS

({
    //get Contact List from apex controller
    doInit : function(component, event, helper) {
        var action = component.get("c.getContactList");
        action.setParams({
        });
        action.setCallback(this, function(result){
            var state = result.getState();
            if (component.isValid() && state === "SUCCESS"){
                component.set("v.contactList",result.getReturnValue());   
            }
        });
        $A.enqueueAction(action);
    },
     
    //Select all contacts
    
     
    //Process the selected contacts
    
    
    
    getSelectedName: function (cmp, event,helper) {
        debugger; 
        var selectedRows = event.getParam('selectedRows'); 
        
      
        for (var i = 0; i < selectedRows.length; i++){
           // alert(selectedRows[i].Id);
            cmp.set('v.recdId', selectedRows[i].Id); 
            
            var RecordID = cmp.get("v.recdId");
            alert('RecordID'+RecordID);
        
        }
    },
})
=================================
Apex Controller

public class ContactAuraController {
 @AuraEnabled
    Public static List<Contact> getContactList(){
        //get all contact list
        List<Contact> conList = [SELECT Id, Name, Account.Name, Phone, Email FROM Contact LIMIT 10];
        return conList;
    }
}

=====================================
Reference Image:

User-added image
Hi Team,

In lightning standard object under Activity  i can see the the buttons New Task,New Event,Log a call,Email 
.Reference Image.

User-added image

But for my custom object under activity  i can see only Email. How  can i enable for remaining buttons New Task,New Event,Log a call.
Please suggest me the procedure .
                                                      Thanks in advance...

Reference Image:

User-added image
Hi Team,
Just I created two components. My requirement is need to navigate one component to another component when i click on my image.
But i am getting some error like...This page has an error. You might just need to refresh it.
Action failed: c:Component1$controller$click [Cannot read property 'setParams' of undefined].
            
                Please help me on this... Thanks in advance...

Component1:

<ul class="slds-list--horizontal slds-has-dividers_around-space" onclick="{!c.click}">

  <lightning:layout >
            <lightning:layoutItem size="3" padding="around-small">
                 <div class="img " >
                    <img  style="height: 100px;" src="/resource/Images/Assets/1.png"  />   
                  <h1>TEXT1</h1>
                </div> 
            </lightning:layoutItem>
            <lightning:layoutItem size="3" padding="around-small">
                <div class="img1" >
                    <img style="height: 100px;" src="/resource/Images/Assets/2.png"  />  
                   <h1>TEXT2</h1>
                </div> 
            </lightning:layoutItem>
            <lightning:layoutItem size="3" padding="around-small">
               <div class="img2" ><img style="height: 100px;" src="/resource/Images/Assets/3.png" align="middle" />      
                <h1>TEXT3</h1>
                </div>
            </lightning:layoutItem>
            <lightning:layoutItem size="3" padding="around-small">
                <div class="img3"  style="text-align: left">
                    <img style="height: 100px;" src="/resource/Images/Assets/4.png"/>  
                    <h1>TEXT4</h1>
                </div>
            </lightning:layoutItem>
        </lightning:layout>
              


</ul>   

Controller.Js


click:function(component,event,helper){        

       
       var evt = $A.get("e.force:navigateToComponent");
        evt.setParams({
            componentDef : "c:Component2",
        
            });
        
      
        evt.fire();
    }
    
    Thanks
    Venkat
Hi Team,

I implemented a DataTable in lightning component with lightning:datatable tag.I need to check only one check box at a time and when i checked that check box i need to get that record id into URL.i have one image above the my datatable. When click on that image it should navigate to another compoent with the checked RecordId.
                                     Please help me on this... Thanks in advance

Refence Code:

My Refence code is 

Component:


<aura:component controller="DataTableWithPagenation">
    <aura:handler name="init" value="{!this}" action="{!c.doInit}" />
    
    <aura:attribute name="Accounts" type="Account[]"/>
    <aura:attribute name="page" type="integer" description="using for store page Number"/>
    <aura:attribute name="pages" type="integer" description="using for store All Pages page Number"/>
    <aura:attribute name="total" type="integer" description="total records count store "/>
    <aura:attribute name="mycolumns" type="List"/>
    
    <div class="slds-m-around_small">
        <div class="slds-page-header" role="banner">
            
            <p class="slds-page-header__title slds-truncate">{!v.total} Accounts • page {!v.page} / {!v.pages}</p>
            <ui:inputSelect aura:id="recordSize" label="Display Record Per Page: " change="{!c.onSelectChange}">
                <ui:inputSelectOption text="10" label="10" value="true"/>
                <ui:inputSelectOption text="15" label="15"/>
                <ui:inputSelectOption text="20" label="20"/>
            </ui:inputSelect>
        </div>
        
         <p class="slds-p-horizontal_small slds-box">
            <lightning:datatable data="{!v.Accounts}" columns="{! v.mycolumns }" keyField="id"  />
        </p>
        <div class="slds-align_absolute-center">            
                <lightning:button disabled="{!v.page == 1}" variant="brand" label="Previous Page" onclick="{! c.navigate }" />            
                <lightning:button disabled="{!v.page == v.pages}" aura:id="previousPage" variant="brand" label="Next Page" onclick="{! c.navigate }" />
            </div>
        
       <!-- <table class="slds-table slds-table_bordered slds-table_cell-buffer">
            <thead>
                <tr class="slds-text-title_caps">
                    <th scope="col">
                        <div class="slds-truncate" title="Name">Account Name</div>
                    </th>
                </tr>
            </thead>
            <tbody>
                <aura:iteration items="{!v.Accounts}" var="account"> 
                    <tr>
                        <th scope="row" data-label="Opportunity Name">
                            <div class="slds-truncate" title="{!account.Name}">{!account.Name}</div>
                        </th>
                    </tr>
                </aura:iteration>    
            </tbody>
        </table>-->
        
        
        
    </div>
</aura:component>
===============================================================
controller.js

({
   doInit: function(component, event, helper) {
      // this function call on the component load first time     
      // get the page Number if it's not define, take 1 as default
     
      var page = component.get("v.page") || 1;
      // get the select option (drop-down) values.   
      var recordToDisply = component.find("recordSize").get("v.value");
      
       component.set('v.mycolumns', [
                   {label: 'Account Name', fieldName: 'Name', type: 'Name',sortable:'true'},                   
                {label: 'Phone', fieldName: 'Phone', type: 'Phone',sortable:'true'},
                {label: 'Email ID', fieldName: 'Email_ID__c', type: 'Email',sortable:'true'}
            ]);
      
      // call the helper function   
      helper.getAccounts(component, page, recordToDisply);
 
   },
 
   navigate: function(component, event, helper) {
      // this function call on click on the previous page button  
      var page = component.get("v.page") || 1;
      // get the previous button label  
      var direction = event.getSource().get("v.label");
      // get the select option (drop-down) values.  
      var recordToDisply = component.find("recordSize").get("v.value");
      // set the current page,(using ternary operator.)  
      page = direction === "Previous Page" ? (page - 1) : (page + 1);
      // call the helper function
      helper.getAccounts(component, page, recordToDisply);
 
   },
 
   onSelectChange: function(component, event, helper) {
      // this function call on the select opetion change,     
      var page = 1
      var recordToDisply = component.find("recordSize").get("v.value");
      helper.getAccounts(component, page, recordToDisply);
   },
 
})
 
===============================================================================
helper.js


 ({
   getAccounts: function(component, page, recordToDisply) {
 
      // create a server side action. 
      var action = component.get("c.fetchAccount");
      // set the parameters to method 
      action.setParams({
         "pageNumber": page,
         "recordToDisply": recordToDisply
      });
      // set a call back   
      action.setCallback(this, function(a) {
         // store the response return value (wrapper class insatance)  
         var result = a.getReturnValue();
         console.log('result ---->' + JSON.stringify(result));
         // set the component attributes value with wrapper class properties.   
 
         component.set("v.Accounts", result.accounts);
         component.set("v.page", result.page);
         component.set("v.total", result.total);
         component.set("v.pages", Math.ceil(result.total / recordToDisply));
 
      });
      // enqueue the action 
      $A.enqueueAction(action);
   }
})
===================================================
Apex controller:


public   with sharing class DataTableWithPagenation {

   @AuraEnabled
 public static AccountPagerWrapper fetchAccount(Decimal pageNumber ,Integer recordToDisply) {
      Integer pageSize = recordToDisply;
      Integer offset = ((Integer)pageNumber - 1) * pageSize;
    
    // create a instance of wrapper class.
    AccountPagerWrapper obj =  new AccountPagerWrapper();
    // set the pageSize,Page(Number), total records and accounts List(using OFFSET)   
        obj.pageSize = pageSize;
        obj.page = (Integer) pageNumber;
        obj.total = [SELECT count() FROM account];
        obj.accounts = [SELECT Id, Name,Phone,Email_ID__c FROM Account ORDER BY Name LIMIT :recordToDisply OFFSET :offset];
    // return the wrapper class instance .
        return obj;
     }
    
 // create a wrapper class with @AuraEnabled Properties    
 public class AccountPagerWrapper {
    @AuraEnabled public Integer pageSize {get;set;}
    @AuraEnabled public Integer page {get;set;}
    @AuraEnabled public Integer total {get;set;}
    @AuraEnabled public List<Account> accounts {get;set;}
   }
}
=====================================================================================User-added image

Thanks & Regards
Venakt

 
Hi Team, 

I am having datatable with pagenation concept. As of now i am displaing the records.My requirement is
need to populate the checkbox beside the records what i am getting from the object. And need to sort  records based onReference image colum headers.  At a time we need to check only one check box. After checking that check box i need to click on above any one of the four images iam having 4 images above my datatable and  that should navigate to another component ex: abc.cmp with that checked record Id.Please kindly help me on this.

                                                                                         Thanks in advance...
                            


Controller:


public class ContactAuraController {
    @AuraEnabled
    public static ContactDataTableWrapper getContactData(Decimal pageNumber, Decimal pageSize) {
         
        Integer pSize = (Integer)pageSize;
        Integer pNumber = (Integer)pageNumber;
         
        //Offset for SOQL
        Integer offset = (pNumber - 1) * pSize;
         
        //Total Records
        Integer totalRecords = [SELECT COUNT() FROM Contact];
        Integer recordEnd = pSize * pNumber;
 
        //Instance of Contact DataTable Wrapper Class
        ContactDataTableWrapper objDT =  new ContactDataTableWrapper();  
        objDT.pageSize = pSize;
        objDT.pageNumber = pNumber;
        objDT.recordStart = offset + 1;
        objDT.recordEnd = totalRecords >= recordEnd ? recordEnd : totalRecords;
        objDT.totalRecords = totalRecords;
        objDT.contactList = [SELECT Id, Name, Phone, Email FROM Contact ORDER BY Name LIMIT :pSize OFFSET :offset];
        return objDT;
    }
     
    //Wrapper Class For Contact DataTable  
    public class ContactDataTableWrapper {
        @AuraEnabled
        public Integer pageSize {get;set;}
        @AuraEnabled
        public Integer pageNumber {get;set;}
        @AuraEnabled
        public Integer totalRecords {get;set;}
        @AuraEnabled
        public Integer recordStart {get;set;}
        @AuraEnabled
        public Integer recordEnd {get;set;}
        @AuraEnabled
        public List<Contact> contactList {get;set;}
    }
}
=============================================

Component



<!--Pagination.cmp-->
<aura:component controller="ContactAuraController">
    <aura:handler name="init" value="{!this}" action="{!c.doInit}" />
     
    <aura:attribute name="ContactList" type="Contact[]"/>
    <aura:attribute name="PageNumber" type="integer" default="1"/>
    <aura:attribute name="TotalPages" type="integer" default="0"/>
    <aura:attribute name="TotalRecords" type="integer" default="0"/>
    <aura:attribute name="RecordStart" type="integer" default="0"/>
    <aura:attribute name="RecordEnd" type="integer" default="0"/>
     
    <div class="slds-m-around_xx-large">
        <h1 class="slds-text-heading--medium">Contacts</h1>
        <br/>
        <div class="slds-float_right">
            <ui:inputSelect aura:id="pageSize" label="Display Records Per Page: " change="{!c.onSelectChange}">
                <ui:inputSelectOption text="10" label="10" value="true"/>
                <ui:inputSelectOption text="15" label="15"/>
                <ui:inputSelectOption text="20" label="20"/>
            </ui:inputSelect>
            <br/>
        </div>
         
        <table class="slds-table slds-table_bordered slds-table_cell-buffer">
            <thead>
                <tr class="slds-text-title_caps">
                    <th scope="col">
                        <strong><div class="slds-truncate" title="Name">Name</div></strong>
                    </th>
                    <th scope="col">
                        <strong><div class="slds-truncate" title="Phone">Phone</div></strong>
                    </th>
                    <th scope="col">
                        <strong><div class="slds-truncate" title="Email">Email</div></strong>
                    </th>
                </tr>
            </thead>
            <tbody>
                <aura:iteration items="{!v.ContactList}" var="con"> 
                    <tr>
                        <th scope="row" data-label="Name">
                            <div class="slds-truncate" title="{!con.Name}">{!con.Name}</div>
                        </th>
                        <th scope="row" data-label="Phone">
                            <div class="slds-truncate" title="{!con.Phone}">{!con.Phone}</div>
                        </th>
                        <th scope="row" data-label="Email">
                            <div class="slds-truncate" title="{!con.Email}">{!con.Email}</div>
                        </th>
                    </tr>
                </aura:iteration> 
            </tbody>
        </table>
         
        <div class="slds-clearfix">
            <div class="slds-page-header" role="banner">
                <div class="slds-float_right">            
                    <lightning:button disabled="{!v.PageNumber == 1}" variant="brand" aura:id="prevPage" label="Prev" onclick="{!c.handlePrev}" />            
                    <lightning:button disabled="{!v.PageNumber == v.TotalPages}" aura:id="nextPage" variant="brand" label="Next" onclick="{!c.handleNext}"/>
                </div>
                <p class="slds-page-header__title">{!v.RecordStart}-{!v.RecordEnd} of {!v.TotalRecords} | Page {!v.PageNumber} of {!v.TotalPages}</p>
            </div>
        </div>
    </div>
</aura:component>
====================================================
Controller.js


({
    doInit: function(component, event, helper) {
        var pageNumber = component.get("v.PageNumber");  
        var pageSize = component.find("pageSize").get("v.value"); 
        helper.getContactList(component, pageNumber, pageSize);
    },
     
    handleNext: function(component, event, helper) {
        var pageNumber = component.get("v.PageNumber");  
        var pageSize = component.find("pageSize").get("v.value");
        pageNumber++;
        helper.getContactList(component, pageNumber, pageSize);
    },
     
    handlePrev: function(component, event, helper) {
        var pageNumber = component.get("v.PageNumber");  
        var pageSize = component.find("pageSize").get("v.value");
        pageNumber--;
        helper.getContactList(component, pageNumber, pageSize);
    },
     
    onSelectChange: function(component, event, helper) {
        var page = 1
        var pageSize = component.find("pageSize").get("v.value");
        helper.getContactList(component, page, pageSize);
    },
})

===============================================================
helper.js

({
    getContactList: function(component, pageNumber, pageSize) {
        var action = component.get("c.getContactData");
        action.setParams({
            "pageNumber": pageNumber,
            "pageSize": pageSize
        });
        action.setCallback(this, function(result) {
            var state = result.getState();
            if (component.isValid() && state === "SUCCESS"){
                var resultData = result.getReturnValue();
                component.set("v.ContactList", resultData.contactList);
                component.set("v.PageNumber", resultData.pageNumber);
                component.set("v.TotalRecords", resultData.totalRecords);
                component.set("v.RecordStart", resultData.recordStart);
                component.set("v.RecordEnd", resultData.recordEnd);
                component.set("v.TotalPages", Math.ceil(resultData.totalRecords / pageSize));
            }
        });
        $A.enqueueAction(action);
    }
})
===================================================================================


Thanks
Venat