function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Debaranjan GhoshDebaranjan Ghosh 

PD1 Question 33

Question 33 ( Topic 1 )     
When is an Apex Trigger required instead of a Process Builder Process? 
• A. When a record needs to be created    
• B. When multiple records related to the triggering record need to be updated
• C. When a post to Chatter needs to be created   
• D. When an action needs to be taken on a delete or undelete, or before a DML 
operation is executed     
        
Answer : D      

While simulation with After Insert Trigger and Pocess Builder noticed we can not insert a 2nd Row in the same table while we can do that From Process Builder for a certain value of a field as a Condition then why A is not also a possible answer ? Can you please help to explain ?
Also can you please suggest How to simulate for B, C D? Code for A is given below.
Trigger objecttgr on Address__c(after insert){                
List<Address__c> cons =new List<Address__c>();                
 for(Address__c a :trigger.new){                   
   IF(a.Address_Line_1__c == 'XXY'){                
   Address__c c  =new Address__c();                
   c.Address_Line_1__c = 'XXXYYY';                     
   cons.add(c);   }             
}                
insert cons;                
}