• Abilash.S
  • NEWBIE
  • 40 Points
  • Member since 2021

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 32
    Questions
  • 9
    Replies
Hi Everyone
I have wrote code to create opportunity, if existing opp has 90% probability. So I have used parent-child query to queru opportunities related accounts.
I have used FOR - IN - FOR loops. The records are creating in huge number. Please provide proper code with single for loop and use handler class. I came to know that should not use tripple for loops. Then how to achieve without multiple loops.


public static void createOpp(List<Account> accList) {
        
       List<Opportunity> oppList = new List<Opportunity>();
        Map<Id, Account> acctMap = new Map<Id, Account>([Select Id, (Select Id, probability from Opportunities) from Account WHERE ID IN :accList]);
 List<Account> acList = [Select Id, (Select Id, probability from Opportunities) from Account WHERE ID IN :accList];       
        for(Account a : accList) {
        
            for(Account ao: acList) {
            
                    for(Opportunity opp : ao.opportunities) {

                        if( opp.probability == 90){
                            Opportunity opptny = new Opportunity();
                            opptny.AccountId = a.Id;
                            opptny.Name      = a.Name + 'Opportunity with 90% prob new';
                            opptny.StageName = 'Prospecting';
                            opptny.probability = 90;
                            opptny.CloseDate = System.today().addMonths(3);
                            oppList.add(opptny);
                        }
                   }
               }
            }
        
        try{
        if(oppList.size() > 0){
            insert oppList;
            }
        } catch (DmlException e) {
            system.debug('Exception caused-->'+e.getMessage());
       } 
   }
Hi Everyone
I have wrote code to create opportunity, if existing opp has 90% probability. So I have used parent-child query to queru opportunities related accounts.
I have used FOR - IN - FOR loops. The records are creating in huge number. Please provide proper code with single for loop and use handler class. I came to know that should not use tripple for loops. Then how to achieve without multiple loops.


public static void createOpp(List<Account> accList) {
        
       List<Opportunity> oppList = new List<Opportunity>();
        Map<Id, Account> acctMap = new Map<Id, Account>([Select Id, (Select Id, probability from Opportunities) from Account WHERE ID IN :accList]);
        
        for(Account a : accList) {
        
            for(Account ao: acList) {
            
                    for(Opportunity opp : ao.opportunities) {

                        if( opp.probability == 90){
                            Opportunity opptny = new Opportunity();
                            opptny.AccountId = a.Id;
                            opptny.Name      = a.Name + 'Opportunity with 90% prob new';
                            opptny.StageName = 'Prospecting';
                            opptny.probability = 90;
                            opptny.CloseDate = System.today().addMonths(3);
                            oppList.add(opptny);
                        }
                   }
               }
            }
        
        try{
        if(oppList.size() > 0){
            insert oppList;
            }
        } catch (DmlException e) {
            system.debug('Exception caused-->'+e.getMessage());
       } 
   }
Hi Everyone.
I have used lwc lightning combobox to fetch picklist values. Here user enters combo box field values in second page. When user navigated to third page and again visited second page the field value displays as None (which is a placeholder in html). Again user enters value. This makes dual work to user and not user friendly.
How to store picklist value in combo box field when user navigated from 3 page to 2 page or 2 page to 1 page and 1 page to 2 page. The value should not chnage which is given bu user.

How to over come this.

-----------html---------
<lightning-combobox data-id={skill.Skill__c} data-name="Rating__c" label="Self Evaluation"
                                        value={selectedValue} placeholder="--None--" options={skillOptions}
                                        onchange={handleSkillsChange} >
                                        </lightning-combobox>
----------js--------------
 @wire(getObjectInfo, { objectApiName: SKILL_MATRIX_OBJECT })
    skillMatrixObjectInfo;
    @wire(getPicklistValuesByRecordType, { objectApiName: SKILL_MATRIX_OBJECT, recordTypeId: '$skillMatrixObjectInfo.data.defaultRecordTypeId'})
    skillMatrixPicklistValues({data,error})
    {
        if(data) {
            this.skillOptions = [{selected: true },...data.picklistFieldValues.Rating__c.values]
        }
        console.log('this.skillOptions ',this.skillOptions);
    }

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

