• firstqa system
  • NEWBIE
  • 10 Points
  • Member since 2020

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 12
    Questions
  • 6
    Replies
from past few days when ever i deploy even though after creating new lwc component with writing anything if i deploy i getting the following errors
please guide me how to fix this


Deploy Errors
PROJECT PATH  ERRORS                                                                              

              duplicate value found: <unknown> duplicates value on record with id: <unknown>                 
              duplicate value found: <unknown> duplicates value on record with id: <unknown>                 
              duplicate value found: <unknown> duplicates value on record with id: <unknown>                 
              duplicate value found: <unknown> duplicates value on record with id: <unknown>                 
              duplicate value found: <unknown> duplicates value on record with id: <unknown>                 
              duplicate value found: <unknown> duplicates value on record with id: <unknown>                 
              duplicate value found: <unknown> duplicates value on record with id: <unknown>                 
              duplicate value found: <unknown> duplicates value on record with id: <unknown>                 
              duplicate value found: <unknown> duplicates value on record with id: <unknown>                 
              duplicate value found: <unknown> duplicates value on record with id: <unknown>                 
              duplicate value found: <unknown> duplicates value on record with id: <unknown>                 
              duplicate value found: <unknown> duplicates value on record with id: <unknown>                 
              duplicate value found: <unknown> duplicates value on record with id: <unknown>                 
              duplicate value found: <unknown> duplicates value on record with id: <unknown>                 
              duplicate value found: <unknown> duplicates value on record with id: <unknown>                 
              duplicate value found: <unknown> duplicates value on record with id: <unknown>                 
              duplicate value found: <unknown> duplicates value on record with id: <unknown>                 
              duplicate value found: <unknown> duplicates value on record with id: <unknown>                 
              duplicate value found: <unknown> duplicates value on record with id: <unknown>                 
              duplicate value found: <unknown> duplicates value on record with id: <unknown>                 
              Unable to build Lightning Component source for markup://c:servicestation: Invalid suffix: json.
              duplicate value found: <unknown> duplicates value on record with id: <unknown>                 
              duplicate value found: <unknown> duplicates value on record with id: <unknown>                 
              duplicate value found: <unknown> duplicates value on record with id: <unknown>                 
              duplicate value found: <unknown> duplicates value on record with id: <unknown>                 
              duplicate value found: <unknown> duplicates value on record with id: <unknown>                 
              duplicate value found: <unknown> duplicates value on record with id: <unknown>                 
              duplicate value found: <unknown> duplicates value on record with id: <unknown>                 
              duplicate value found: <unknown> duplicates value on record with id: <unknown>                 
              duplicate value found: <unknown> duplicates value on record with id: <unknown>                 
              duplicate value found: <unknown> duplicates value on record with id: <unknown>                 
              duplicate value found: <unknown> duplicates value on record with id: <unknown>                 
              duplicate value found: <unknown> duplicates value on record with id: <unknown>                 
              duplicate value found: <unknown> duplicates value on record with id: <unknown>                 
              duplicate value found: <unknown> duplicates value on record with id: <unknown>                 

 
If I am in account record detail page and if I click new contact button the customer name field value should be populate from account using Lwc

pls help me

mazhari bobby
mazharibobby829@gmail.com
8328174785
renderedCallback(){
this.template.querySelector('lightning-button.Previous').disabled = true;
}

if i include this line in my code i am getting error as  Error during LWC component connect phase: [Cannot set property 'disabled' of null]

what to do how to rectify this

for full code refer this :https://medium.com/@rs60033/pagination-in-lwc-lightning-web-component-7a6dcb5a9385

and please help me how to rectify this 

syed e h mazhari
mazharibobby829@gmail.com
8328174785

 

i have designed lightning datatable with pagination and row actions edit and delete when i perform row action in page one the data will be refreshed but when i perform in 2 3 4 5 and sooon pages data is not refreshed i am using lwc
 i can not paste my code because it is more than 32000 characters 
pls help me

syed e h mazhari

8328174785

mazharibobby829@gmail.com
java script:

import { LightningElement, track, wire } from 'lwc';
import getDealers from '@salesforce/apex/OppTableContoller.getDealers';
import { NavigationMixin } from 'lightning/navigation';
import {ShowToastEvent} from 'lightning/platformShowToastEvent';
import {refreshApex} from '@salesforce/apex';
import {deleteRecord} from 'lightning/uiRecordApi'

const actions = [
    { label: 'View', name: 'view' },
    { label: 'Edit', name: 'edit' },
    { label: 'Delete', name: 'delete' },
  ];
