• Padmashree M
  • NEWBIE
  • 10 Points
  • Member since 2022

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 1
    Replies
when i used below code in execute anaonymous window, facing error like List<Account> Acc=[SELECT Id,name From Account];

facing error like : 
Illegal assignment from List<Account> to List<Account>

Please someone help on this
I need to pass sobject as parameter using trigger to queuebale and have written below code, but facing error as 
Variable does not exist: Name
Variable does not exist: id
Constructor not defined: [ContactCreationQueueable].<Constructor>(List<Account>)

Queueable class:
public class ContactCreationQueueable implements Queueable{
    
    private List<Account> acctListToCreateContacts;
    
    public ContactCreationQueueable(List<Account> expectingListOfAccountsFromTrigger){
        this.acctListToCreateContacts=expectingListOfAccountsFromTrigger;
    }
    public void execute(QueueableContext Qc){
        List<Contact> conListToInsert = new List<Contact>();
       
        for(Account acct : acctListToCreateContacts){
            Contact con = new Contact();
            con.LastName = acct.Name;
            con.AccountId = acct.id;
            conListToInsert.add(con);
        }
        insert conListToInsert;
      
    }

}

Trigger code :
Trigger AccountTrigerForContacts on Account (after insert) {
    if(Trigger.isAfter && Trigger.isInsert){
        System.enqueueJob(new ContactCreationQueueable(Trigger.new));
    }

}

Please help in resolving this error.
Can someone please help me with the steps for creating bulk custom profiles.
First Name and last name fields are visible on edit page on user object, but the same is not visible under the fields and realtionship section of the user object, Can u some one help with the reason