Note: The component is a communication between parent to child.
Am I doing any mistake while passing any attributes in child.
---child----
<template>
    <c-employee-skillset record-id={recordId}>
    </c-employee-skillset>
</template>
-------js-------
import skills from './employeeSkills.html';

@api
    save(){
        switch(this.templateName){
          
            case "skills" :
                this.template.querySelector("c-employee-skillset").saveSkills();
                break;
          
        }
    }
 
Hi Everyone,

I have created apex class to pull multiple object records into single list. Where objects does not have any relationship (lets say account, contact, lead. Consider account and contact dont have any relationship). I used for loop seperately for each object and saved into wrapperlist. For threee objects I have three wrapper list. Now big challenge is I need to add three wrappers(wrapAccount, wrapContact, wrapLead)  into single list. So in that list I need all three objects records.

-------------------------------------------------------------------------
@Auraenabled(cacheable=true)  
    public static List<sObject> wrapData() {
        List<WrapperContact> wrapContact = new List<WrapperContact>();
        List<WrapperAccount> wrapAccount = new List<WrapperAccount>();
        List<WrapperLead> wrapLead = new List<WrapperLead>();
        
       
        
        for(Contact ct : [select id, name from Contact LIMIT 10]){          
            wrapContact.add(new WrapperContact(ct));            
        }
        for(Account acct : [select id, name from Account LIMIT 10]){          
            wrapAccount.add(new WrapperAccount(acct));            
        }
        for(Lead ld : [select id, name from Lead LIMIT 10]){          
            wrapLead.add(new WrapperLead(ld));            
        }
        system.debug('wrapContact'+wrapContact);
        system.debug('wrapAccount'+wrapAccount);
        system.debug('wrapLead'+wrapLead);
     List<SObject> s = new List<SObject>{
            new Contact(),
            new Account(),
            new Lead()            
        };
   //     s.add(wrapContact);
   //     s.addAll(wrapAccount);
   //         system.debug(s);
        List<sObject> objects = new List<sObject>();
    //    objects.addAll((List<sObject>)(wrapContact));
      //    objects.addAll((List<sObject>)(wrapAccount));
   //     objects.addAll(wrapLead);
          return objects;
     
    }



     public class WrapperAccount{
                
        @Auraenabled
        public Account ac{get;set;}
         
        public WrapperAccount(Account acct){
            ac=acct;
        }
        
    }

     public class WrapperContact{
        @Auraenabled
        public Contact cont{get;set;}
              
        public WrapperContact(Contact ct){
            cont=ct;
        }
                      
    }

     public class WrapperLead{
               
        @Auraenabled
        public Lead ldd{get;set;}
            
        public WrapperLead(Lead ld){
            ldd=ld;
        }
    }    

----------------------------------------------------------------------
I have used List<SObject> s = new List<SObject>{
            new Contact(),
            new Account(),
            new Lead()            
        };
   //     s.add(wrapContact);
   //     s.addAll(wrapAccount);
         s.addAll(wrapLead);
   //         system.debug(s);