const columns = [
 //  { label:'Opportunity Name', fieldName: 'oppLink', type: 'url', typeAttributes: {label: {fieldName: 'Name'}, tooltip:'Go to detail page', target: '_blank'}},
   { label: 'Name', fieldName: 'Link',type:'url', typeAttributes: {label: {fieldName: 'Name'}, tooltip:'Go to detail page', target: '_blank'}}, 
   { label: 'Dealer_code__c', fieldName: 'Dealer_code__c' },
   { label: 'Dealer_Contact_Person__c', fieldName: 'Dealer_Contact_Person__c' },
   { label: 'Dealer_Mobile__c', fieldName: 'Dealer_Mobile__c' },
   { label: 'Dealer_E_Mail__c', fieldName: 'Dealer_E_Mail__c' },
   { label: 'Service_catgories__c', fieldName: 'Service_catgories__c' },
   { label: 'Transport_Assistance__c', fieldName: 'Transport_Assistance__c' },
   { label: 'Company_Contract_Start_Date__c', fieldName: 'Company_Contract_Start_Date__c' },
   { label: 'Company_Contract_End_Date__c', fieldName: 'Company_Contract_End_Date__c' },
   {
    type: 'action',
    typeAttributes: { rowActions: actions },
}, 
   
];
export default class OppTable extends NavigationMixin( LightningElement ) {
    @track error;
    @track columns = columns;
    @track opps; 
    @track showTable = false;  
    @track recordsToDisplay = []; 
    @track rowNumberOffset; 
    @wire(getDealers)
   
    wopps({error,data}){
        if(data){
            let recs = [];
            for(let i=0; i<data.length; i++){
                let opp = {};
                opp.rowNumber = ''+(i+1);
                opp.Link = '/'+data[i].Id;
                opp = Object.assign(opp, data[i]);
                recs.push(opp);
            }
            this.opps = recs;
            this.showTable = true;
        }else{
            this.error = error;
        }   
    }
    navigateToNewdealerPage() {
        this[NavigationMixin.Navigate]({
            type: 'standard__objectPage',
            attributes: {
                objectApiName: 'Dealer__c',
                actionName: 'new',
              
            },
        });
    }
    handleRowAction( event ) {
        const actionName = event.detail.action.name;
        const row = event.detail.row;
        switch ( actionName ) {
            case 'view':
                this[NavigationMixin.Navigate]({
                    type: 'standard__recordPage',
                    attributes: {
                        recordId: row.Id,
                        actionName: 'view'
                    }
                });
                break;
            case 'edit':
                this[NavigationMixin.Navigate]({
                    type: 'standard__recordPage',
                    attributes: {
                        recordId: row.Id,
                        objectApiName: 'Dealer__c',
                        actionName: 'edit'
                    }
                   
                });

                break;
             //   window.location.reload();
            case'delete':
            var txt;
            var r = confirm("Are you sure you want to delete?");
            if(r == true){
               this.recordId = event.target.value;
               deleteRecord(row.Id) 
               .then(() =>{
           
                  const toastEvent = new ShowToastEvent({
                      title:'Record Deleted',
                      message:'Record deleted successfully',
                      variant:'success',
                     
                     
                     
                  })
                  this.dispatchEvent(toastEvent);
                 //return refreshApex(this.data);
                 
                 
                 
                 
                   

                
                 window.location.reload();
           
                 
                  
                  
               })
            }
               
               else{
                   txt ="you have selected cancel "
              
               }
               break;
            default:
        }
    }
      
  
    handlePaginatorChange(event){
        this.recordsToDisplay = event.detail;
        this.rowNumberOffset = this.recordsToDisplay[0].rowNumber-1;
    }
}

---------------------------------------------------------------------------------------------------

html:

<template>
    <lightning-card title="Data Table with Pagination">
        <template if:true={showTable}>
            
          <lightning-button label="New dealer" onclick={navigateToNewdealerPage} class="slds-float_left"></lightning-button> 
            <c-paginator records={opps} 
                        total-records={opps.length} 
                        show-search-box="true" 
                        onpaginatorchange={handlePaginatorChange}>
            </c-paginator>
            <lightning-datatable key-field="Id" 
                                data={recordsToDisplay} 
                                columns={columns}
                                onrowaction={handleRowAction}
                                hide-checkbox-column
                                show-row-number-column
                                row-number-offset={rowNumberOffset}>
            </lightning-datatable>
        </template>
    </lightning-card>
</template>

