function readOnly(count){ }
Don't have an account?
Search for an answer or ask a question of the zone or Customer Support.
You need to sign in to do that
Sign in to start searching questions
Signup for a Developer Edition
Sign in to start a discussion
After Update the Account record Active Status from "No" to "Yes" , Create a contact record.
trigger SendEmailtoContact on Account (after update) { list<Contact> lstCon=new list<Contact>(); If(Trigger.IsAfter && Trigger.IsUpdate){ For(Account Acc : trigger.new){ // If(Acc.Active__c == 'Yes' && Trigger.oldMap.get(Acc.Id).Active__c != Acc.Active__c){ Contact Con = new Contact(); Con.LastName=Acc.Name; Con.AccountId= Acc.id; lstCon.add(Con); } } } If(lstCon.size()>0){ insert lstCon; } }
Hi,
Please find the solution.
trigger CreateContact on Account (After Update) { List<Contact> contactList=new List<Contact>(); If(Trigger.IsAfter && Trigger.IsUpdate){ For(Account Ac : trigger.new){ If(Ac.Active__c == 'Yes' && Trigger.oldMap.get(Ac.Id).Active__c != Ac.Active__c){ Contact Con = new Contact(); Con.LastName='Test'; Con.AccountId= Ac.id; contactList.add(Con); } } } If(contactList.size()>0){ insert contactList; } }
Try Below Trigger Please Mark It As Best Answer If It Helps
Thank You!
All Answers
Try Below Trigger Please Mark It As Best Answer If It Helps
Thank You!
Hi,
Please find the solution.