But its not working. Please help me out of this.
Thanks in Advance
Hi,
I have written three seperate wrapper classes for three different Sobjects. I need to add three wrappers into single list. Please help me how to do
---------------------------------------------
@Auraenabled(cacheable=true)  
    public static List<sObject> wrapData() {
        List<WrapperContact> wrapContact = new List<WrapperContact>();
        List<WrapperAccount> wrapAccount = new List<WrapperAccount>();
        List<WrapperLead> wrapLead = new List<WrapperLead>();
        
       
        
        for(Contact ct : [select id, name from Contact LIMIT 10]){          
            wrapContact.add(new WrapperContact(ct));            
        }
        for(Account acct : [select id, name from Account LIMIT 10]){          
            wrapAccount.add(new WrapperAccount(acct));            
        }
        for(Lead ld : [select id, name from Lead LIMIT 10]){          
            wrapLead.add(new WrapperLead(ld));            
        }
        system.debug('wrapContact'+wrapContact);
        system.debug('wrapAccount'+wrapAccount);
        system.debug('wrapLead'+wrapLead);
    //    s.add(wrapContact);
    //    s.add(wrapAccount);
    //    s.add(wrapLead);
     List<SObject> s = new List<SObject>{
            new Contact(),
            new Account(),
            new Lead()            
        };
   //         system.debug(s);
        List<sObject> objects = new List<sObject>();
        objects.addAll((List<sObject>)(wrapContact));
          objects.addAll((List<sObject>)(wrapAccount));
        objects.addAll(wrapLead);
          return objects;
     
    }



     public class WrapperAccount{
                
        @Auraenabled
        public Account ac{get;set;}
         
        public WrapperAccount(Account acct){
            ac=acct;
        }
        
    }

     public class WrapperContact{
        @Auraenabled
        public Contact cont{get;set;}
              
        public WrapperContact(Contact ct){
            cont=ct;
        }
                      
    }

     public class WrapperLead{
               
        @Auraenabled
        public Lead ldd{get;set;}
            
        public WrapperLead(Lead ld){
            ldd=ld;
        }
    }    
-------------------------------------------
I am approaching in this way, but addAll method is not working
 List<sObject> objects = new List<sObject>();
        objects.addAll((List<sObject>)(wrapContact));
          objects.addAll((List<sObject>)(wrapAccount));
objects.addAll((List<sObject>)(wrapLead));
------------------------------------------------------
User-added imageI need to add below three lists into single list.
User-added image
Hi,
I have written three seperate wrapper classes for three different Sobjects. I need to add three wrappers into single list. Please help me how to do
---------------------------------------------
@Auraenabled(cacheable=true)  
    public static List<sObject> wrapData() {
        List<WrapperContact> wrapContact = new List<WrapperContact>();
        List<WrapperAccount> wrapAccount = new List<WrapperAccount>();
        List<WrapperLead> wrapLead = new List<WrapperLead>();
        
       
        
        for(Contact ct : [select id, name from Contact LIMIT 10]){          
            wrapContact.add(new WrapperContact(ct));            
        }
        for(Account acct : [select id, name from Account LIMIT 10]){          
            wrapAccount.add(new WrapperAccount(acct));            
        }
        for(Lead ld : [select id, name from Lead LIMIT 10]){          
            wrapLead.add(new WrapperLead(ld));            
        }
        system.debug('wrapContact'+wrapContact);
        system.debug('wrapAccount'+wrapAccount);
        system.debug('wrapLead'+wrapLead);
    //    s.add(wrapContact);
    //    s.add(wrapAccount);
    //    s.add(wrapLead);
     List<SObject> s = new List<SObject>{
            new Contact(),
            new Account(),
            new Lead()            
        };
   //         system.debug(s);
        List<sObject> objects = new List<sObject>();
        objects.addAll((List<sObject>)(wrapContact));
          objects.addAll((List<sObject>)(wrapAccount));
        objects.addAll(wrapLead);
          return objects;
     
    }



     public class WrapperAccount{
                
        @Auraenabled
        public Account ac{get;set;}
         
        public WrapperAccount(Account acct){
            ac=acct;
        }
        
    }

     public class WrapperContact{
        @Auraenabled
        public Contact cont{get;set;}
              
        public WrapperContact(Contact ct){
            cont=ct;
        }
                      
    }

     public class WrapperLead{
               
        @Auraenabled
        public Lead ldd{get;set;}
            
        public WrapperLead(Lead ld){
            ldd=ld;
        }
    }    
------------------------------------------------------------
Hi, I am new to integration,
There are two systems SF and SAP. If SAP is sending data to SF. What are the questions you ask to SAP. What you do in SF. What are prerequisites.