----------------------------------------------------------------------------------------------------
apex
public with sharing class OppTableContoller {    
    @AuraEnabled(cacheable=true)
    public static List< Dealer__c> getDealers() {
        return [SELECT Id, Dealer_code__c, Name, Dealer_Contact_Person__c, Dealer_Mobile__c, Dealer_E_Mail__c, Service_catgories__c, Transport_Assistance__c, Company_Contract_Start_Date__c, Company_Contract_End_Date__c FROM Dealer__c ];
    }
}


here i am performing lwc row actions edit and delete and serach operation in lightning data table with pagination my reuirement is when i delete a record i need modal popup message stating are sure u want delete and after delete it should automatically refreshed 

so plz help me 

thanks in advance

syed e h mazhari
mazharibobby829@gmail.com
8328174785
html
<template>
    <lightning-card title="vehicle details">
        <div class="slds-m-around_medium">
            <lightning-button label="New vechile" onclick={navigateToNewvehiclePage}></lightning-button>
            <lightning-input type="search" onchange={handleKeyChange} class="slds-m-bottom_small" label="Search"
                value={searchKey}></lightning-input>
            <lightning-datatable key-field="Id" data={data} columns={columns} sorted-by={sortedBy}
                sorted-direction={sortedDirection} onsort={sortColumns} onrowaction={handleRowAction}>
            </lightning-datatable>
            </br>
            <lightning-layout horizontal-align="space">
                <lightning-layout-item flexibility="auto">
                    <lightning-button label="Previous" icon-name="utility:chevronleft" onclick={previousHandler}>
                    </lightning-button>
                </lightning-layout-item>
                <lightning-layout-item flexibility="auto">
                    Page {page} of {totalPage} total no of records-{totalRecountCount}
                </lightning-layout-item>
                <lightning-layout-item flexibility="auto">
                    <lightning-button label="Next" icon-name="utility:chevronright" icon-position="right"
                        onclick={nextHandler}></lightning-button>
                </lightning-layout-item>
            </lightning-layout>
        </div>
    </lightning-card>
</template>
--------------------------------------------------------------------------------------------
js
import { api, LightningElement, track, wire } from 'lwc';
import  fetchvechile from '@salesforce/apex/viewapex.fetchvechile';
import { NavigationMixin } from 'lightning/navigation';
import {ShowToastEvent} from 'lightning/platformShowToastEvent';
import {deleteRecord} from 'lightning/uiRecordApi';
import {refreshApex} from '@salesforce/apex';
const actions = [
  { label: 'View', name: 'view' },
  { label: 'Edit', name: 'edit' },
  { label: 'Delete', name: 'delete' },
];
const columns =  [{ label: 'Name', fieldName: 'Name' }, 
{ label: 'RegNumber', fieldName: 'RegNumber__c' },
{ label: 'Model', fieldName: 'Model__c' },
{ label: 'Purchase Amount', fieldName: 'Purchase_Amount__c' },
{ label: 'Purchase Date', fieldName: 'Purchase_Date__c' },
{ label: 'Last Service', fieldName: ',Last_Service__c' },
{ label: 'NextserviceDate', fieldName: 'Next_service_Date__c' },
{
    type: 'action',
    typeAttributes: { rowActions: actions },
}, 
];
export default class DeleteContactLwc extends NavigationMixin( LightningElement ){
  @track value;
  @track error;
  @track data;
  @api sortedDirection = 'asc';
  @api sortedBy = 'Name';
  @api searchKey = '';
  result;
  
  @track page = 1; 
  @track items = []; 
  @track data = []; 
  @track columns; 
  @track startingRecord = 1;
  @track endingRecord = 0; 
  @track pageSize = 5; 
  @track totalRecountCount = 0;
  @track totalPage = 0;
  
