InCountry logo
mobile-nav
Search
  • Products
    • Products
      • InCountry for Salesforce
      • Data Residency-as-a-Service
      • Alibaba Cloud InCountry Service
      • Compliance and security
    • Gateways
      • Email
      • Payment Vault
      • Web Forms
      • HTML
    • Developers
      • REST API
      • SDK
  • Solutions
    • Automotive
    • Energy
    • Financial services
    • Healthcare
    • Retail
    • Technology
    • Latest success story
      • IBM Consulting
  • Integrations
    • Cegid
    • Intertrust
    • MuleSoft
    • PayPal
    • Salesforce
    • ServiceNow
    • Stripe
    • Veeva Systems
    • Yandex
  • Resources
    • Country compliance
    • Documentation
    • Library
    • Partners
    • Pricing
  • About
    • News and Blog
    • Careers
    • Contact Us
    • FAQ
    • Leadership
  • Login
  • Schedule a Demo

›Documentation

Home
  • InCountry Platform
Portal
  • Getting started
  • Documentation
    • Dashboard
    • Managing environments
    • Managing SDK credentials and services
    • Managing Border configuration
    • Managing payment vaults
    • Managing email gateways
    • Managing resident functions
    • Managing file imports
    • Managing profile and organization
    • Managing users
    • Managing encryption keys
  • Release notes
Border
  • Documentation
  • Release notes
REST API
  • Documentation
  • How to test CRUD requests through REST API
  • Release notes
Resident Functions
  • Documentation
Salesforce
  • About
  • Overview
  • Quick start guide for three-model package
  • Quick start guide for legacy package
  • Administrator's guide
    • Managing the package
    • Managing permissions
    • Managing OAuth2 authentication and authorization
    • Managing certificates
    • Registering CSP Trusted Sites
    • Managing InCountry Endpoints
    • Managing REST endpoints
    • Managing InCountry flags
    • Loading the application
    • Managing data regulation policies
    • Managing protected fields
    • Hashing the UserName field
    • Managing custom objects
    • Replacing standard elements
    • Configuring record search
    • Managing components
    • Setting up Salesforce Experience Cloud
    • Managing resident functions
    • Managing InCountry cache
    • Managing Apex triggers
    • Managing record synchronization
    • Managing web forms
    • Tracking changes to data regulation policies and regulated fields
    • Using Email-to-Case feature
    • Debugging
    • Migrating data from one Salesforce organization to another
  • Developer’s guide
    • Apex SDK
    • JavaScript API
    • Retrieving record statistics
    • Tracking field history
  • User's guide
    • Working with protected fields
    • Sending compliant email messages
    • Importing data into Salesforce
    • Migrating records
    • Managing audit reports
    • Converting leads
    • Managing reports
    • Using formula fields
    • Using frontend validations
    • FAQ
    • Release notes
Payment Vault
  • Documentation
BYOK
  • Documentation
FAQ
  • Get started with the platform
  • Integration options
  • Data regulation models
  • Limits and quotas
  • Video tutorials
Service Status
  • Status

Managing resident functions

A resident function is a script (program code) that allows you to perform some operations on regulated data without its leaving the country of origin, so that you do not violate any local requirements on handling personal data.

You can perform the following operations on resident functions:

  • publishing new resident functions

  • re-publishing the existing resident functions

  • executing the published resident functions

note

The general requirements for a resident function:

  1. The script should be written in JavaScript.

  2. The script should define a function which performs some business logic on regulated data.

When to use resident functions

You need to use resident functions for implementing custom scenarios for the redaction and restriction data regulation models. If you are using the replication data regulation model, you do not need to use resident functions.

Primary use cases for resident functions are the following:

  • validation of record uniqueness by full name and/or email address

  • custom calculations of values for specific profiles

Resident functions allow you to execute custom operations on regulated data within the Point-of-Presence where it is originally stored and do not transfer it to your application server, which may automatically cause violation of the local compliance requirements and regulations.

Viewing resident functions

  1. Open the environment where you have created the Resident Functions service.

  2. Click the Services block.

  3. On the list with services, locate the service of the Resident Functions type.

  4. Click the Resident functions icon.

  5. On the opened page, enter the Client Secret that you received upon the integration creation. Upon the entry of the valid Client Secret, the New Function button becomes active and the list with resident functions is displayed.

Here you can view the following information about the available resident functions:

AttributeDescription
NameName of a resident function.
CreatedDate when a resident function was created.
UpdatedDate when a resident function was updated.

Publishing a new resident function

  1. Open the environment where you have created the Resident Functions service.

  2. Click the Services block.

  3. On the list with services, locate the integration of the Resident Functions type.

  4. Click the Resident functions icon.

  5. On the opened page, enter the Client Secret that you received upon the service creation. Upon the entry of the valid Client Secret, the New Function button becomes active.

  6. Click New Function.

  7. On the opened page, specify the following information:

    • Function Name - enter the name of a resident function.

    • Function body - enter the code of the resident function.

  8. When complete, click Publish.

You can switch to another service of the Resident Functions type by selecting another service in the corresponding dropdown box and entering an appropriate Client Secret for this newly selected service.

important

When you publish a resident function, it is saved on InCountry Portal, then passed to REST API which saves it further to PoP API on the Point-of-Presence.

Editing the resident function

  1. On the list with resident functions, locate the resident function you want to edit.

  2. Click the Edit icon.

  3. On the opened page, update the resident function as required.

  4. When complete, click Update.

Executing the resident function

  1. On the list with resident functions, locate the resident function you want to edit.

  2. Click the Execute icon.

  3. On the opened page, add the parameters required for the execution of the resident function by clicking Add parameter.

  4. For each added parameter, specify the following information:

    • Name - name of the parameter.

    • Value - value of the parameter.

  5. If you have added some parameter by mistake, delete it by clicking the Remove icon.

  6. When complete, click Execute. The resident function will output the execution results into the console.

important

When you execute a resident function, REST API fetches the required resident function by its name from PoP API and executes its code against records stored in the Point-of-Presence.

Deleting the resident function

  1. On the list with resident functions, locate the resident function you want to delete.

  2. Click the Delete icon.

  3. Confirm the removal of the resident function.

← Managing email gatewaysManaging file imports →
  • When to use resident functions
  • Viewing resident functions
  • Publishing a new resident function
  • Editing the resident function
  • Executing the resident function
  • Deleting the resident function
InCountry logo blue
© InCountry 2022.
All rights reserved. InCountry, Inc
  • PRIVACY POLICY
  • TERMS OF SERVICE
  • Social share
    • YouTube logo
    • Facebook logo
    • Twitter logo
    • LinkedIn
  • Column 1
    • Products
      • Products
        • InCountry for Salesforce
        • Data Residency-as-a-Service
        • Alibaba Cloud InCountry Service
        • Compliance and security
      • Gateways
        • Email
        • Payment Vault
        • Web Forms
        • HTML
      • Developers
        • REST API
        • SDK
  • Column 2
    • Solutions
      • Automotive
      • Energy
      • Financial services
      • Healthcare
      • Retail
      • Technology
    • Integrations
      • Cegid
      • Intertrust
      • MuleSoft
      • PayPal
      • Salesforce
      • ServiceNow
      • Stripe
      • Veeva Systems
      • Yandex
  • Column 3
    • Resources
      • Country compliance
      • Documentation
      • Library
      • Partners
      • Pricing
    • About
      • News and Blog
      • Careers
      • Contact Us
      • FAQ
      • Leadership