• Zabi noor
  • NEWBIE
  • 0 Points
  • Member since 2021

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 1
    Replies
(Account type - individual account) a record needs to be created in the account object to capture all family members' details, what are the objects you will use and why? Each record should be linked with the father , e.g. Father (relation) Mother, Son, Daughter no custom object should be used?

For example this we need to enable person account settings or not. 
(Account type - individual account) a record needs to be created in the account object to capture all family members' details, what are the objects you will use and why? Each record should be linked with the father , e.g. Father (relation) Mother, Son, Daughter no custom object should be used?
rigger ContactTrigger on Contact (after insert, after update, after delete, after undelete) {

    //insert --> trigger.new
    //update --> trigger.new 
    //delete --> trigger.old 
    //undelete --> trigger.new 

    Set<Id> accIds = new Set<Id>();
    for(Contact con : trigger.isDelete ? trigger.old : trigger.new) {
        accIds.add(con.AccountId);
    }

    Map<Id,Integer> accIdConCountMap = new Map<Id,Integer>();
    Map<Id,List<Contact>> accIdConLstMap = new Map<Id,List<Contact>>();

    for(Contact con : [SELECT Id FROM Contact WHERE AccountId in: accIds AND MailingCountry = 'USA']) {

    }

}
With this apex trigger i'm not to modify the record if the stage is equal to Closed Won, but when record is not closed won. Not able to change stage to closed won also. 


trigger OpportunityTrigger on Opportunity(before update, before delete){
   
    
   
for(Opportunity opp1: Trigger.new) {
    if(opp1.StageName == 'Closed Won'){
        opp1.addError('You cannot modified the opportunity when stage is Closed Won.');                    
        
    }
}
(Account type - individual account) a record needs to be created in the account object to capture all family members' details, what are the objects you will use and why? Each record should be linked with the father , e.g. Father (relation) Mother, Son, Daughter no custom object should be used?