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 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.
-
Navigate to
Contract Lifecycle Management
'sGeneral Settings
from Setup (Feature Settings
→Contract Lifecycle Management
→General Settings
), and enableSalesforce Contracts
. -
Navigate to
Document Generation
'sGeneral Settings
from Setup (Feature Settings
→Document Generation
→General Settings
), and enableDesign Document Templates in Salesforce
. -
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
- Run
sf project deploy start --metadata-dir metadata/Profiles -o YourOrgAlias
Command Details
Creates a custom profile called Sample Customer Community Plus Login User Clone, adds object permissions and user permissions for community userAssigns fieldpermissions to Admin and Sample Customer Community Plus Login User Clone profiles for the new custom field City.
Updated Sharing Settings to expose objects to community users
-
Navigate to
Product Discovery Settings
from Setup (Feature Settings
→Product Discovery
→Product Discovery Settings
), and enableQualification Procedure
. -
Navigate to
Digital Lending
from Setup (Feature Settings
→Lending
→Digital Lending
), and enableDigital Lending
.
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.
-
In the files
SampleDigitalLendingActivateSignedContractClone.flow
,SampleDigitalLendingGenerateOrUpdateContractClone.flow
,SampleDigitalLendingUpdateDocumentGenerationClone.flow
in the foldermetadata/Contract/flows/
replacesystem_admin_email
with system admin's email. -
Sign up for a DocuSign Developer edition account and create an application as mentioned in steps 1-3 here https://help.salesforce.com/s/articleView?id=ind.sf_contracts_Create_an_Auth_Provider_for_DocuSign.htm&type=5
-
Replace the
consumerKey
andconsumerSecret
in the fileDocuSign.authprovider
with the DocuSign App's Integration Key and DocuSign App's Secret Key from your Docusign account. ReplaceconfigValue
inDocuSigneSignVendorAccountId.eSignatureConfig
with the API AccountId from DocuSign account. ReplacevendorAccountIdentifier
inDocuSign_Contract.eSignatureEnvelopeConfig
with the API AccountId from DocuSign account. -
Run
sf project deploy start --metadata-dir metadata/Contract -o YourOrgAlias
Command Details
Adds apex classes, decision matrix, document templates, flows, data raptors used for contract generation.Sets various settings: contract types, document generation settings, object hierarchy relationship, and file upload and download security settings which are required for contract generation.
Creates Email Template, Auth Provider, Named Credential, ESignatureConfig, RemoteSiteSetting and ESignatureEnvelopeConfig for Electronic Signature.
-
Do the steps 12 to 15 as mentioned here https://help.salesforce.com/s/articleView?id=ind.sf_contracts_Create_an_Auth_Provider_for_DocuSign.htm&type=5
-
Edit Named Credential called
DocuSignAuthProvider
created in your org as part of previous step to trigger authentication with DocuSign. -
Run
sf apex run --file apex/Contract.apex -o YourOrgAlias
Command Details
Activates document templates.Adds rows to the Decision Matrix for Contract Generation.
Creates Object State Transition for Electronic Signature.
- 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.- Update Lookup Table's Component Type
Steps
-
Go to Setup > Pricing Recipes > NGPDefaultRecipe > Click Modify
-
Update CreditScoreBasedAdjustment's Variable Mapping to TierValue__c for AdjustmentValue and TierType__c for AdjustmentType
-
Update ProductListRateDT's Pricing Component Type to List Price and update the Variable Mapping to List Rate for UnitPrice
-
Update TermBasedAdjustmentDT's Variable Mapping to TierValue__c for AdjustmentValue and TierType__c for AdjustmentType
-
Select CreditScoreBasedAdjustment, ProductListRateDT and TermBasedAdjustmentDT by clicking on the + button
-
Save
-
Update decision tables ProductListRateDT, TermBasedAdjustmentDT and CreditScoreBasedAdjustment status to Active
-
Update LookUpId for above 3 decision tables in expression set file AppFormProductProposalProc.expressionSetDefinition
-
Run
sf project deploy start --metadata-dir metadata/PricingExpressionSet -o YourOrgAlias
Command Details
Creates expression set definition used for pricing.-
Navigate to
Compliant Data Sharing
'sObject Enablement Settings
from Setup and enableCompliant Data Sharing for CRM Users
forApplication Form
Object. -
Run
sf project deploy start --metadata-dir metadata/CompliantDataSharing -o YourOrgAlias