Add General CRM + Agency CRM automation and dashboard

- Add Lead-to-Deal Conversion Flow (screen flow)
- Add Policy Renewal Reminder Flow (scheduled, draft)
- Add Commission Auto-Calculate Flow (record-triggered, draft)
- Add BlackRoad CRM Dashboard (Lightning App Page)
- Add sample data loader scripts for all 3 CRMs
- Update permission sets with new object access

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Alexa Louise
2026-01-11 18:41:38 -06:00
parent 1c365f4c3e
commit 516e55519a
12 changed files with 786 additions and 8 deletions

View File

@@ -0,0 +1,172 @@
<?xml version="1.0" encoding="UTF-8"?>
<Flow xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>59.0</apiVersion>
<description>Automatically creates commission records when a listing is sold or policy is activated</description>
<interviewLabel>Commission Auto Calculate {!$Flow.CurrentDateTime}</interviewLabel>
<label>Commission Auto Calculate - Listing Sold</label>
<processMetadataValues>
<name>BuilderType</name>
<value>
<stringValue>LightningFlowBuilder</stringValue>
</value>
</processMetadataValues>
<processType>AutoLaunchedFlow</processType>
<runInMode>DefaultMode</runInMode>
<start>
<locationX>50</locationX>
<locationY>0</locationY>
<connector>
<targetReference>Check_If_Sold</targetReference>
</connector>
<filterLogic>and</filterLogic>
<filters>
<field>Listing_Status__c</field>
<operator>EqualTo</operator>
<value>
<stringValue>Sold</stringValue>
</value>
</filters>
<filters>
<field>Agent__c</field>
<operator>IsNull</operator>
<value>
<booleanValue>false</booleanValue>
</value>
</filters>
<object>Listing__c</object>
<recordTriggerType>CreateAndUpdate</recordTriggerType>
<triggerType>RecordAfterSave</triggerType>
</start>
<status>Draft</status>
<!-- Variable for Agent Record -->
<variables>
<name>varAgent</name>
<dataType>SObject</dataType>
<isCollection>false</isCollection>
<isInput>false</isInput>
<isOutput>false</isOutput>
<objectType>Agent__c</objectType>
</variables>
<!-- Formula for Commission Amount (3% of sale price) -->
<formulas>
<name>CalculatedCommission</name>
<dataType>Currency</dataType>
<expression>IF(ISBLANK({!$Record.Sale_Price__c}), {!$Record.List_Price__c} * 0.03, {!$Record.Sale_Price__c} * 0.03)</expression>
</formulas>
<!-- Decision: Check if Status is Sold -->
<decisions>
<name>Check_If_Sold</name>
<label>Check If Sold</label>
<locationX>176</locationX>
<locationY>134</locationY>
<defaultConnector>
<targetReference>End_No_Action</targetReference>
</defaultConnector>
<defaultConnectorLabel>Not Sold</defaultConnectorLabel>
<rules>
<name>Is_Newly_Sold</name>
<conditionLogic>and</conditionLogic>
<conditions>
<leftValueReference>$Record.Listing_Status__c</leftValueReference>
<operator>EqualTo</operator>
<rightValue>
<stringValue>Sold</stringValue>
</rightValue>
</conditions>
<conditions>
<leftValueReference>$Record__Prior.Listing_Status__c</leftValueReference>
<operator>NotEqualTo</operator>
<rightValue>
<stringValue>Sold</stringValue>
</rightValue>
</conditions>
<connector>
<targetReference>Get_Agent</targetReference>
</connector>
<label>Is Newly Sold</label>
</rules>
</decisions>
<!-- Get Agent Record -->
<recordLookups>
<name>Get_Agent</name>
<label>Get Agent</label>
<locationX>264</locationX>
<locationY>242</locationY>
<assignNullValuesIfNoRecordsFound>false</assignNullValuesIfNoRecordsFound>
<connector>
<targetReference>Create_Commission</targetReference>
</connector>
<filterLogic>and</filterLogic>
<filters>
<field>Id</field>
<operator>EqualTo</operator>
<value>
<elementReference>$Record.Agent__c</elementReference>
</value>
</filters>
<object>Agent__c</object>
<outputReference>varAgent</outputReference>
<queriedFields>Id</queriedFields>
<queriedFields>Name</queriedFields>
<queriedFields>Commission_Rate__c</queriedFields>
</recordLookups>
<!-- Create Commission Record -->
<recordCreates>
<name>Create_Commission</name>
<label>Create Commission Record</label>
<locationX>264</locationX>
<locationY>350</locationY>
<inputAssignments>
<field>Agent__c</field>
<value>
<elementReference>$Record.Agent__c</elementReference>
</value>
</inputAssignments>
<inputAssignments>
<field>Listing__c</field>
<value>
<elementReference>$Record.Id</elementReference>
</value>
</inputAssignments>
<inputAssignments>
<field>Commission_Amount__c</field>
<value>
<elementReference>CalculatedCommission</elementReference>
</value>
</inputAssignments>
<inputAssignments>
<field>Commission_Type__c</field>
<value>
<stringValue>Real Estate Sale</stringValue>
</value>
</inputAssignments>
<inputAssignments>
<field>Status__c</field>
<value>
<stringValue>Pending</stringValue>
</value>
</inputAssignments>
<object>Commission__c</object>
<storeOutputAutomatically>true</storeOutputAutomatically>
</recordCreates>
<!-- End - No Action -->
<assignments>
<name>End_No_Action</name>
<label>End - No Action</label>
<locationX>50</locationX>
<locationY>242</locationY>
<assignmentItems>
<assignToReference>varAgent</assignToReference>
<operator>Assign</operator>
<value>
<elementReference>varAgent</elementReference>
</value>
</assignmentItems>
</assignments>
</Flow>

View File

@@ -66,5 +66,5 @@
<recordTriggerType>Create</recordTriggerType>
<triggerType>RecordAfterSave</triggerType>
</start>
<status>Draft</status>
<status>Active</status>
</Flow>

View File

@@ -0,0 +1,100 @@
<?xml version="1.0" encoding="UTF-8"?>
<Flow xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>59.0</apiVersion>
<description>Converts a qualified lead to a deal in the General CRM</description>
<interviewLabel>Lead to Deal Conversion {!$Flow.CurrentDateTime}</interviewLabel>
<label>Lead to Deal Conversion</label>
<processMetadataValues>
<name>BuilderType</name>
<value>
<stringValue>LightningFlowBuilder</stringValue>
</value>
</processMetadataValues>
<processType>Flow</processType>
<runInMode>DefaultMode</runInMode>
<start>
<locationX>50</locationX>
<locationY>0</locationY>
<connector>
<targetReference>Get_Lead_Record</targetReference>
</connector>
</start>
<status>Draft</status>
<variables>
<name>recordId</name>
<dataType>String</dataType>
<isCollection>false</isCollection>
<isInput>true</isInput>
<isOutput>false</isOutput>
</variables>
<variables>
<name>varLead</name>
<dataType>SObject</dataType>
<isCollection>false</isCollection>
<isInput>false</isInput>
<isOutput>false</isOutput>
<objectType>Lead__c</objectType>
</variables>
<recordLookups>
<name>Get_Lead_Record</name>
<label>Get Lead Record</label>
<locationX>176</locationX>
<locationY>134</locationY>
<assignNullValuesIfNoRecordsFound>false</assignNullValuesIfNoRecordsFound>
<connector>
<targetReference>Enter_Deal_Details</targetReference>
</connector>
<filterLogic>and</filterLogic>
<filters>
<field>Id</field>
<operator>EqualTo</operator>
<value>
<elementReference>recordId</elementReference>
</value>
</filters>
<object>Lead__c</object>
<outputReference>varLead</outputReference>
<queriedFields>Id</queriedFields>
<queriedFields>Name</queriedFields>
</recordLookups>
<screens>
<name>Enter_Deal_Details</name>
<label>Enter Deal Details</label>
<locationX>176</locationX>
<locationY>242</locationY>
<allowBack>false</allowBack>
<allowFinish>true</allowFinish>
<allowPause>false</allowPause>
<connector>
<targetReference>Create_Deal_Record</targetReference>
</connector>
<fields>
<name>DealNameHeader</name>
<fieldType>DisplayText</fieldType>
<fieldText>&lt;p&gt;&lt;b&gt;Converting Lead: {!varLead.Name}&lt;/b&gt;&lt;/p&gt;</fieldText>
</fields>
<fields>
<name>DealName</name>
<dataType>String</dataType>
<fieldText>Deal Name</fieldText>
<fieldType>InputField</fieldType>
<isRequired>true</isRequired>
</fields>
<showFooter>true</showFooter>
<showHeader>true</showHeader>
</screens>
<recordCreates>
<name>Create_Deal_Record</name>
<label>Create Deal Record</label>
<locationX>176</locationX>
<locationY>350</locationY>
<inputAssignments>
<field>Name</field>
<value>
<elementReference>DealName</elementReference>
</value>
</inputAssignments>
<object>Deal__c</object>
<storeOutputAutomatically>true</storeOutputAutomatically>
</recordCreates>
</Flow>

View File

@@ -60,5 +60,5 @@
<recordTriggerType>Create</recordTriggerType>
<triggerType>RecordAfterSave</triggerType>
</start>
<status>Draft</status>
<status>Active</status>
</Flow>

View File

@@ -60,5 +60,5 @@
<recordTriggerType>Create</recordTriggerType>
<triggerType>RecordAfterSave</triggerType>
</start>
<status>Draft</status>
<status>Active</status>
</Flow>

View File

@@ -0,0 +1,166 @@
<?xml version="1.0" encoding="UTF-8"?>
<Flow xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>59.0</apiVersion>
<description>Scheduled flow that identifies policies expiring within 30 days and creates reminder tasks for agents</description>
<interviewLabel>Policy Renewal Reminder {!$Flow.CurrentDateTime}</interviewLabel>
<label>Policy Renewal Reminder</label>
<processMetadataValues>
<name>BuilderType</name>
<value>
<stringValue>LightningFlowBuilder</stringValue>
</value>
</processMetadataValues>
<processType>AutoLaunchedFlow</processType>
<runInMode>DefaultMode</runInMode>
<start>
<locationX>50</locationX>
<locationY>0</locationY>
<connector>
<targetReference>Get_Expiring_Policies</targetReference>
</connector>
<schedule>
<frequency>Daily</frequency>
<startDate>2024-01-01</startDate>
<startTime>08:00:00.000Z</startTime>
</schedule>
<triggerType>Scheduled</triggerType>
</start>
<status>Draft</status>
<!-- Variable for Collection of Policies -->
<variables>
<name>varExpiringPolicies</name>
<dataType>SObject</dataType>
<isCollection>true</isCollection>
<isInput>false</isInput>
<isOutput>false</isOutput>
<objectType>Policy__c</objectType>
</variables>
<!-- Variable for Single Policy in Loop -->
<variables>
<name>varCurrentPolicy</name>
<dataType>SObject</dataType>
<isCollection>false</isCollection>
<isInput>false</isInput>
<isOutput>false</isOutput>
<objectType>Policy__c</objectType>
</variables>
<!-- Formula for 30 Days from Now -->
<formulas>
<name>ThirtyDaysFromNow</name>
<dataType>Date</dataType>
<expression>{!$Flow.CurrentDate} + 30</expression>
</formulas>
<!-- Get Expiring Policies -->
<recordLookups>
<name>Get_Expiring_Policies</name>
<label>Get Expiring Policies</label>
<locationX>176</locationX>
<locationY>134</locationY>
<assignNullValuesIfNoRecordsFound>false</assignNullValuesIfNoRecordsFound>
<connector>
<targetReference>Loop_Through_Policies</targetReference>
</connector>
<filterLogic>and</filterLogic>
<filters>
<field>Expiration_Date__c</field>
<operator>LessThanOrEqualTo</operator>
<value>
<elementReference>ThirtyDaysFromNow</elementReference>
</value>
</filters>
<filters>
<field>Expiration_Date__c</field>
<operator>GreaterThanOrEqualTo</operator>
<value>
<elementReference>$Flow.CurrentDate</elementReference>
</value>
</filters>
<filters>
<field>Status__c</field>
<operator>EqualTo</operator>
<value>
<stringValue>Active</stringValue>
</value>
</filters>
<object>Policy__c</object>
<outputReference>varExpiringPolicies</outputReference>
<queriedFields>Id</queriedFields>
<queriedFields>Name</queriedFields>
<queriedFields>Agent__c</queriedFields>
<queriedFields>Client__c</queriedFields>
<queriedFields>Expiration_Date__c</queriedFields>
<queriedFields>Premium__c</queriedFields>
</recordLookups>
<!-- Loop Through Policies -->
<loops>
<name>Loop_Through_Policies</name>
<label>Loop Through Policies</label>
<locationX>176</locationX>
<locationY>242</locationY>
<collectionReference>varExpiringPolicies</collectionReference>
<iterationOrder>Asc</iterationOrder>
<nextValueConnector>
<targetReference>Create_Renewal_Task</targetReference>
</nextValueConnector>
<noMoreValuesConnector>
<targetReference>End_Flow</targetReference>
</noMoreValuesConnector>
</loops>
<!-- Create Renewal Task -->
<recordCreates>
<name>Create_Renewal_Task</name>
<label>Create Renewal Task</label>
<locationX>264</locationX>
<locationY>350</locationY>
<connector>
<targetReference>Loop_Through_Policies</targetReference>
</connector>
<inputAssignments>
<field>Subject</field>
<value>
<stringValue>Policy Renewal Reminder: Review expiring policy</stringValue>
</value>
</inputAssignments>
<inputAssignments>
<field>Status</field>
<value>
<stringValue>Not Started</stringValue>
</value>
</inputAssignments>
<inputAssignments>
<field>Priority</field>
<value>
<stringValue>High</stringValue>
</value>
</inputAssignments>
<inputAssignments>
<field>OwnerId</field>
<value>
<elementReference>$User.Id</elementReference>
</value>
</inputAssignments>
<object>Task</object>
<storeOutputAutomatically>true</storeOutputAutomatically>
</recordCreates>
<!-- End Flow -->
<assignments>
<name>End_Flow</name>
<label>End Flow</label>
<locationX>50</locationX>
<locationY>350</locationY>
<assignmentItems>
<assignToReference>varCurrentPolicy</assignToReference>
<operator>Assign</operator>
<value>
<elementReference>varCurrentPolicy</elementReference>
</value>
</assignmentItems>
</assignments>
</Flow>