-
-
Save TheShubhamVsnv/6a6725f33395fce2ad80788f40e13688 to your computer and use it in GitHub Desktop.
<!-- wp:paragraph --> <p>When a new Account is created, create a new Contact that has the following data points:</p> <!-- /wp:paragraph --> <!-- wp:list --> <ul><li>First Name = “Info”</li><li>Last Name = “Default”</li><li>Email = “info@websitedomain.tld”</li><li>Only_Default_Contact = TRUE</li></ul> <!-- /wp:list --> <!-- wp:paragraph --> <p>Wh…
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trigger defaultContact on account(after insert) | |
{ | |
Account acc = [select id,Only_Default_Contact from account where id in : trigger.new]; | |
contact con = new contact(); | |
con.firstName = 'Info'; | |
con.LastName = 'Default'; | |
con.email = 'info@websitedomain.tld'; | |
con.accountId = acc.id; | |
insert con; | |
//If you want to make checkbox true then use this also- | |
acc.Only_Default_Contact = true; | |
update acc; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment