• Prince Venkat
  • NEWBIE
  • 175 Points
  • Member since 2021

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 30
    Questions
  • 17
    Replies

how to reference contact field from Account object in apex class??


Any Help
Thanks in advance

Hi
Whenever we click on edit on contact phone it should be displayed in this specified format (xxx) xxx-xxxx

but i am getting like this how can we achieve this User-added image
Hi,
I have total ten fields which are displayed on the page.The page is designed using lwc .

Now the width between two particular fields should be increased and also the ten fields should be displayed. How to achieve

The displayed are displayed by

<th class="slds-size_1-of-10" scope="col">
                          <div class="slds-truncate" style="text-align:center" title="Finish Role">Role</div>
                          <!-- <div class="slds-truncate" style="text-align:center" title="Finish Role">Role</div> -->
                      </th>

<th class="slds-size_1-of-10" scope="col">
                          <div class="slds-truncate" style="text-align:center" title="start Role"> Role</div>
                          <!-- <div class="slds-truncate" style="text-align:center" title="start Role">Role</div> -->
                      </th>


Any Assistance

Thanks in advance


 
Hi

when ever lead record type called convert is selected it should convert into opportunity record type called general .

How to achieve this

Any assistance

Thank you
HI 
Below is my code.
 
public class LeadEmail
{
public static void SendEmailTolead(list<lead> lstLead)
{
    if(! lstLead.isEmpty())
   {
        list<messaging.SingleEmailMessage> lstEmails = new list<messaging.SingleEmailMessage>();
    for(lead lr : lstLead)
    {
        messaging.SingleEmailMessage email = new messaging.SingleEmailMessage();
        string[] toEmailsIds = new string[]{lr.Email};
            email.settoAddresses(toEmailsIds);
        
        
        email.setSenderDisplayName('lead Record Creation Alert');
        
        email.setReplyTo('support@RFI.com');
        
        string emailsubject = 'congralutions'+lr.Name+'you have been registerd';
        
        email.setSubject(emailsubject);
        
        string emailHTMLContent = 'Dear'+lr.name+',<br/> <br/>'+
               '<br/><br/> here are your details... <br/><br/>'+
            
                '<br/> Your Company....'+lr.Company+
                '<br/> Your tile for the Role'+lr.Title+
                '<br/> your Status for The record'+lr.Status+
            'thanks & Regards';
        
        email.setHtmlBody(emailHTMLContent);
        
        lstEmails.add(email);
        
    }
   if(!lstEmails.isempty())
    {
        Messaging.sendEmail(lstEmails);    }
    
    } 
}
}

Execute window

list<lead> lstLead = [select id,name,email,company,title,status from lead];
LeadEmail.SendEmailTolead(lstLead);



Getting error 
Line: 38, Column: 1
System.EmailException: SendEmail failed. First exception on row 5; first error: SINGLE_EMAIL_LIMIT_EXCEEDED, Email limit exceeded: []

Any assistance

​​​​​​​Thanks in advance
Hi

Below is my code.Send mails to mailid field of contact object to three members at a time. Getting an error. System.EmailException: SendEmail failed. First exception on row 0; first error: REQUIRED_FIELD_MISSING, Add a recipient to send an email.: []

global class EmailToContactBatch implements Database.Batchable<sObject> 
{
    global database.querylocator start(Database.BatchableContext BC) 
    {
        return Database.getQueryLocator([select id,name,Email from Contact order by Email asc limit 3]);
    }
   
    global void execute(Database.BatchableContext BC, Sobject[] scope) 
    {
        List<Messaging.SingleEmailMessage> lstEmails = new List<Messaging.SingleEmailMessage>();
        for(Contact objContact :(List<contact>) scope) 
        {
            Messaging.SingleEmailMessage objEmail = new Messaging.SingleEmailMessage();
            //Prepare SendToEmail List          
            List<String> lstSendToEmails = new List<String>();
            if(objContact.Email != null) 
            {
                lstSendToEmails.add(objContact.Email);
            }
            objEmail.setToAddresses(lstSendToEmails);
            //Prepare CCEmailList
            List<String> lstCCToEmails = new List<String>();
            if(objContact.Email != null) 
            {
                lstCCToEmails.add(objContact.Email);
            }
            objEmail.setCcAddresses(lstCCToEmails);
            
            //Set Email Subject
            objEmail.setSubject('Testing Emails');
           
           //Set Email Body
            String body = 'Dear Contact,please ready to contact if you have any issues';
            objEmail.setHtmlBody(body);
            lstEmails.add(objEmail);
            
        Messaging.sendEmail(lstEmails);
        }
    }

    global void finish(Database.BatchableContext BC) 
    {
        
    }
}

Thanks In advance
 
Hi
They are two objects Activity Master
Student Activities
Through programming want to create rollupsummary ( not through configuration)
Activity Master has a field No of Students Enrolled (count of records need to dispalyed here)


trigger Rollupmaster on Student_Activities__c (after insert,after update,after delete)
{
set<id> lstSet = new set<id>();
    list<Activity_Master__c> lstAm = new list<Activity_Master__c>();
    
if((trigger.isinsert || trigger.isupdate)&& trigger.isafter)    
{
    for(Student_Activities__c c : trigger.new)
    {
        if(c.id!=null)
        {
          lstSet.add(c.id);  
        }
    }
if(trigger.isdelete)
{
  for(Student_Activities__c c : trigger.old)  
  {
      lstSet.add(c.id);
  }
    
}
for(Activity_Master__c a :[select id,No_of_Students_Enrolled__c,(select id from Student_Activities__r) from
                             Activity_Master__c where id =:lstSet])
{
  a.No_of_Students_Enrolled__c = a.Student_Activities__r.size();
    lstAm.add(a);
}


update lstAm;

}
}

Getting error in soql query Any suggestions.

 
Hi

Through batch apex updating records
What ever mail id field  present in lead object to those mail ids email should be sent through bacth apex how is it achieved

Thanks in advance

Regards
Prince
Hi

when ever a record inserted by batch apex mail should be send to the respective owner how to achieve this

Thanks in advance
Hi
I have a picklist field called Type whenever i select a field from type it should automatically display on the another field called Name 
How to achieve this
Thanks in advance
 
Hi
document obj contains a csv file
it should be read by batch apex and records shoud be inserted into an object