Document Packs

Intro

A document pack is a collection of forms, contracts, assessments and even external resources, that one must complete. A document pack is a re-useable abstract component that can be assigned to one or multiple contacts/users. You can automate the assignment of document packs or you can use our pre-built distribution mechanism.

Creating a Document Pack

Navigate to the 3B Onboarding application in the app launcher and then find the “Document Pack” tab and click on it. Here, you will see a list of all of the document packs previously created.

To create a new document pack, click on the “New” button in the Document Packs tab and you should see a familiar interface*(link to assessments article) where you can use a wizard like interface that guides you through the process of creating a new document pack.

Document Pack Options

When creating a document pack, you can configure the behaviour of that document pack using the following options:

Option Description
Document Pack Name This will be displayed to the user completing the document pack in the header of the document pack section. This is usually the name of the general process the document pack is aimed to enable, like “Right to Work Documents”, “Employment Contracts”, etc.
Public Description This is a text displayed under the Document Pack Name and aims to give some guidance to the user completing the document pack
Submit in Order If checked, a user completing the document pack can only complete the next document if the previous one has been submitted. This option aims to provide an enforcement in the order in which documents are completed, for example when you want to first collect some details and then generate a document with the collected details
Disabled If checked, the document pack will not be available for completion, even if the assignment is valid

Supported Document Types

The document pack functionality relies heavily on 3B Forms and 3B Docs in order to create data collection screens and/or collect electronic signatures. So far, we support the following document types:

Form

This is a link to a 3B Form form. We support forms build with the Contact and 3B Application as the core object.

Note that whenever a document is defined with a form where the core object is a 3B Application, the MyDocuments page/component responsible for rendering the candidate facing screens will need to be given the 3B Application context *(link to contexts).

Document Template

This is a link to a 3B Docs template. We support templates build with the Contact and 3B Application as the core object.

Question Set

This is a link to a Question Set*(link to article) record. This will give the user access to a the selected assessment.

Session

This is a link to a Session*(link to article) record. Whenever a user opens a document linked to a session, a new Session Invitation record will be created for the contextual contact. This will allow the candidate to self-book for a session.

External Link

This is any external link – another Visualforce page or even an externally hosted app. You can also merge values dynamically by adding the following merge tags:

o   {0} – will be replaced with the logged in contact’s Id

o   {1} – will be replaced with the document record Id

o   {2} – will be replaced with the 3B Application record Id (if available)


Remember that when an external link is opened, in order to auto-close the pop-up modal hosting the external link, the child page must fire an iFrame event with the event_id attribute set to “3bonboarding_externalLink”.

Document Context

By default, we determine the displayed document context as that of the logged in user. So, if you create a Document or a Form, they will be displayed with context record Contact (that of the logged in user).

Often, we need to create documents and forms that use a context object different than that of the Contact, for example an Application, Placement, Opportunity etc.

To allow documents and forms to be merged with the correct context, all an admin needs to do is add a Lookup relationship on the Document Assignment looking up to the new context object (say, Target Recruit Job Applicant object). Then, when a Document Assignment is created, it must have the new lookup set to the record to be used for merging, and of course, any implementing documents and forms must also be built with the same context object as the core object.

A document pack may have a mix between different merge contexts, we derive the merge context from the Form or Document (Template) record, there should be a field named "Core Object".

Creating a new Document

You can use the standard wizard that manages Document Packs to create a new document or you can simple add a new “Document” record manually against a document pack. The following fields are available on the Document record:

Option Description
Label/Name This is the name of the document
Document Description A short description of the document, visible to whoever the document pack is assigned to
Form/Template/Question Set/External Link One of the four is required, not more than one. This determines the document type.
Order A number representing the order when rendering the document pack. Remember that you can use our document pack editor to re-order documents with buttons instead.
Submit Button Label Override The default button label for a never-submitted document is “Submit”. You can override this per document.
Submitted Button Label Override When a document is submitted and rejected, the default label is “Re-Submit”. You can override this per document.
Edit Button Label Override The default button label for a previously-submitted document that has the flag “Allow Editing Submitted Form” is “Re-Submit”. You can override this per document.
Pending Review Status Override When adocument is submitted and “Allow Editing Submitted Form” is disabled, the button will be locked and will display “Pending Approval” label. You can override this per document.
Template If checked, the document will be available for reuse in other document packs.

