...
Validation Rule for Contact:
If(AND(Run_Criminal_ReportCheck__c,
OR(ISBLANK(FirstName), ISBLANK(LastName), ISBLANK(MailingCity), ISBLANK(MailingCountry), ISBLANK(MailingPostalCode), ISBLNK(Text(MailingStateCode)ISBLANK(MailingState), ISBLANK(Social_Security_Number__c), ISBLANK(Birthdate), ISBLANK(MailingStreet))), true, false)
Validation Rule for Account:
If( AND(
Run_Criminal_Report__c,
OR(ISBLANK(FirstName), ISBLANK(LastName), ISBLANK(BillingCity), ISBLANK(BillingCountry), ISBLANK(BillingPostalCode), ISBLANK
...
Required fields missing on the related contact. Please Populate First Name, Last Name, Social Security and Full Mailing Address
...
4.
...
Flows
Automating Criminal Check Run.
In this step, we are going to create a process builder flow on your source object(lead, Contact, Opportunity, Account or any other custom object). Using this step, the system will automatically create and run the credit report.
Go to Setup >> Search for process builder Flows in Quick Find Box.
...
4.1 The
...
flow to create a criminal report:
Click New.
Enter Process Name (Process name can be anything, set it according to your preferences) Ex: Create criminal report.
API Name
Description
The process starts when Identifies when the process begins. Select when “A record changes”
See Image for Reference**
...
4.1.2 Setting Up Process Builder
Click add an object. Select your source object which could be Account, Contact, Lead, Opportunity or any other object.
Start the process* select “when a record is created or edited”.
Before saving your changes, confirm the selection because you can’t change the object after you save it.
...
Add Criteria –
Provide Trigger Name
Add “Matching Conditions” – always select “Conditions are meet” option. Provide the formula for evaluation. We recommend using an ID or other fields that uniquely identifies records so the process can pick exactly one record.
...
2. Select and Define Action
Action Type* – “Select Apex”.
Action Name* – Provide unique name
Apex Class * – Select “Auto Create Criminal Report Record”.
Set Apex Variables
Select “Add Rows”
Field* – Select “listIds”
Type* – Select field reference.
Value* – Select source object Id field.
...
3. Activate the process builder.
4.2 Automating Criminal Report Pull:
In this step, we are going to create another Process Builder on Criminal Report Object. Using this process, the system will automatically pull the Criminal Report.
From Setup, enter Builder in the Quick Find box(same as you have done earlier) and select Process Builder.
Click New.
4.2.1 Setting Up Process Builder:
Process Name. Example – Automatically run a criminal report(it is based on your own choice.)
API Name
Description
Process starts when “A record changes”
Click add an object. Select “Criminal Report”.
Start the process “when a record is created or edited”.
...
Criteria for Criminal Pull:
Provide Trigger Name.
Add “Matching Conditions” – always select “Conditions are meet” option.
Provide Conditions, Status = “Not Requested”
...
Defining Action for Credit Pull Process.
Action Type – “Select Apex”
Action Name – Provide a unique name.
Apex Class – Select “Automatically Run Criminal Reports”
Set Apex Variables
Select “Add Rows”
Field – Select “listIds”
Type – Select field reference.
Value – Select object Id Field.
See Screnshot for reference.
...
Congratulations You have successfully Installed “Criminal Checker” app.
...
Choose a record- triggered flow since we want the flow to be triggered whenever any DML action is performed on record.
Choose Freeform
Choose object as Lead(Source Object) and trigger the flow when record is created or updated.
Optimize the flow for Action and Related Records.
Create a resource. Go to Toolbox-> Manager -> New Resource. Choose Resource type as Formula and data type as Boolean. Enter the formula:
IF(
OR(
AND(ISNEW(),{!$Record.Run_criminal_report__c}),
AND(
({!$Record.Run_criminal_report__c} ),
ISCHANGED({!$Record.Run_criminal_report__c} ))),
true, false)
as shown in the image below:-
Choose Decision from the toolbox and add the condition Criminal(Formula we’ve created above) to true.
Choose action from toolbox and in that add Apex Action Create Criminal Report Record and choose list id as record id.
At last, connect the flow as shown in the below image and then Save the flow and Activate it.
4.2 Pull Criminal Report Using Flow
Choose a record- triggered flow since we want the flow to be triggered whenever any DML action is performed on record.
Choose Freeform
Choose object as Criminal Report and trigger the flow when record is created or updated.
Optimize the flow for Action and Related Records.
Choose Decision from Toolbox and give condition as status equals Not Requested.
Choose action from toolbox and in that add Apex action Automatically Run Criminal Check and choose list id as record id.
At last, connect the flow as shown in the below image and then Save the flow and Activate it.
If you have any queries regarding the criminal checker app please reach out to us at http://support@cloudmaveninc.com.