This repository contains sample data for Industries Digital Lending.
Digital Lending feature setup has several steps. This repo automates many of these setup steps and will also setup sample data (i.e. products etc.)
- Run all the following steps on a fresh org (i.e. any newly created org without additional data).
- The Digital Lending sample data in this repository is intended for non-production Salesforce orgs.
- The setup is divided into several sections. Digital Lending relies on several Salesforce features and each section will complete setup for a subset of the features.
- The setup will create data, for e.g. Product. Running the same command again might lead to duplicate data.
- The org should have all the appropriate licenses so that Digital Lending feature is available on your org. The setup will help you assign appropriate permission sets etc.
- The setup assumes that the user has latest
sf
(Salesforce-CLI) installed. It also assumes general familiarity with Salesforce. - Ensure that Apex Debug Level is set to
DEBUG
or more verbose. This is required since some of the commands below will debug-print from Apex code. You will need to note certain data from these logs to be used in later steps.
Connect to your org using sf org login web -a YourOrgAlias -r YOURURL
command.
- Run
sf apex run --file apex/OrgSetup.apex -o YourOrgAlias
Command Details
Creates a custom permission set SampleDigitalLendingClone.Assigns this and several other permission sets to the user.
- Run
sf project deploy start --metadata-dir metadata/OrgSetup -o YourOrgAlias
Command Details
Creates a custom field City on ProductQualification object.
Enables Context Definition, Salesforce Pricing and Industries KYC in the org.
Creates Sample Financial Services For Customer Community Plus Login Clone permission set
Adds picklist values for
- Salutation field on Applicant
- Loan Purpose field on ApplicationFormProduct
- IncomeFrequency and IncomeType fields on PartyIncome
- Type and RecurrenceInterval fields on PartyExpense
- Nationality field on PartyProfile
- Type field on Party Financial Asset
If you have existing active picklist values in your org for above picklists then you could add those to the standard value set to keep them active
- Run
sf project deploy start --metadata-dir metadata/Profiles -o YourOrgAlias
Command Details
Creates custom profiles called Sample Customer Community Plus Login User Clone, Agent Digital Lending and Underwriter Digital Lending. Adds object and user permissions for these profiles.Assigns field permission to these profiles for the new custom field City.
Updated Sharing Settings to expose objects to community users
In the above steps, new custom field City__c
has been created on ProductQualification
object and SourceApplicationFormProduct__c
has been created on Contract
object,
Product__c
, LowerBound__c
, UpperBound__c
, TierValue__c
, TierType__c
has been created on RateAdjustmentByCreditScore__c
and Product__c
, Term__c
, TierValue__c
, TierType__c
has been created on RateAdjustmentByTerm__c
.
We also assigned field permissions for two profiles. Assign field permissions to any other profiles you want these fields to be visible from Setup.
- Run
sf apex run --file apex/ProductConfiguration.apex -o YourOrgAlias
Command Details
Create a product catalog record, a product category record associate with a product record.Create five product attributes for this sample product according to the document.
Create product list rate record and product fee record for the sample product.
You could also add product image and turn on sharing settings for community user for this sample product by following the document.
Creates a product qualification records.
- Run
sf project deploy start --metadata-dir metadata/ProductQualificationSetup -o YourOrgAlias
Command Details
Creates a Decision Table for Product Qualification.- Run
sf project deploy start --metadata-dir metadata/ProductQualificationExpressionSet -o YourOrgAlias
Command Details
Creates two expression sets for Product Qualification.- Run
sf project deploy start --metadata-dir metadata/DisclosureAndConsent -o YourOrgAlias
Command Details
Creates a Decision Matrix for Disclosure And Consent.- Run
sf apex run --file apex/DisclosureAndConsent.apex -o YourOrgAlias
Command Details
Creates Application Form, Application Form Text, Data Use Purpose, and ApplicationFormDataUse record.Adds rows to the Decision Matrix for Disclosure And Consent.
- Run
sf project deploy start --metadata-dir metadata/DocumentUpload -o YourOrgAlias
Command Details
Creates a Decision Matrix for Document Upload.Creates two Document Types.
- Run
sf apex run --file apex/DocumentUpload.apex -o YourOrgAlias
Command Details
Adds rows to the Decision Matrix for Document Upload.- Run
sf project deploy start --metadata-dir metadata/StraightThroughProcessing -o YourOrgAlias
Command Details
Creates a Decision Matrix for Straight Through Processing.- Run
sf apex run --file apex/StraightThroughProcessing.apex -o YourOrgAlias
Command Details
Adds rows to the Decision Matrix for Straight Through Processing.Activates Decision Matrix for Straight Through Processing.
- Run
sf apex run --file apex/Pricing.apex -o YourOrgAlias
Command Details
Adds records in the custom objects for Pricing.- Run
sf project deploy start --metadata-dir metadata/PricingSetup -o YourOrgAlias
Command Details
Creates decision tables used for pricing.- Run
sf project deploy start --metadata-dir metadata/PricingRecipe -o YourOrgAlias
Command Details
Updates existing pricing recipe called NGPDefaultRecipe that provides configuration for how lookup tables are used within procedures- Run
sf project deploy start --metadata-dir metadata/PricingExpressionSet -o YourOrgAlias
Command Details
Creates expression set definitions used for pricing.- Run
sf project deploy start --metadata-dir metadata/CompliantDataSharing -o YourOrgAlias
Command Details
Creates Application Form Participant Role With Read/Write access level- Run
sf apex run --file apex/StageManagementGroupSetup.apex -o YourOrgAlias
Command Details
Creates 2 participant groups called Agent_Group and Underwriter_Group- Run
sf project deploy start --metadata-dir metadata/StageManagement -o YourOrgAlias
Command Details
Adds Apex files, Decision Matrix Definition, Flow, and Participant Roles. CDSCacheHelper helps cache SOQL results. CDSUtil will be run as a stage transition step. When an Application Form Product's Stage field changes, the Visible Status field will change based on the decision matrix values. Additionally, the associated Application Form's Stage field will also change based on the decision matrix values. Afterwards, Participant records will be created on the Application Form Product, the associated Application Form record, and the associated Party Profile record based on the decision matrix values. Creates Decision Matrix definitions for the org. Creates Participant roles for access levels on Application Form Product, Application Form, and Party Profile entities. Creates an Autolaunched Flow to invoke the CDSUtil Apex file.- Run
sf apex run --file apex/StageManagement.apex -o YourOrgAlias
Command Details
Adds rows to the Decision Matrices: AFPStage_To_AFStage, AFPStage_To_ApplicantVisibleStatus, AFPStage_To_CDS_Access- Run
sf project deploy start --metadata-dir metadata/StageDefinition -o YourOrgAlias