Creating Documents from Templates

Similar to how the assessments module handles templates*(link to article), a Document record can be marked as a Template, which will make it available for re-use.

Document Pack Assignments

You can easily assign one or multiple document packs to one or multiple contacts. You can do this via the built in “Assign Documents” button that is available on Contact, Short List*(link to article) and Session(*link to article). A developer can extend the built-in tool to be enabled to other standard, custom or managed package objects. Contact support for more details.

When you click on “Assign Documents” against a Contact/Short List or Session record, you will see a wizard interface that will let you either create a new document pack or search to select an exsiting one.

You can then select who you want to assign the document pack. At the end of the process, the contact(s) selected will be assigned with a new record of the object type “Document Assignment” for each document pack that was selected to be assigned. The Document Assignment record links the Contact and Document Pack and tells the MyDocuments page/plugin to render the document pack for the candidate.

The Document Assignment record links the Contact and Document Pack and tells the MyDocuments page/plugin to render the document pack for the candidate.

By default, there is no communication that goes out when a Document Assignment is created, however part of the implementation process of 3B would be to determine how and when users will complete Document Packs.

As an example, an automated email/SMS message can be sent to the contact owner of the Document Assignment as soon as a new record is created. You can generate a link to the My Documents page/plugin and even add custom authentication before the documents can be displayed.

MyDocuments.page and plugin has previously been implemented within custom mobile apps, salesforce communities, standard visualfoce pages and external candidate portals – your options are limitless due to the architecture of the plugin.

My Documents Plugin

My Documents plugin can be used outside of Salesforce or on a specially branded Visualforce page by importing the component using the following example:

<apex:page showHeader="false" sidebar="false" standardStylesheets="false" controller="GlobalRemotingRouter"
docType="HTML-5.0" applyHtmlTag="false" applyBodyTag="false">
<html>
    <head>
        <title>Documents</title>
        <meta charset="utf-8"/>

        <meta name="viewport" content="initial-scale = 1.0,maximum-scale = 1.0" />

        <!-- Load Supporting Components and Global Functions -->
        <script src="{!URLFOR($Resource.b3o__GeneralUtils, 'index.js')}" defer="true" type="module"></script>
        
        <!-- This Component -->
        <script src="{!URLFOR($Resource.b3o__MyDocuments, 'index.js')}" defer="true" type="module"></script>
        
        <style>
            
        </style>
    </head>
    <body>

        <div class="container">
            <div id="my-documents" class="documents-wrapper">
            </div>

            <user-documents
                public-site="{!$Site.baseUrl}"
            ></user-documents>

        </div>
        <script> 

            const globals = {
                sessionId: '{!GETSESSIONID()}',
                siteUrl: '{!$Site.baseUrl}',
                useREST: false,
                router: b3o.GlobalRemotingRouter
            };
            window['globals'] = globals;
        </script>
    </body>
</html>
</apex:page>

Distribution

You can distribute Document Packs by passing some important parameters to the myDocs plugin (or the MyDocuments.page). Here is a list of the available parameters.

Parameter Description
id This can be either the Contact’s Id or a 3B Application.
applicationId If a 3B Application’s record id is passed, forms and document templates with core object set to 3B Application can be used.
dpId This is the id of a specific Document Pack that needs to be rendered by the plugin.

Architecture

Communication

Communication is established either through AJAX or REST API. If the controller b3d.GlobalRemotinRouter is found on the page, the plugin will communicate through the built in secure salesforce communication protocols. Alternatively, if you decide to embed this plugin externally to salesforce, the communication plugin will fall back to REST API communication which is un-authenticated and depends on a Public Site Guest User*(link to setting up sites).

Web Components

We use standard web components*(link to external article) for rendering a document pack. A developer can extend/override the default web components delivered with the product to add additional functionality or remove existing functionality.

Dependencies

Assessments are dependent on the “remoteUtils”*(link to article) plugin that manages communication with salesforce and “modal” that adds support for displaying documents in a pop up interface.

You may also notice a snippet of code that emits an an iframe event with the  identifier “3bonboarding_questionSet” – this is used within the context of MyDocuments*(link to MyDocuments) to allow the modal with the assessment to automatically close.