• prashanth g 10
  • NEWBIE
  • 10 Points
  • Member since 2019

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

lets say our company is working from 09 to 17'o clock 

when ever lead is created in our database there is email field in lead object, for that email we need to send alert mail after 3 bussiness hours gap of saving the record   

example: if lead is creating at 10'o ckock alert shoud to go at 13'0clock and if lead is creating at 16'o clock alreat shout be go nextday 11'0clock , if the next day is holiday then coming working day mail has to go. finally we need to send email at working hours only 

if anyone answered with sample code it will be very greatfull to me,thanks in advance 

hi,
i am new to salesfoce here i got scenario like populate total revenue  in amount filed in account record which is having number opportunity childs

i am providing sample format also 

thanks in advance
trigger contactTrigger on opportunity ( after insert, after update, after delete, after Undelete) {
    Set<ID> accIdSet = new Set<ID>();
    
    // After Insert 
    if(Trigger.isAfter){   
        if(Trigger.isUndelete || Trigger.isInsert){
            for(opportunity c : Trigger.New){
                if(c.AccountId != Null){
                    accIdSet.add(c.AccountID);
                }
            }   
        }
        
        if(Trigger.isDelete){
            for(opportunity c : Trigger.Old){
                if(c.AccountId != Null){
                    accIdSet.add(c.AccountID);
                }
            }  
        }
    }
    
    
    List<Account> accList = [SELECT ID, No_of_opportunities__c, (SELECT Id , revenueFROM opportunites) FROM Account WHERE Id IN :accIdSet];
    
    if(accList.size() > 0 ){
        for(Account a : accList){           
            a.No_of_opportunities__c = a.contacts.size()    //which one i need to fill here;
        }
        update accList; 
    }
    
}

i am new to salesfoce and have query like this

list<account> accList= [select id, name,  accountNumber (select id, firtName, LastName, phone from contacts) from account];

now i want to display records of account name in one system.debug  and display firstName and phone values in another system.debug i am confusing nested for loop could any help me on this

i am new to salesfoce and have query like this

list<account> accList= [select id, name,  accountNumber (select id, firtName, LastName, phone from contacts) from account];

now i want to display records of account name in one system.debug  and display firstName and phone values in another system.debug i am confusing nested for loop could any help me on this