When the user saves a new Account record, it should trigger an INSERT into the Contracts object. How would one do this in Apex code?
IU am completely new to Apex code. I know onecould use classes & triggers.
How would i call an insert into another table, passing selected fields?
The main flow is like this:
1. The ClientServiceRep (CSR) selects the New Account option.
2. The system displays the Accounts page allowing the CSR to enter a new Account.
3. The CSR enters the obligatory Account details into the provided fields.
4. The CSR selects the Save Account option.
5. The system checks for errors, having found none it proceeds to the next step.
6. The system creates a new Accounts record, storing the Account name, unique Account ReferenceID for later usage.
7. The system insert a new Account into the system database.
8. The system creates a new contract
9. The system assigns both the Contract.[Account name] = Account.[Account name] and also assigns Contract.[ContractID] = Account.[Account ReferenceID].
10. The system insert a new Contract into the system database.
11. Having no errors the system proceeds to the next step.
12. The system commits both the new Account and the new Contract to the system database.
13. The system informs the CSR that a new account was created succesfully.
This is the end of this flow.
Any concrete examples on how to do the above would be GREATLY appreciated!
I just signed up for Salesforce Developer Edition for the 1st time. However, on the lefthand side the APEX menu in Setup --> Developer is missing. What went wrong? Must i sign up additionaly for APEX acces, if so where?