How to apply Record Validation to your (custom) Object

Do you want to use Record Validation for a (custom) Object, other than Lead, Contact or Account? Use this guide to configure Record Validation for your new Object.

Step 1 Add your Object to the Record Validation Setup

Navigate to the Record Validation Setup page. At the "Object Setup", click "Add Object" and find the Object you wish to configure. Record Validation can work with any Object in Salesforce.


Step 2 Map your fieldssets for Address, Email and Phone

Navigate to the Address, Email and Phone tabs in the Record Validation Setup and map the fields you want to use with Record Validation.

- Set up configuration for Address
- Set up configuration for Email
- Set up configuration for Phone

Step 3 Create your custom Record Validation Entry page (in Salesforce Lightning)

3.1 Navigate to the Salesforce Setup.
3.2  Navigate to Custom Code - Visualforce Pages.
3.3  Click "New".
3.4 At "Label Name", enter a name for your custom Record Validation Entry page. For example: "RVEntry_Opportunity", if you create the RV Entry page for Opportunities.
3.5 At "Available for Salesforce mobile apps and Lightning pages", set the checkbox to "True". 
3.6 At "Require CSRF protection on GET requests", set the checkbox to "False".
3.7 At "Visualforce Markup", copy and paste the code below. Make sure you replace *API_Name* with the API name of your Object. 

- Where can I find the API name of my Object? 

    <apex:page standardController="**Object_API_Name**" extensions="recordval.rv2ExtentionEntry" docType="html-5.0" sidebar="true" showHeader="true">
    <recordval:rv2Entry prefix="{!objectPrefix}" recordId="{!recordId}" cssSfUrl="{!URLFOR($Resource.recordval__slds,'')}" recType="{!recType}" dataString="{!dataMap}" retUrl="{!retUrl}" saveNew="{!saveAndNew}" clone="{!cloneAction}"/>
</apex:page>
Click Save.

Step 4 Override your 'New' and 'Edit' button

Override the 'New' button. 

4.1 Navigate to the Salesforce Setup.
4.2 Navigate to Platform Tools - Objects and Fields - Object Manager.
4.3 Find your (custom) Object in the list view and access it. 
4.4 Navigate to Buttons, Links and Actions. 
4.5 Find the 'New' button and click 'Edit'. 
4.6 At 'Override With', select 'Visualforce Page'. 
4.7 At the available Visualforce pages, select your newly created Visualforce Page.
4.8 Click Save. 


Override the 'Edit' button. 


4.9 Find the 'Edit' button and click 'Edit'.
4.10 At 'Override With', select 'Visualforce Page'. 
4.11 At the available Visualforce Pages select your newly created Visualforce Page. You can use the same Visualforce Page that was used to override the 'New' button. 
4.12 Click Save. 

Step 5 Create all required custom fields

Create the custom field "RV Record Status"

5.1 Navigate to Salesforce Setup. Navigate to the Object Manager.
5.2 Find and Open your custom object. Click on "Field & Relationships"
5.3 Click the "New" button.
5.4 Step 1. Under Data Type choose "Picklist" and click Next.
5.5 Step 2. Fill only the following information and then click Next:

Field Label: RV Record Status
Values: Click on the drop-down menu and select "RV Record Status" option.
Field Name: rv2Status

 5.6 Step 3. Depending on your Salesforce edition (Professional and up), you will now get a screen to establish field-level security.  Click 'Next'. 
 5.7 Step 4. Depending on your Salesforce edition (Professional and up), you will now get a screen where you are able to add the field to the page layout. Since this is a background process, this should not be applied to any page layout. Uncheck any page layout and click Next.
5.7 Step 4. Depending on your Salesforce edition (Professional and up), you will now get a screen where you are able to add the field to the page layout. Since this is a background process, this should not be applied to any page layout. Uncheck any page layout and click Next.
5.8 Now, after creating the "RV Record Status" field, you need to map it in the RV Setup. Navigate to RV Setup and click on the Custom Object
5.9 Select the field from the drop-down menu under "Field Configuration". 
Click here to watch a short video of how to do that

Step 6 Create the custom field "RV Validation Result"

Create the custom field "RV Validation Result"


5.1 Navigate to Salesforce Setup. Navigate to the Object Manager.
5.2 Find and Open your custom object. Click on "Field & Relationships"
5.3 Click the "New" button.
5.4 Step 1. Under Data Type choose "Text Area(Long)" and click Next.
5.5 Step 2. Fill the following information and then click Next.

Field Label: RV Validation Result
Field Name: rv2Validation

5.6 Depending on your Salesforce edition (Professional and up), you will now get a screen to establish field-level security. Click 'Next'. 
5.7 Step 4. Depending on your Salesforce edition (Professional and up), you will now get a screen where you are able to add the field to the page layout. Since this is a background process, this should not be applied to any page layout. Uncheck any page layout and click Next.
5.8 Now, after creating the "RV Validation Result" field, you need to map it in the RV Setup. Navigate to RV Setup and click on the Custom Object
5.9 Select the field from the drop-down menu under "Field Configuration". 
Click here to watch a short video of how to do that
That's it! You have now configured Record Validation for your (custom Object). You can now start validating your records. Check out our Usage Guide to find out more.
 

Having trouble?

Can't find what you're looking for? We are always happy to help.