Getting ready

Carry out the following steps to create a custom object that is used to store country codes along with a custom field to mark whether the country is an embargoed nation:

  1. Click on the Setup gear icon in the top right-hand corner of the main Home page, as shown in the following screenshot:
  1. Click on Setup, as shown in the following screenshot:
  1. Navigate to the Object Manager setup page by clicking the following: Objects and Fields | Object Manager.
  2. Click on Create.
  3. Click on Custom Object, as shown in the following screenshot:

You will be presented with the New Custom Object edit page.

  1. Type Country Code in the field Label textbox.
  2. Type Country Codes in the field Plural Label textbox.

Upon clicking out of the field Label textbox, the Object Name changes to Country_Code.

  1. Optionally, enter details in the Description field.
  2. Leave the Context-Sensitive Help Setting set to Open the standard Salesforce.com Help & Training window.
  3. Leave the Enter Record Name Label and Format sections unchanged.
  4. Leave the settings in the Optional Features section unchanged.
  5. Leave the Object Classification section settings unchanged.
  6. Leave the Deployment Status set to Deployed.
  7. Leave the Search Status set to Allow Search.
  8. Leave the settings in the Object Creation Options section unchanged.
  9. Click on Save, as shown in the following screenshot:

Having created the Country Code custom object, we will create a custom field—IsEmbargo.
  1. Click on the Setup gear icon in the top right-hand corner of the main Home page, as shown in the following screenshot:
  1. Click the Setup option, as shown in the following screenshot:
  2. Navigate to the custom Country Code customization setup page by clicking the following:
    Objects and Fields | Object Manager | Country Code | Fields and Relationships.

Locate the Fields & Relationships section on the right of the page.

  1. Click on New.

You will be presented with the Step 1. Choose the field type page.

  1. Choose Checkbox from the Data Type options.
  2. Click on Next.

You will be presented with the Step 2. Enter the details page.

  1. Type IsEmbargo in the Field Label textbox.

Accept the default IsEmbargo in the Name field.

  1. Optionally, enter details in the Description field.
  2. Optionally, enter details in the Help Text field.
  3. Click on Next, as shown in the following screenshot:

You will be presented with the Step 3. Establish field-level security page.

  1. Select the profiles to which you want to grant editing access to this field via field-level security. The field will be hidden from all profiles if you do not add it to field-level security.
  2. Click on Next.

You will be presented with the Step 4. Add to page layouts page.

  1. Select the page layouts that should be included in this field. The field will be added as the last field in the first two-column section of these page layouts. The field will not appear on any pages if you do not select a layout.
  2. Finally, click on Save.

You will now create the following test data in preparation for the How to do it... section.

You can obtain a list of country codes that are available with two letters according to an international standard (ISO 3166) set by the International Organization for Standardization. For more information visit the ISO site at https://www.iso.org/obp/ui/#search.
  1. Enter the following data in the custom Country Code object:
    • Create a Country Code record with COUNTRY CODE NAME set to ZW and ISEMBARGO set to True.
    • Create a Country Code record with COUNTRY CODE NAME set to US and ISEMBARGO set to False.
    • Create a Country Code record with COUNTRY CODE NAME set to GB and ISEMBARGO set to False.

The list view for the Country Codes will appear, as shown in the following screenshot:

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset