Sales Cloud Integration
Schoolworks implements RecordTypes on the Lead, Account, Contact and Opportunity Objects to manage different use cases.
From the Lead Stage:
isFromLead
Lead Type - formula field of the RecordType Name
Lead ID - Salesforce Record ID of the Lead
Lead Record Types
Direct Student
Existing Agent
New Agent
Company Training
Account Record Types
Student
Agent
Company
Teacher
Accommodation
Supplier
Opportunity Record Types
Direct Student
Agent Student
Agent Group
Company Student
Company Group
Lead Conversion
Schoolworks has a special ‘isFromLead' tickbox on the Lead record which is copied to the Account and Opportunity records so that we know they were created from a Lead.
This tickbox is set by default on the lead and must be ticked by any integration creating Lead records.
There are triggers that execute on the creation of Account and Opportunity that set the appropriate RecordTypes on those Objects.
When isFromLead is ticked, on the creation of an Opportunity a trigger runs which maps the Opportunity Record Type to the Account Record Type.
Mapping of Lead RecordTypes to Opportunity Record Types
Direct Student → Direct Student
Existing Agent --> Agent Student
New Agent --> Agent Student
Company Training --> Company Group
Validation Filter Rule - there is currently a validation rule on the Opportunity which enforces this, which will be a problem for Sales Cloud customers using other custom record types.