  @wire(fetchvechile, {searchKey: '$searchKey', sortBy: '$sortedBy', sortDirection: '$sortedDirection'})
  wiredAccounts({ error, data }) {
      if (data) {
      
          this.items = data;
          this.totalRecountCount = data.length; 
          this.totalPage = Math.ceil(this.totalRecountCount / this.pageSize); 
          
          this.data = this.items.slice(0,this.pageSize); 
          this.endingRecord = this.pageSize;
          this.columns = columns;
          this.error = undefined;
        } 
        else if (error) {
          this.error = error;
          this.data = undefined;
      }
  }
  navigateToNewvehiclePage() {
    this[NavigationMixin.Navigate]({
        type: 'standard__objectPage',
        attributes: {
            objectApiName: 'vehicle__c',
            actionName: 'new',
          
        },
          
    });
   
}
  //clicking on previous button this method will be called
  previousHandler() {
      if (this.page > 1) {
          this.page = this.page - 1; //decrease page by 1
          this.displayRecordPerPage(this.page);
      }
  }
  nextHandler() {
    if((this.page<this.totalPage) && this.page !== this.totalPage){
        this.page = this.page + 1; //increase page by 1
        this.displayRecordPerPage(this.page);            
    }             
}
//this method displays records page by page
displayRecordPerPage(page){
    this.startingRecord = ((page -1) * this.pageSize) ;
    this.endingRecord = (this.pageSize * page);
    this.endingRecord = (this.endingRecord > this.totalRecountCount) 
                        ? this.totalRecountCount : this.endingRecord; 
    this.data = this.items.slice(this.startingRecord, this.endingRecord);
    this.startingRecord = this.startingRecord + 1;
}    
sortColumns( event ) {
  this.sortedBy = event.detail.fieldName;
  this.sortedDirection = event.detail.sortDirection;
  return refreshApex(this.result);
  
}
handleRowAction( event ) {
  const actionName = event.detail.action.name;
  const row = event.detail.row;
  switch ( actionName ) {
      case 'view':
          this[NavigationMixin.Navigate]({
              type: 'standard__recordPage',
              attributes: {
                  recordId: row.Id,
                  actionName: 'view'
              }
          });
          break;
      case 'edit':
          this[NavigationMixin.Navigate]({
              type: 'standard__recordPage',
              attributes: {
                  recordId: row.Id,
                  objectApiName: 'vehicle__c',
                  actionName: 'edit'
              }
             });
       
          break;
      case'delete':
         this.recordId = event.target.value;
         deleteRecord(row.Id) 
         .then(() =>{
     
            const toastEvent = new ShowToastEvent({
                title:'Record Deleted',
                message:'Record deleted successfully',
                variant:'success',
            })
            this.dispatchEvent(toastEvent);
            refreshApex(this.result);
           
            
            
         })
         .catch(error =>{
             window.console.log('Unable to delete record due to ' + error.body.message);
         });
         break;
      default:
  }
}
handleKeyChange( event ) {
  this.searchKey = event.target.value;
  return refreshApex(this.result);
}

}
this my javascript and html code to perform lighting data Table rowaction edit delete view with pagenation but problem is when i delete record it,s automatically delete  the record without pop up msg.i need pop up message and when i perform edit operation table is not automatically  updated .when i give refersh it will updated .soi need refersh it automatically.help me
thanks in advance 
Email-arunkuppusamy001@gmail.com
mobile-9566594515 & 8328174785
User-added image i want to  design custom page like this standard page by including new button and edit button and delete button and search option like shown in picture by using  lightning web components (java script ,html ) apex (if needed)

please help me 

thanks in advance
syed e h mazhari

8328174785
mazharibobby829@gmail.com

 
How to shorten the email service address generated by salesforce is that possible  or how can we add that in gmail forward address but when i am trying that it is asking verfiction code where to see that verfication code 
hello  wrote apex class and created email services but it is only working when i send  the email to the very long sf generated email address and lead is generating but i need to generate lead when i give small  email address like first@gmail.com  

This is my apex code

global class CreateLeadFrmEmail implements Messaging.InboundEmailHandler {
    
     
    
    global Messaging.InboundEmailResult handleInboundEmail(Messaging.InboundEmail email,
    Messaging.InboundEnvelope envelope) {
 
        Messaging.InboundEmailResult result = new Messaging.InboundEmailresult();

       // String subToCompare = 'CreateLead';

       // if(email.subject.equalsIgnoreCase(subToCompare))
        //{
           FirstQA_Leads__c c = new FirstQA_Leads__c();
            c.Name= email.fromAddress;
           c.Description__c=email.plainTextBody;
           c.Lead_Status__c='from email';
           
            insert c;
 
            

 
    result.success = true;
        return result;
    }
 
   
}

kindly help me in this Thanks in advance 

Regards
Syed E H Mazhari 
mazharibobby829@gmail.com 
8328174785
I need to create a lead through email i have crated apex class  i want to know what is the next process after writing apex code to generate lead from email

This is my apex class

global class CreateLeadExample implements Messaging.InboundEmailHandler {
    global Messaging.InboundEmailResult handleInboundEmail(Messaging.inboundEmail email, 
                                                         Messaging.InboundEnvelope env){
      // Create an InboundEmailResult object for returning the result of the  
      // Apex Email Service 
      Messaging.InboundEmailResult result = new Messaging.InboundEmailResult();
      String myPlainText= '';
  
      // Add the email plain text into the local variable  
      myPlainText = email.plainTextBody;
  
      // Check for existing leads with this email address   
      Lead[] leads = [SELECt Id, Name, Email
        FROM Lead
        WHERE Email = :email.fromAddress];
  
      if (leads.size() == 0) {
        // New Lead object to be created - set LastName and Company to
        // dummy values for simplicity
        Lead newLead = new Lead(Email = email.fromAddress, 
          LastName = 'From Email', 
          Company = 'From Email');
  
        // Insert a new lead
        insert newLead;    
  
        System.debug('New Lead record: ' + newLead );   
      } else {
        System.debug('Incoming email duplicates existing Lead record(s): ' + leads );    
      }
  
      // Set the result to true. No need to send an email back to the user      
      // with an error message   
      result.success = true;
  
      // Return the result for the Apex Email Service 
      return result;
    }
  }

