To solve the preceding business requirement, we will use Process Builder. In the runtime process, we will auto-create a contract record whenever a new account record gets created. To do this, follow these instructions:
- In Lightning Experience, click on Setup (gear icon) | Setup | PLATFORM TOOLS | Process Automation | Process Builder; click on the New button, and enter the following details:
- Process Name: Enter the name of the process. Enter Auto create new Contract as the Process Name. It must be within 255 characters.
- API Name: This will be auto-populated, based on the name. It must be within 77 characters.
- Description: Write some meaningful text, so that other developers or administrators can easily understand why this process was created.
- This process starts when: This allows you to select when you want to start your process. The following options are available:
- A record changes: Select this option if you want to start your process when a record is created or edited.
- It's invoked by another process: Select this option if you want to invoke your process from another process. This allows you to create an invocable process. An invocable process is a process that starts when another process invokes it. In Chapter 3, Building Efficient and Performance-Optimized Processes, we will discuss a few use cases in detail.
In this case, select A record changes. The fields should appear as follows:
-
Click on the Save button when you have finished. It will redirect you to the process canvas, which will allow you to create the process by clicking, not code.