Businesses commonly require the auto-creation of a child record whenever a parent record gets created. For example, as soon as an account gets activated, we need to auto-create an opportunity for that account, and we need to set the opportunity close date to the last date of the current quarter. To satisfy this type of business requirement, a developer normally writes an Apex trigger, but there are a few other ways to achieve it, without writing code:
- Using Process Builder
- Using a combination of Flow and Process Builder
- Using a combination of Flow and an Inline Visualforce page, on the account detail page
We will use Process Builder to solve this business requirement.
Let's consider a business scenario. Suppose that Joe Thompson is working as a system administrator at Universal Containers. He has received a requirement from the management to auto-create a contract as soon as an account gets created in Salesforce, and to auto-populate these values in the new contract:
- Contract term (months): 12
- Contract start date: Account created date, + 90 days
- Status: Draft
- Auto-relate it with a new account