Kindly help me in this thank you in advance 

Regards
Syed E H Mazhari
8328174785
mazharibobby829@gmail.com
 
I have created an event with the subject "Contract Proposal". It has been saved in the event object but it is not displayed in OpenActivitiesUser-added imageUser-added image


Kindly help me with this. ThankYou in advance.

Regards,
Fewin Samuel,
9486704965,
fewinsamuel@gmail.com.
I have created a custom object FirstQA_Leads. I am creating a event that needs to store in the object. How to do so?
from past few days when ever i deploy even though after creating new lwc component with writing anything if i deploy i getting the following errors
please guide me how to fix this


Deploy Errors
PROJECT PATH  ERRORS                                                                              

              duplicate value found: <unknown> duplicates value on record with id: <unknown>                 
              duplicate value found: <unknown> duplicates value on record with id: <unknown>                 
              duplicate value found: <unknown> duplicates value on record with id: <unknown>                 
              duplicate value found: <unknown> duplicates value on record with id: <unknown>                 
              duplicate value found: <unknown> duplicates value on record with id: <unknown>                 
              duplicate value found: <unknown> duplicates value on record with id: <unknown>                 
              duplicate value found: <unknown> duplicates value on record with id: <unknown>                 
              duplicate value found: <unknown> duplicates value on record with id: <unknown>                 
              duplicate value found: <unknown> duplicates value on record with id: <unknown>                 
              duplicate value found: <unknown> duplicates value on record with id: <unknown>                 
              duplicate value found: <unknown> duplicates value on record with id: <unknown>                 
              duplicate value found: <unknown> duplicates value on record with id: <unknown>                 
              duplicate value found: <unknown> duplicates value on record with id: <unknown>                 
              duplicate value found: <unknown> duplicates value on record with id: <unknown>                 
              duplicate value found: <unknown> duplicates value on record with id: <unknown>                 
              duplicate value found: <unknown> duplicates value on record with id: <unknown>                 
              duplicate value found: <unknown> duplicates value on record with id: <unknown>                 
              duplicate value found: <unknown> duplicates value on record with id: <unknown>                 
              duplicate value found: <unknown> duplicates value on record with id: <unknown>                 
              duplicate value found: <unknown> duplicates value on record with id: <unknown>                 
              Unable to build Lightning Component source for markup://c:servicestation: Invalid suffix: json.
              duplicate value found: <unknown> duplicates value on record with id: <unknown>                 
              duplicate value found: <unknown> duplicates value on record with id: <unknown>                 
              duplicate value found: <unknown> duplicates value on record with id: <unknown>                 
              duplicate value found: <unknown> duplicates value on record with id: <unknown>                 
              duplicate value found: <unknown> duplicates value on record with id: <unknown>                 
              duplicate value found: <unknown> duplicates value on record with id: <unknown>                 
              duplicate value found: <unknown> duplicates value on record with id: <unknown>                 
              duplicate value found: <unknown> duplicates value on record with id: <unknown>                 
              duplicate value found: <unknown> duplicates value on record with id: <unknown>                 
              duplicate value found: <unknown> duplicates value on record with id: <unknown>                 
              duplicate value found: <unknown> duplicates value on record with id: <unknown>                 
              duplicate value found: <unknown> duplicates value on record with id: <unknown>                 
              duplicate value found: <unknown> duplicates value on record with id: <unknown>                 
              duplicate value found: <unknown> duplicates value on record with id: <unknown>                 

 
renderedCallback(){
this.template.querySelector('lightning-button.Previous').disabled = true;
}

if i include this line in my code i am getting error as  Error during LWC component connect phase: [Cannot set property 'disabled' of null]

what to do how to rectify this

for full code refer this :https://medium.com/@rs60033/pagination-in-lwc-lightning-web-component-7a6dcb5a9385

and please help me how to rectify this 

syed e h mazhari
mazharibobby829@gmail.com
8328174785

 
java script:

