• Vaibhab Shah
  • NEWBIE
  • 10 Points
  • Member since 2019

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 9
    Questions
  • 8
    Replies
Hi,

I am having an apex controller with the following method whose return type is again a different class. Below is my code:

@AuraEnabled
public static AccountPagerWrapper getData (Decimal pageNumber ,Integer recordToDisply)
    {
        Integer pageSize = recordToDisply;
        Integer offset = ((Integer)pageNumber - 1) * pageSize;
        
        String queryCount = 'SELECT count() FROM Account';
        
        String finalQuery = 'dynamic query';
        List<Account> returnList = new List<Account>();
        returnList = database.query(finalQuery);       
        
        AccountPagerWrapper obj =  new AccountPagerWrapper();
        obj.pageSize = pageSize;
        obj.page = (Integer) pageNumber;
        
        obj.total =  database.countQuery(queryCount);  
        obj.accounts = returnList;
        return obj;
    }

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;}
   }

Can anyone tell how to assign the dynamic query results in accounts property of the AccountPagerWrapper. Line is marked with bold.

I am simply assigning the dynamic query results in the property but it is throwing an error while binding it with the table.

Thnx,
Vai
Hi,

I am apex controller with the following method whose return type is again a different class. Below is my code:

@AuraEnabled
public static AccountPagerWrapper getData (Decimal pageNumber ,Integer recordToDisply)
    {
        Integer pageSize = recordToDisply;
        Integer offset = ((Integer)pageNumber - 1) * pageSize;
        
        String queryCount = 'SELECT count() FROM Account';
        
        String finalQuery = 'dynamic query';
        List<Account> returnList = new List<Account>();
        returnList = database.query(finalQuery);       
        
        AccountPagerWrapper obj =  new AccountPagerWrapper();
        obj.pageSize = pageSize;
        obj.page = (Integer) pageNumber;
        
        obj.total =  database.countQuery(queryCount);  
        obj.accounts = returnList;
        return obj;
    }

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;}
   }

Can anyone tell how to assign the dynamic query results in accounts property of the AccountPagerWrapper. Line is marked with bold.

I am simply assigning the dynamic query results in the property but it is throwing an error while binding it with the table.
Hi,
I have a table to display more than 10 columns in lightning. How to make the div or table fixed with resizable columns.
I am using html table and looping using aura:iteration ( i don't want to use lightning: datatable as there are some issues with lightning datatable) as I want to query from salesforce object.

Thx!
Vai
Hi,
I was asked in an interview the below question:
There is a custom object X and there is an Account Object.
Account object and X object do not have any relationship.

Whenever I will create an account record, I need to populate a text field with a value of X object on acccount object. This needs to be acheived using configuration and no customization.
Hi,
Can anyone of you help me with the code for multiselect combobox? I don't want duallistbox, I want a combobox or picklist where user can select more than 1 value.

Thanks,
Vai
Hi, 
Can anyone let me know how to develop searchable dropdown in lightning? My requirement is to show multiple searchable dropdown in a div.

Thnx,
Vai
Hi, 
I have a list of list of map.
List<list<map<string,string>>> customer

How to the retrieve the values of the map in Apex?
Thanks in adv.

Rgds,
Vai
 
Hi,

I have used one lightning button at the end of the row which is getting distorted and not in shape with the other columns in a row.
Initially there will be any row in the table. only header with columns will be visible. On clicking the Add row, rows will be added.
I have attached the screenshot.

PFB my code:

<template>
    <lightning-card class="slds-card_boundary" icon-name="custom:custom13">
        <h1 slot="title">{title}</h1>
        <div class="slds-card__body slds-card__body_inner">
            <table class="slds-table slds-table_bordered slds-table_cell-buffer slds-m-bottom_large"> 
                <thead>
                    <tr class="slds-text-title_caps">
                        <template for:each={columns} for:item="column">
                            <th key={column.apiName}><div class="slds-truncate">{column.label}</div></th>
                        </template>
                    </tr>
                </thead>
                <tbody>
                    <template for:each={rows} for:item="row" for:index="index">
                        <tr class="inputRows" key={row.uuid}>
                            <template for:each={columns} for:item="column">
                                <td key={column.apiName}>
                                    <c-input-table-cell record={row} field={column.apiName}></c-input-table-cell>
                                </td>
                            </template>
                            <td>
                                <lightning-button value={index} variant="brand" label="Delete Row" onclick={removeRow}></lightning-button>
                            </td>
                        </tr>
                    </template>
                </tbody>
                <tfoot>
                    <tr>
                        <td><lightning-button variant="brand" label="Add Row" onclick={addRow}></lightning-button></td>
                    </tr>
                </tfoot>
            </table>
        </div>
    </lightning-card>
</template>


 
Hi,
I have a requirment where I have to develop a lightning web component UI to insert more than 1 record into Account object by clicking Add Row button and then inserting all the records by clicking Submit button. Can anyone help me on this? 
Hi,
I was asked in an interview the below question:
There is a custom object X and there is an Account Object.
Account object and X object do not have any relationship.

Whenever I will create an account record, I need to populate a text field with a value of X object on acccount object. This needs to be acheived using configuration and no customization.
Hi,
I have a table to display more than 10 columns in lightning. How to make the div or table fixed with resizable columns.
I am using html table and looping using aura:iteration ( i don't want to use lightning: datatable as there are some issues with lightning datatable) as I want to query from salesforce object.

Thx!
Vai
Hi, 
I have a list of list of map.
List<list<map<string,string>>> customer

How to the retrieve the values of the map in Apex?
Thanks in adv.

Rgds,
Vai
 
Hi,

I have used one lightning button at the end of the row which is getting distorted and not in shape with the other columns in a row.
Initially there will be any row in the table. only header with columns will be visible. On clicking the Add row, rows will be added.
I have attached the screenshot.

PFB my code:

<template>
    <lightning-card class="slds-card_boundary" icon-name="custom:custom13">
        <h1 slot="title">{title}</h1>
        <div class="slds-card__body slds-card__body_inner">
            <table class="slds-table slds-table_bordered slds-table_cell-buffer slds-m-bottom_large"> 
                <thead>
                    <tr class="slds-text-title_caps">
                        <template for:each={columns} for:item="column">
                            <th key={column.apiName}><div class="slds-truncate">{column.label}</div></th>
                        </template>
                    </tr>
                </thead>
                <tbody>
                    <template for:each={rows} for:item="row" for:index="index">
                        <tr class="inputRows" key={row.uuid}>
                            <template for:each={columns} for:item="column">
                                <td key={column.apiName}>
                                    <c-input-table-cell record={row} field={column.apiName}></c-input-table-cell>
                                </td>
                            </template>
                            <td>
                                <lightning-button value={index} variant="brand" label="Delete Row" onclick={removeRow}></lightning-button>
                            </td>
                        </tr>
                    </template>
                </tbody>
                <tfoot>
                    <tr>
                        <td><lightning-button variant="brand" label="Add Row" onclick={addRow}></lightning-button></td>
                    </tr>
                </tfoot>
            </table>
        </div>
    </lightning-card>
</template>


 
Hi,
I have a requirment where I have to develop a lightning web component UI to insert more than 1 record into Account object by clicking Add Row button and then inserting all the records by clicking Submit button. Can anyone help me on this?