- Scheduleonce
- Account Integrations
- Crm
- Salesforce
Handling required Salesforce fields in the Field validation step
The Field validation mapping step in the Salesforce connector setup process includes all Salesforce universally required fields that do not have a default value for the five standard objects in your Salesforce account: Lead, Contact, Account, Event, and Case.
These fields require a value in order to allow the creation of a new record. The role of the Field validation mapping step is to ensure that the appropriate value is made available for bookings created via the OnceHub Salesforce integration.
In this article, you’ll learn about handing required Salesforce fields in the Field validation step.
Default values for universally required fields
Section titled “Default values for universally required fields”We recommend that you always set a default value for universally required fields in your Salesforce organization. Once done, these fields will be removed from the Field validation mapping step of the Salesforce connector setup wizard.
When a booking is made and a required field in Salesforce has not been mapped to a field in OnceHub, a Field validation error will be detected. OnceHub will pass a default value to the field in Salesforce. The default values that will be passed are shown in the table below:
| Custom field type | Default value |
|---|---|
| Currency | $0.00 |
| Date | Current date |
| Date/Time | Current time |
| email@example.com | |
| Geolocation | 0.000000, 0.000000 |
| Number | 0 |
| Percent | 0% |
| Phone | 1234567890 |
| Text, Text area, Text area (Long), Text area (Rich) | Unspecified |
| URL | http://NA |
To fix this Field validation error, you should update the Field validation mapping of the Salesforce connector setup wizard. You only need to fix the fields that create validation errors on the affected Booking page.
Field types in the Field validation mapping step
Section titled “Field types in the Field validation mapping step”The Field validation mapping step handles two types of fields: those that are supported by the integration and those that are not supported.
Supported Salesforce fields
Section titled “Supported Salesforce fields”In the Field validation mapping step of the Salesforce connector setup wizard, you will see all universally required fields that require a value. This value can be supplied by either a OnceHub field, a static value, or an existing Salesforce value. This will ensure that a value is always associated with the required field when a new record is created.
Non-supported Salesforce fields
Section titled “Non-supported Salesforce fields”In the Field validation mapping step of the Salesforce connector setup wizard, you will see all universally required fields that are not supported by the integration. Since the integration does not support these fields, you have no choice but to make these universally required fields non-mandatory for the affected Booking pages.
If you still want these fields to be mandatory, you can set them as required on the Page Layout. This will make the fields required for manual entry but not for the API. Once done, they will be removed from the Field validation mapping step of the Salesforce connector setup process.
Requirements
Section titled “Requirements”To handle supported and non-supported Salesforce universally required fields, you will need:
- A OnceHub Administrator.
- An active connection to your Salesforce API User.
- A Salesforce Administrator.
Handling supported Salesforce universally required fields
Section titled “Handling supported Salesforce universally required fields”In the Salesforce connector setup, go to the Field validation tab (Figure 1).
Figure 1. Validation field mapping.-
In the Validation options column, select an option. You have three options that are relevant only for supported Salesforce field types:
-
A OnceHub field: This list includes over 40 System fields and all Custom fields in your OnceHub account.
-
A Static value: This option maps a default text or date value to the Salesforce field.
-
An existing Salesforce value: This list retrieves the pick list values from your Salesforce account.
-
-
In the Available fields/values column, select the relevant OnceHub field, assign an existing Salesforce value, or type a static value.
-
Click the Save button or Save and Continue if you have completed mapping all required fields.
Handling non-supported Salesforce universally required fields
Section titled “Handling non-supported Salesforce universally required fields”To handle non-supported Salesforce universally required fields, you need to identify which non-supported fields are blocking the integration.
-
In the Salesforce connector setup, go to the Field validation tab.
-
Review the list of non-supported Salesforce universally required fields and define which standard Objects Users connected to Salesforce will be creating new records for.
-
Sign in to Salesforce as an administrator.
-
In your Salesforce Setup page, go to Object and Fields → Object Manager.
-
Select the Object that you want to edit.
-
Select Fields & Relationships.
-
Select the non-supported Salesforce field you have identified earlier.
-
Click Edit.
-
Under General Options, ensure that is it not set as Required.
-
Return to OnceHub and refresh the page. The Field validation tab is now updated and the non-supported field will have disappeared.
If you still want these fields to be mandatory for manual entry, you can set them as required on the Page Layout. This will make the fields required for manual entry but not for the API.
- In Salesforce, go to Setup.
- In your Salesforce Setup page, go to Object and Fields → Object Manager.
- Select the Object that you want to edit.
- Select Page Layout page and choose the Page Layout you want to edit.
- On the Page Layout editor, double click the Custom field and check the checkbox to mark it as Required.
- Click OK.
- When you have completed your edits, click the Save button.