import { LightningElement, track, wire } from 'lwc';
import getDealers from '@salesforce/apex/OppTableContoller.getDealers';
import { NavigationMixin } from 'lightning/navigation';
import {ShowToastEvent} from 'lightning/platformShowToastEvent';
import {refreshApex} from '@salesforce/apex';
import {deleteRecord} from 'lightning/uiRecordApi'

const actions = [
    { label: 'View', name: 'view' },
    { label: 'Edit', name: 'edit' },
    { label: 'Delete', name: 'delete' },
  ];
const columns = [
 //  { label:'Opportunity Name', fieldName: 'oppLink', type: 'url', typeAttributes: {label: {fieldName: 'Name'}, tooltip:'Go to detail page', target: '_blank'}},
   { label: 'Name', fieldName: 'Link',type:'url', typeAttributes: {label: {fieldName: 'Name'}, tooltip:'Go to detail page', target: '_blank'}}, 
   { label: 'Dealer_code__c', fieldName: 'Dealer_code__c' },
   { label: 'Dealer_Contact_Person__c', fieldName: 'Dealer_Contact_Person__c' },
   { label: 'Dealer_Mobile__c', fieldName: 'Dealer_Mobile__c' },
   { label: 'Dealer_E_Mail__c', fieldName: 'Dealer_E_Mail__c' },
   { label: 'Service_catgories__c', fieldName: 'Service_catgories__c' },
   { label: 'Transport_Assistance__c', fieldName: 'Transport_Assistance__c' },
   { label: 'Company_Contract_Start_Date__c', fieldName: 'Company_Contract_Start_Date__c' },
   { label: 'Company_Contract_End_Date__c', fieldName: 'Company_Contract_End_Date__c' },
   {
    type: 'action',
    typeAttributes: { rowActions: actions },
}, 
   
];
export default class OppTable extends NavigationMixin( LightningElement ) {
    @track error;
    @track columns = columns;
    @track opps; 
    @track showTable = false;  
    @track recordsToDisplay = []; 
    @track rowNumberOffset; 
    @wire(getDealers)
   
    wopps({error,data}){
        if(data){
            let recs = [];
            for(let i=0; i<data.length; i++){
                let opp = {};
                opp.rowNumber = ''+(i+1);
                opp.Link = '/'+data[i].Id;
                opp = Object.assign(opp, data[i]);
                recs.push(opp);
            }
            this.opps = recs;
            this.showTable = true;
        }else{
            this.error = error;
        }   
    }
    navigateToNewdealerPage() {
        this[NavigationMixin.Navigate]({
            type: 'standard__objectPage',
            attributes: {
                objectApiName: 'Dealer__c',
                actionName: 'new',
              
            },
        });
    }
    handleRowAction( event ) {
        const actionName = event.detail.action.name;
        const row = event.detail.row;
        switch ( actionName ) {
            case 'view':
                this[NavigationMixin.Navigate]({
                    type: 'standard__recordPage',
                    attributes: {
                        recordId: row.Id,
                        actionName: 'view'
                    }
                });
                break;
            case 'edit':
                this[NavigationMixin.Navigate]({
                    type: 'standard__recordPage',
                    attributes: {
                        recordId: row.Id,
                        objectApiName: 'Dealer__c',
                        actionName: 'edit'
                    }
                   
                });

                break;
             //   window.location.reload();
            case'delete':
            var txt;
            var r = confirm("Are you sure you want to delete?");
            if(r == true){
               this.recordId = event.target.value;
               deleteRecord(row.Id) 
               .then(() =>{
           
                  const toastEvent = new ShowToastEvent({
                      title:'Record Deleted',
                      message:'Record deleted successfully',
                      variant:'success',
                     
                     
                     
                  })
                  this.dispatchEvent(toastEvent);
                 //return refreshApex(this.data);
                 
                 
                 
                 
                   

                
                 window.location.reload();
           
                 
                  
                  
               })
            }
               
               else{
                   txt ="you have selected cancel "
              
               }
               break;
            default:
        }
    }
      
  
    handlePaginatorChange(event){
        this.recordsToDisplay = event.detail;
        this.rowNumberOffset = this.recordsToDisplay[0].rowNumber-1;
    }
}

---------------------------------------------------------------------------------------------------

html:

<template>
    <lightning-card title="Data Table with Pagination">
        <template if:true={showTable}>
            
          <lightning-button label="New dealer" onclick={navigateToNewdealerPage} class="slds-float_left"></lightning-button> 
            <c-paginator records={opps} 
                        total-records={opps.length} 
                        show-search-box="true" 
                        onpaginatorchange={handlePaginatorChange}>
            </c-paginator>
            <lightning-datatable key-field="Id" 
                                data={recordsToDisplay} 
                                columns={columns}
                                onrowaction={handleRowAction}
                                hide-checkbox-column
                                show-row-number-column
                                row-number-offset={rowNumberOffset}>
            </lightning-datatable>
        </template>
    </lightning-card>
