Skip to main content

Managing Form Components

The InCountry Data Residency for Salesforce package provides the following components:

Web-to-Lead component

note

This component is supported in the legacy package and in the three-model package for the restriction and redaction models.

note

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

  1. From Setup, click Sites, and then click New.

  2. 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).

  3. Click Save.

  4. Click Public Access settings.

  5. Click Enable Apex Class Access at the top of the page.

    Enable Apex Class Access

  6. Click Edit.

  7. Select the InCountryWebToLeadService class and click Save.

    Select class

  8. Return to the Sites list and copy the site URL.

  9. Go to the InCountry application and select the Web-to-Lead tab.

  10. Paste the Border URL address (for example, https://sa-proxy-mt-01.api.incountry.io/) and append x-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 or x-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.

  11. Click the Save icon.

    Web-to-Lead Setup

  12. Select the fields you want to include in the form.

  13. Enter the Return URL if required. If not needed, leave it empty.

  14. Set the default user for the Lead, if needed.

  15. 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.

  16. Click + Add reCAPTCHA and populate Public and Private keys if captcha is required. If not needed, leave them empty.

    reCAPTCHA Settings

    You can find out how to generate those keys here: Developer's Guide

  17. Click Generate form > Copy to clipboard.

  18. 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

note

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.

  1. From Setup, select Custom Metadata Types.

    Custom Metadata Types

  2. Click Manage Records next to InCountry Lead Convert Mapping.

    Manage Records

  3. To add a compound field (e.g. country field), click New.

    New

  4. Add other compound fields as shown above.

    note

    Compound 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.

  5. From Setup, select Object Manager.

  6. Select Lead.

    Select Lead

  7. Select Fields & Relationships.

    Select Fields and Relationships

  8. In the top right part of the screen, click Map Lead Fields.

  9. 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.

    Map the fields

  10. Click Save.

note

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.