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
Elon Musk 15Elon Musk 15 

help with trigger acc & con

Create a field on Account called “Only_Default_Contact”, checkbox, default off
Assignment:
When a new Account is created, create a new Contact that has the following data points:
First Name = “Info”
Last Name = “Default”
Email = “info@websitedomain.tld”
Only_Default_Contact = TRUE
When the Account has more than 1 Contact, update Only_Default_Contact to FALSE.

my question is on which object the trigger need to be created(Account,contact) if so Y
Arvind_SinghArvind_Singh
Hello Elon, 

You need to create two trigger here for above requirement 

1. On Account  > For "When a new Account is created, create a new Contact "  : Whenever new Account created then Trigger on Account will Create New Contact 
what if someone create new contact for existing Account in this case we need to update Account so we need another trigger on contact. 

2. On Contact  >  Account has more than 1 Contact, update Only_Default_Contact to FALSE 
Once you have created new contact then check for flag and update flag.

Hope it helps.