</template>

----------------------------------------------------------------------------------------------------
apex
public with sharing class OppTableContoller {    
    @AuraEnabled(cacheable=true)
    public static List< Dealer__c> getDealers() {
        return [SELECT Id, Dealer_code__c, Name, Dealer_Contact_Person__c, Dealer_Mobile__c, Dealer_E_Mail__c, Service_catgories__c, Transport_Assistance__c, Company_Contract_Start_Date__c, Company_Contract_End_Date__c FROM Dealer__c ];
    }
}


here i am performing lwc row actions edit and delete and serach operation in lightning data table with pagination my reuirement is when i delete a record i need modal popup message stating are sure u want delete and after delete it should automatically refreshed 

so plz help me 

thanks in advance

syed e h mazhari
mazharibobby829@gmail.com
8328174785
html
<template>
    <lightning-card title="vehicle details">
        <div class="slds-m-around_medium">
            <lightning-button label="New vechile" onclick={navigateToNewvehiclePage}></lightning-button>
            <lightning-input type="search" onchange={handleKeyChange} class="slds-m-bottom_small" label="Search"
                value={searchKey}></lightning-input>
            <lightning-datatable key-field="Id" data={data} columns={columns} sorted-by={sortedBy}
                sorted-direction={sortedDirection} onsort={sortColumns} onrowaction={handleRowAction}>
            </lightning-datatable>
            </br>
            <lightning-layout horizontal-align="space">
                <lightning-layout-item flexibility="auto">
                    <lightning-button label="Previous" icon-name="utility:chevronleft" onclick={previousHandler}>
                    </lightning-button>
                </lightning-layout-item>
                <lightning-layout-item flexibility="auto">
                    Page {page} of {totalPage} total no of records-{totalRecountCount}
                </lightning-layout-item>
                <lightning-layout-item flexibility="auto">
                    <lightning-button label="Next" icon-name="utility:chevronright" icon-position="right"
                        onclick={nextHandler}></lightning-button>
                </lightning-layout-item>
            </lightning-layout>
        </div>
    </lightning-card>
</template>
--------------------------------------------------------------------------------------------
js
import { api, LightningElement, track, wire } from 'lwc';
import  fetchvechile from '@salesforce/apex/viewapex.fetchvechile';
import { NavigationMixin } from 'lightning/navigation';
import {ShowToastEvent} from 'lightning/platformShowToastEvent';
import {deleteRecord} from 'lightning/uiRecordApi';
import {refreshApex} from '@salesforce/apex';
const actions = [
  { label: 'View', name: 'view' },
  { label: 'Edit', name: 'edit' },
  { label: 'Delete', name: 'delete' },
];
const columns =  [{ label: 'Name', fieldName: 'Name' }, 
{ label: 'RegNumber', fieldName: 'RegNumber__c' },
{ label: 'Model', fieldName: 'Model__c' },
{ label: 'Purchase Amount', fieldName: 'Purchase_Amount__c' },
{ label: 'Purchase Date', fieldName: 'Purchase_Date__c' },
{ label: 'Last Service', fieldName: ',Last_Service__c' },
{ label: 'NextserviceDate', fieldName: 'Next_service_Date__c' },
{
    type: 'action',
    typeAttributes: { rowActions: actions },
}, 
];
export default class DeleteContactLwc extends NavigationMixin( LightningElement ){
  @track value;
  @track error;
  @track data;
  @api sortedDirection = 'asc';
  @api sortedBy = 'Name';
  @api searchKey = '';
  result;
  
  @track page = 1; 
  @track items = []; 
  @track data = []; 
  @track columns; 
  @track startingRecord = 1;
  @track endingRecord = 0; 
  @track pageSize = 5; 
  @track totalRecountCount = 0;
  @track totalPage = 0;
  
