This article describes the steps needed to initialize a new sandbox from an org that has Decisions on Demand installed, and (optionally) import business policies from the source org or another sandbox.

This article contains two sections:

  • General initialization steps applicable to any type of sandbox
  • Guidelines for creating full or partial copy sandboxes
    Make sure to read that section before creating your sandbox.

Initializing Decisions on Demand in a new sandbox

After creating a new sandbox, the following steps are required to initialize Decisions on Demand:

  1. (optionally) Update the app
    When your sandbox is created from an org which already has Decisions on Demand installed, the app will be copied into the sandbox automatically.
    If you want to upgrade the sandbox to the latest version of the app, navigate to our AppExchange listing and click Get it Now.
    Make sure you are logged into with your  sandbox credentials, and then follow the prompts.
  2. Install your secret key
    Before you can import or create policies, the sandbox needs to retrieve a secret key from our server.
    This is mostly automated, but requires one manual step: simply visit the Decisions on Demand Setup tab in the app, and validate that it shows VALID KEY
  3. (optionally) Import policies
    You can import existing business policies from another org. To learn more, please see this support article

Creating a full or partial copy sandbox 

When setting up a new full or partial copy sandbox from an org with existing Decisions on Demand business policies, bear in mind that a business policy has two components:

  • A Salesforce record
    This record (of type DecsOnD__Policy__c) is essentially a wrapper that serves to display and manage the policy in Salesforce.
  • Policy structure and content
    The description of tables and column, and the content of the tables (the actual rules). These reside in the Decisions on Demand Policy Management Server -- not in Salesforce.

For technical reasons, the structure and content on our servers is not automatically copied to the new sandbox along with the new Salesforce record. This means you should also avoid copying the Salesforce business policy records to your sandbox from the source org -- otherwise they will end up as invalid (orphan) instances with no structure or content. 

We recommend using a Sandbox template that excludes DecsOnD__Policy__c to create the sandbox. Note that excluding DecsOnD__Policy__c will also exclude DecsOnD__PolicyExecutionRecord__c, which has a master-detail relation to a business policy.

Cleaning up orphan policies from an existing sandbox

If you have previously created a sandbox with a copy of the business policy records included, you will need to remove the invalid policies. NOTE: this is not required if you followed the steps above when creating your sandbox.

To find invalid policies and remove them:

  • On the Business Policies tab, select the Not Active view
  • For each policy with Invalid status
    • Click the Policy Name link
    • On the policy detail page that appears, click Delete 
    • Select I want to permanently delete this policy, and click Delete
    • IMPORTANT: this is irreversible -- make 100% sure you are in your sandbox before deleting a policy.