Please let me know.
Thanks
Trigger on whenever account is updated the date field is changed then log a call with that date.

I am strucked on 
1. How to check date field is changed or  not. I need to trigger when existing date changed.
2. Unable to create activity (log a call) on record page. In debug logs getting data to insert. But on record page Call is not logging from apex.
Please help me in code.

// log a call when date field changed in account
    public static void logCall(List<Account> newMapps) {
        List<Task> tkList = new List<Task>();
            Set<Id> regIds = new Set<Id>();
        for(Account ac: newMapps){
            regIds.add(ac.Id);
        }
        
     Map<Id, Account> mapAcc = new Map<Id, Account>([select id, name, support_plan_start_date__c FROM Account WHERE ID IN :regIds]);
            system.debug('mapAcc'+mapAcc);
        for(Account a : newMapps){
            system.debug('77'+a.support_plan_start_date__c);
            system.debug('78'+mapAcc.get(a.Id).support_plan_start_date__c);
            if(a.support_plan_start_date__c == mapAcc.get(a.Id).support_plan_start_date__c || a.support_plan_start_date__c >mapAcc.get(a.Id).support_plan_start_date__c || a.support_plan_start_date__c <mapAcc.get(a.Id).support_plan_start_date__c){
                  Task newtask = new Task();
            newtask.Description = 'Log a call when datefield changes';
            newtask.Priority    = 'Normal';
            newtask.Status      = 'Completed';
            newtask.CallDisposition = 'CallBack';
            newtask.Subject     = 'Call';
            newtask.CallType    = 'OutBound';
            newtask.IsReminderSet = true;
            newtask.ReminderDateTime = System.now()+1;
     //     newtask.WhoId      = Trigger.new[0].Id;
            tkList.add(newtask);  
                }
        }
        system.debug('tkList'+tkList);
        try{
        if(tkList.size() > 0){
            insert tkList;
            }
        } catch (DmlException e) {
            system.debug('Exception caused'+e.getMessage());
        }
    }

Thanks in advance
Hi Everyone,
Need help on Trigger. 

Trigger on whenever account is updated the date field is changed then log a call with that date. The trigger should trigger when date field is changed. If date changed then log a call on account.
Hi Everyone,
How to display JSON data by serializing in apex and display in descending order. Please have a look below json data.

let jsonData = [
{‘HouseName’:‘anna’,
‘Kilometers’:75
},
{‘HouseName’:‘nancy’,
‘Kilometers’: 55
},
{‘HouseName’:‘sana’,
‘Kilometers’:95
},
]

By getting this data from FE, parse it in apex, and provide list of housenames based on kilometers in descending order.

O/P-should be- [Sana,Anna,Nancy]
Please help me in Apex code.
Hi Everyone,
How to display JSON data by serializing in apex and display in descending order. Please have a look below json data.

let jsonData = [
{‘HouseName’:‘anna’,
‘Kilometers’:75
},
{‘HouseName’:‘nancy’,
‘Kilometers’: 55
},
{‘HouseName’:‘sana’,
‘Kilometers’:95
},
]

By getting this data from FE, parse it in apex, and provide list of housenames based on kilometers in descending order.

O/P-should be- [Sana,Anna,Nancy]
Please help me in Apex code.

 
I am using lighning upload file tag to upload files for customer from community portal.
 <lightning-file-upload class="fileUploader"
                                accept={acceptedFile}
                                onuploadfinished={handleUploade}
                            ></lightning-file-upload>
Till yesterday it was worked , today onwards not working saying bad request in console logs. 
It worked multiple times, not sure today its not working. Didnt done any code changes.

Help me out of this.

User-added imageJS-
handleUploade(event){
        this.updatingloader = true;
        const uploadedFile = event.detail.files;
        uploadedFile.forEach(element => {
            this.uploadedFileName = element.name;
        });
        if(this.selectedRT == 'MM'){
        }
        else if(this.selectedRT == 'ULT'){
            readUploadedFile({DocumentId:uploadedFile[0].documentId})
            .then(result => {
                //console.log('result raw data from csv file ===>',result);
                let res = JSON.parse(result);
                console.log(res);
                this.rawInsertedCLi = result;

                let dataToShow = [];
                res.forEach(rowElement => {
                    let rowObj ={};
                    if(this.selectedRT == 'ULT'){
                        rowObj.SerialNo =  rowElement.SerialNo;
                        rowObj.ReturnQuantity =  rowElement.ReturnQuantity;
                        rowObj.VISID =  rowElement.VISID;
                        rowObj.PO_Number =  rowElement.PO_Number;
                        rowObj.CR_DBT =  rowElement.CR_DBT;
                        rowObj.Org_PO =  rowElement.Org_PO;
                        rowObj.Product_condition =  rowElement.Product_condition;
                        rowObj.product_verify = rowElement.product_verify;
                        rowObj.CLIRInsertedID = rowElement.RecordId;
                    }
                
                        dataToShow.push(rowObj);
                });
                this.PoData = dataToShow;
                console.log('raw csv data to object maping :'+this.PoData);
                if(this.PoData != '' && this.PoData != undefined){
                    //this.dataToValidate(this.PoData);
               
                    //this.callExternalSource(this.PoData); //uncomment for previous func
                    this.showInsertedRows = true;
                    this.updatingloader = false;
                    this.recordstosend = this.PoData;
                    this.hideToValidateStep = false;
                }
Hi Everyone,
I am doing continuation call for long running calls and bulk loads processing. In continuation call, there will be three parallel calls at a time. I need to catch exceptions happened in three calls if response is failure.
For example, One call has exception, second call has success, third call has exception. So first call and third call has exception. I need to consolidate two exceptions at a place and handle those exceptions and store in object with DML operation. 
What I knew that once exception raised I can do DML after that the call shouold continue it should not effect remaining calls. How Cani approach.
 Continuation con = new Continuation(100); // 1 call---exp , 2 call sucess, 3 -exp. dml
        con.ContinuationMethod = 'processResponse';
        string endpointurl = EndPoint;
        endpointurl= endpointurl+portalids;
        //Object strResponse;
        Http httpHandler = new Http();
        HttpRequest req = new HttpRequest();
        
            req.setMethod('GET');
            req.setEndpoint(endpointurl);
            req.setTimeout(120000);
            req.setHeader('content-type', 'application/json');
            req.setHeader('Accept', 'application/json');
            req.setHeader('Authorization','OAuth '+accessToken);
            req.setHeader('Authorization','Bearer '+accessToken);
            con.addHttpRequest(req);
            HttpResponse response = httpHandler.send(req);
if(response?.getStatusCode() == 200)  //If Reponse successful..
            {  hanlde success call
} else { //if reponse fails
store exceptions
}

Can I use if else condition for to check response success or failure. I am using continuation call. In this call 3 calls will happen at a time. If I get two failures in two calls can I catch in else loop??
Am I going to right approach Please help.

 
Hello Everyone,
Session Id invalid when tried to insert listviews using SOAP
I need to create list view through custom LWC comp. For this I am using below code in apex class. ---------
HTTP h = new HTTP(); 
HTTPRequest req = new HTTPRequest(); 
req.setMethod('POST'); req.setHeader('Content-Type', 'text/xml'); 
req.setHeader('SOAPAction', 'create'); 
String b = '<?xml version="1.0" encoding="UTF-8"?>'; 
b += '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">'; 
b += '<soapenv:Header>'; 
b += '<ns1:SessionHeader soapenv:mustUnderstand="0" xmlns:ns1="http://soap.sforce.com/2006/04/metadata">'; 
b += '<ns1:sessionId>' + UserInfo.getSessionId() + '</ns1:sessionId>'; 
b += '</ns1:SessionHeader>'; b += '</soapenv:Header>'; 
b += '<soapenv:Body>'; 
b += '<create xmlns="http://soap.sforce.com/2006/04/metadata">'; 
b += '<metadata xsi:type="ns2:ListView" xmlns:ns2="http://soap.sforce.com/2006/04/metadata">'; 
//This is the API name of the list view 
b += '<fullName>Case.Test345_ListView</fullName>'; 
b += '<booleanFilter>1</booleanFilter>'; 
//Columns you want to display 
b += '<columns>NAME</columns>'; 
b += '<columns>CREATED_DATE</columns>'; 
//Filterscope should be set to Everything for every one to be able to access this List view 
b += '<filterScope>Everything</filterScope>'; 
// Enter the filter that you want to set 
b += '<filters>'; 
b += '<field>NAME</field>'; 
b += '<operation>equals</operation>'; 
b += '<value>Test123 </value>'; 
b += '</filters>'; 
b += '<label>Test345 View</label>'; 
b += '</metadata>'; 
b += '</create>'; 
b += '</soapenv:Body>'; 
b += '</soapenv:Envelope>'; 
req.setBody(b); 
req.setCompressed(false); 
// Set this to org's endpoint and add it to the remote site settings. req.setEndpoint('https://ap1.salesforce.com/services/Soap/m/25.0'); 
HTTPResponse resp = h.send(req); 
System.debug(resp.getBody());
--------------------------------------
I tried to get response through anonymous window, getting an error like. USER_DEBUG This error usually occurs after a session expires or a user logs out. Decoder: DataInDbSessionKeyDecoder</faultstring></soapenv:Fault></soapenv:Body></soapenv:Envelope>....
1. I did logout and login. 
2.Changed session settings.
Eventhough its not working. I tried system.debug(userinfo.getsessionId()); in anonymous, the result is SESSION_ID_REMOVED.
How to figure it out. Does this not work in sandbox. NOTE: The code perfectly working in our personal DEV ORG. I can successfully insert list views when executed in anonymous window. But cannot in this sandbox. Please help.

Thanks
Hi everyone.
How can I change recordtype using flows based on condition.
1. Initially I get Records in sobject.
2. Updated records and setting field values in variable.
Am I missing any thing.
User-added imagepic1.
User-added imagepic2.
update recordupdate record contd
Hi all,
How to prevent webpages being loaded in iframe.? 
Hi all,
What is PREPARE APPLICATION FOR RELEASE and disable debugs??
Could anyone suggest me better links?
Thanks in advance
Hi Folks, In salesforce the authorization should not depend on client side - authorization. Any alternatives??
I have account and contact which have lookup relationship. In contact there are three fields like f1, f2, f3. Each field has some users count. I need to get all count of users in account object. How to do this.
I have two systems Salesforce system and Third party system. It’s a migration process. Component wants a two way synchronization. Any user creates/ edit opportunity in Salesforce system then the same opportunity should create in third party system also. And viceversa. Two way approach require here. How could i accomplish this.
Hi Everyone
I have wrote code to create opportunity, if existing opp has 90% probability. So I have used parent-child query to queru opportunities related accounts.
I have used FOR - IN - FOR loops. The records are creating in huge number. Please provide proper code with single for loop and use handler class. I came to know that should not use tripple for loops. Then how to achieve without multiple loops.


public static void createOpp(List<Account> accList) {
        
       List<Opportunity> oppList = new List<Opportunity>();
        Map<Id, Account> acctMap = new Map<Id, Account>([Select Id, (Select Id, probability from Opportunities) from Account WHERE ID IN :accList]);
        
        for(Account a : accList) {
        
            for(Account ao: acList) {
            
                    for(Opportunity opp : ao.opportunities) {

                        if( opp.probability == 90){
                            Opportunity opptny = new Opportunity();
                            opptny.AccountId = a.Id;
                            opptny.Name      = a.Name + 'Opportunity with 90% prob new';
                            opptny.StageName = 'Prospecting';
                            opptny.probability = 90;
                            opptny.CloseDate = System.today().addMonths(3);
                            oppList.add(opptny);
                        }
                   }
               }
            }
        
        try{
        if(oppList.size() > 0){
            insert oppList;
            }
        } catch (DmlException e) {
            system.debug('Exception caused-->'+e.getMessage());
       } 
   }
Hi Everyone,

I have created apex class to pull multiple object records into single list. Where objects does not have any relationship (lets say account, contact, lead. Consider account and contact dont have any relationship). I used for loop seperately for each object and saved into wrapperlist. For threee objects I have three wrapper list. Now big challenge is I need to add three wrappers(wrapAccount, wrapContact, wrapLead)  into single list. So in that list I need all three objects records.

-------------------------------------------------------------------------
@Auraenabled(cacheable=true)  
    public static List<sObject> wrapData() {
        List<WrapperContact> wrapContact = new List<WrapperContact>();
        List<WrapperAccount> wrapAccount = new List<WrapperAccount>();
        List<WrapperLead> wrapLead = new List<WrapperLead>();
        
       
        
        for(Contact ct : [select id, name from Contact LIMIT 10]){          
            wrapContact.add(new WrapperContact(ct));            
        }
        for(Account acct : [select id, name from Account LIMIT 10]){          
            wrapAccount.add(new WrapperAccount(acct));            
        }
        for(Lead ld : [select id, name from Lead LIMIT 10]){          
            wrapLead.add(new WrapperLead(ld));            
        }
        system.debug('wrapContact'+wrapContact);
        system.debug('wrapAccount'+wrapAccount);
        system.debug('wrapLead'+wrapLead);
     List<SObject> s = new List<SObject>{
            new Contact(),
            new Account(),
            new Lead()            
        };
   //     s.add(wrapContact);
   //     s.addAll(wrapAccount);
   //         system.debug(s);
        List<sObject> objects = new List<sObject>();
    //    objects.addAll((List<sObject>)(wrapContact));
      //    objects.addAll((List<sObject>)(wrapAccount));
   //     objects.addAll(wrapLead);
          return objects;
     
    }



     public class WrapperAccount{
                
        @Auraenabled
        public Account ac{get;set;}
         
        public WrapperAccount(Account acct){
            ac=acct;
        }
        
    }

     public class WrapperContact{
        @Auraenabled
        public Contact cont{get;set;}
              
        public WrapperContact(Contact ct){
            cont=ct;
        }
                      
    }

     public class WrapperLead{
               
        @Auraenabled
        public Lead ldd{get;set;}
            
        public WrapperLead(Lead ld){
            ldd=ld;
        }
    }    

----------------------------------------------------------------------
I have used List<SObject> s = new List<SObject>{
            new Contact(),
            new Account(),
            new Lead()            
        };
   //     s.add(wrapContact);
   //     s.addAll(wrapAccount);
         s.addAll(wrapLead);
   //         system.debug(s);
But its not working. Please help me out of this.
Thanks in Advance
Hi Everyone,
We used apex class to send email to customer once case gets closed. It works fine when we use workflows to send email. But we used apex class to send email to customer. The customer has COMMUNITY license with customer profile. I dont see email related permissions for community license profiles. Is is any permission issue why customer cannot receive email. I am sure about apex class. How could I achieve this. 
Thanks in advance. 
There is an account and contact which have the relationship. In contact there is a picklist which is mandatory. Say for eg picklist contains states of India. If user selects Maharashtra state, then that user should not allow to create a record in contact. How could I accomplish this. Please provide required coding part.
I have customer feedback object. When I select picklist values of  1,2,3,4,5. Automatically stars should represent. If I select 3 from picklist, 3 stars need to display. Based on picklist values stars should display. How could I accomplish this.
Write a trigger to prevent duplicate email id in contact.
Please dont share any related links on Duplicate preventions. Help me on writing code what exactly need to apply.
Hi,

I have a requriment to create list view from VF page.

Is there any way to create listview from apex