  @wire(fetchvechile, {searchKey: '$searchKey', sortBy: '$sortedBy', sortDirection: '$sortedDirection'})
  wiredAccounts({ error, data }) {
      if (data) {
      
          this.items = data;
          this.totalRecountCount = data.length; 
          this.totalPage = Math.ceil(this.totalRecountCount / this.pageSize); 
          
          this.data = this.items.slice(0,this.pageSize); 
          this.endingRecord = this.pageSize;
          this.columns = columns;
          this.error = undefined;
        } 
        else if (error) {
          this.error = error;
          this.data = undefined;
      }
  }
  navigateToNewvehiclePage() {
    this[NavigationMixin.Navigate]({
        type: 'standard__objectPage',
        attributes: {
            objectApiName: 'vehicle__c',
            actionName: 'new',
          
        },
          
    });
   
}
  //clicking on previous button this method will be called
  previousHandler() {
      if (this.page > 1) {
          this.page = this.page - 1; //decrease page by 1
          this.displayRecordPerPage(this.page);
      }
  }
  nextHandler() {
    if((this.page<this.totalPage) && this.page !== this.totalPage){
        this.page = this.page + 1; //increase page by 1
        this.displayRecordPerPage(this.page);            
    }             
}
//this method displays records page by page
displayRecordPerPage(page){
    this.startingRecord = ((page -1) * this.pageSize) ;
    this.endingRecord = (this.pageSize * page);
    this.endingRecord = (this.endingRecord > this.totalRecountCount) 
                        ? this.totalRecountCount : this.endingRecord; 
    this.data = this.items.slice(this.startingRecord, this.endingRecord);
    this.startingRecord = this.startingRecord + 1;
}    
sortColumns( event ) {
  this.sortedBy = event.detail.fieldName;
  this.sortedDirection = event.detail.sortDirection;
  return refreshApex(this.result);
  
}
handleRowAction( event ) {
  const actionName = event.detail.action.name;
  const row = event.detail.row;
  switch ( actionName ) {
      case 'view':
          this[NavigationMixin.Navigate]({
              type: 'standard__recordPage',
              attributes: {
                  recordId: row.Id,
                  actionName: 'view'
              }
          });
          break;
      case 'edit':
          this[NavigationMixin.Navigate]({
              type: 'standard__recordPage',
              attributes: {
                  recordId: row.Id,
                  objectApiName: 'vehicle__c',
                  actionName: 'edit'
              }
             });
       
          break;
      case'delete':
         this.recordId = event.target.value;
         deleteRecord(row.Id) 
         .then(() =>{
     
            const toastEvent = new ShowToastEvent({
                title:'Record Deleted',
                message:'Record deleted successfully',
                variant:'success',
            })
            this.dispatchEvent(toastEvent);
            refreshApex(this.result);
           
            
            
         })
         .catch(error =>{
             window.console.log('Unable to delete record due to ' + error.body.message);
         });
         break;
      default:
  }
}
handleKeyChange( event ) {
  this.searchKey = event.target.value;
  return refreshApex(this.result);
}

}
this my javascript and html code to perform lighting data Table rowaction edit delete view with pagenation but problem is when i delete record it,s automatically delete  the record without pop up msg.i need pop up message and when i perform edit operation table is not automatically  updated .when i give refersh it will updated .soi need refersh it automatically.help me
thanks in advance 
Email-arunkuppusamy001@gmail.com
mobile-9566594515 & 8328174785
I need to create a lead through email i have crated apex class  i want to know what is the next process after writing apex code to generate lead from email

This is my apex class

global class CreateLeadExample implements Messaging.InboundEmailHandler {
    global Messaging.InboundEmailResult handleInboundEmail(Messaging.inboundEmail email, 
                                                         Messaging.InboundEnvelope env){
      // Create an InboundEmailResult object for returning the result of the  
      // Apex Email Service 
      Messaging.InboundEmailResult result = new Messaging.InboundEmailResult();
      String myPlainText= '';
  
      // Add the email plain text into the local variable  
      myPlainText = email.plainTextBody;
  
      // Check for existing leads with this email address   
      Lead[] leads = [SELECt Id, Name, Email
        FROM Lead
        WHERE Email = :email.fromAddress];
  
      if (leads.size() == 0) {
        // New Lead object to be created - set LastName and Company to
        // dummy values for simplicity
        Lead newLead = new Lead(Email = email.fromAddress, 
          LastName = 'From Email', 
          Company = 'From Email');
  
        // Insert a new lead
        insert newLead;    
  
        System.debug('New Lead record: ' + newLead );   
      } else {
        System.debug('Incoming email duplicates existing Lead record(s): ' + leads );    
      }
  
      // Set the result to true. No need to send an email back to the user      
      // with an error message   
      result.success = true;
  
      // Return the result for the Apex Email Service 
      return result;
    }
  }

Kindly help me in this thank you in advance 

Regards
Syed E H Mazhari
8328174785
mazharibobby829@gmail.com
 
I have created an event with the subject "Contract Proposal". It has been saved in the event object but it is not displayed in OpenActivitiesUser-added imageUser-added image


Kindly help me with this. ThankYou in advance.

Regards,
Fewin Samuel,
9486704965,
fewinsamuel@gmail.com.