Managing Form Components
The InCountry Data Residency for Salesforce package provides the following components:
Web-to-Lead component
This component is supported in the legacy package and in the three-model package for the restriction and redaction models.
This component is available upon request.
The InCountry Data Residency for Salesforce package provides a Web-to-Lead component that captures data submitted by website visitors, including their contact information, and then stores it as a Lead record in Salesforce.
Adjusting the Web-to-Lead component
-
From Setup, click Sites, and then click New.
-
On the Site Edit page, enter Site Label, Site Name, Active Site Home Page and check the Active box. A new empty Visual Force page can be chosen as
Active Site Home Page
(you can create this page by navigating to the Developer Console and following this path File > New > Visualforce Page). -
Click Save.
-
Click Public Access settings.
-
Click Enable Apex Class Access at the top of the page.
-
Click Edit.
-
Select the
InCountryWebToLeadService
class and click Save. -
Return to the Sites list and copy the site URL.
-
Go to the InCountry application and select the Web-to-Lead tab.
-
Paste the Border URL address (for example,
https://sa-proxy-mt-01.api.incountry.io/
) and appendx-inc-sa-mt-query/services/apexrest/leadservice
to this address for the fields with values that will be passed as query parameters within the request body orx-inc-sa-mt-body/services/apexrest/leadservice
for the fields with values that will be passed as JSON Body without query parameters. For more information, see the Creating new services section. -
Click the Save icon.
-
Select the fields you want to include in the form.
-
Enter the Return URL if required. If not needed, leave it empty.
-
Set the default user for the Lead, if needed.
-
Move the Use parametrized requests toggle right to enable such option. By default, it is enabled.
- If the toggle is activated, fields with values will be passed as query parameters within the request body. For example:
- If the toggle is disabled, fields with values will be passed as JSON Body without query parameters. For example:
As a result of the response, filed values will be returned to your Salesforce org as request parameters or within the request body, depending on the request type.
-
Click + Add reCAPTCHA and populate Public and Private keys if captcha is required. If not needed, leave them empty.
You can find out how to generate those keys here: Developer's Guide
-
Click Generate form > Copy to clipboard.
-
Paste this code on the required HTML page.
Parameterized requests
The Web-to-Lead component supports the functionality to handle parameterized requests. Below you can see an example of such a request:
POST https://sa-proxy-mt-01.api.incountry.io
/services/apexrest/leadservice?GRD_Sub_Type__c=Component%2FSystem+Mfr.
&Company=Test+Company
&GRD_Interested_In_Glass_For__c=Residential+Windows
&GRD_With_Benefits_Such_As__c=Solar+Protection
&FirstName=Sudesh
&LastName=Kumar
&Email=sudeshb1607%40gmail.com
&MobilePhone=%2B49+69+978997668
&GRD_Language__c=de
&Country=CF
&City=Munich
&PostalCode=80992
&GRD_Your_Message__c=Test+Message+for+Russia+Site
&GRD_Do_Not_Solicit__c=1
&Street=Test+Address+1+Test+Address+2
&Status=Unqualified
&GRD_Business_Reason__c=Web-To-Lead
&GRD_Priority__c=Medium
&GRD_Lead_Sub_Source__c=Information+Request
&recordType=0123h000000R6rq
&LeadSource=GRD_Website
&oid=00D0n0000009H3m
&encoding=UTF-8
Lead Convert component
This component is supported in the legacy package and in the three-model package for the restriction and redaction models.
The InCountry Data Residency for Salesforce package provides the Lead Convert component that converts a lead to an account, contact, or opportunity using information from the lead you’re converting.
For the details on this functionality, please check our documentation.
Configuring the Lead Convert component
In order for the leads to be converted according to the record level policy, it is mandatory to map the fields in Setup (country, address, city, state and so on) with the Lead, Account, Contact and Opportunity fields.
-
From Setup, select Custom Metadata Types.
-
Click Manage Records next to InCountry Lead Convert Mapping.
-
To add a compound field (e.g. country field), click New.
-
Add other compound fields as shown above.
noteCompound fields are comprised of several fields (so-called constituents), for example the Address field includes the City, Zip code, State, and other fields. When converting, all these fields should be matched between the source Salesforce object and the target Salesforce object. You need to add the logic for each constituent of the compound Address field for all Salesforce objects which a lead can be converted to.
To do this, it is necessary to add a new item to the Lead Convert Mapping. For EACH constituent of the compound Address field, you need to create a new item.
When creating, you need to specify the API name of the field on the lead object. To get API names of fields, navigate to Object Manager, open the related Salesforce objects and on the Fields and Relationships tabs you can find the API names for required fields. These fields will take values from the lead record passing through conversion.
-
From Setup, select Object Manager.
-
Select Lead.
-
Select Fields & Relationships.
-
In the top right part of the screen, click Map Lead Fields.
-
Use the tabs (Account, Contact or Opportunity) to map each of your organization's custom lead fields to one of your custom account, contact, or opportunity fields.
-
Click Save.
Once you have configured the Lead Convert component, you can proceed with converting a lead to an account, contact, or opportunity. For the details on convering leads, please check our documentation.