Publishing Individual Records Using a Custom Object
The custom object serves as a publish button, which references the Engage fields in your questionnaire or your application and publishes them to Engage.
Use either the process described below, or the Engage tab in the Application Builder.
Important: Download and install the Archer_6.9_P3_Engage_Template_Package.zip available on the Community. This package provides an examples of applications and questionnaires that work with Engage, including a custom object code example.
Note: When preparing a questionnaire or application for internal users, we recommend using the custom object method.
On this page
Task 1: Verify fields in the Contacts application exist and capture relevant field IDs
Important: This step is required for E4V, which only supports cross-references. E4BU supports cross-reference, record permissions, and user/groups.
Note: The Contact section can be populated with a Contact, User/Group, or Record Permission. If you use a Contact cross-reference, all of the field ID names in the Contact section must be accurate. If you use a User/Group or Record Permission, only the ContactFieldId needs to be populated with the field ID of the User/Group or Record Permission.
Complete this task if you are using a Contacts field for your Engage users. If you use a User/Groups or Record Permissions field, you can skip this step.
-
From the menu, click
> Applications, select Contacts.
-
In the Objects panel, click
to enter the full screen view.
-
Click
and select ID. Locate and document the field IDs for the following Archer fields.
Note: If you are using a record permission or user/groups field, you must still include all of these fields, but it is not used to populate the participant information. The participant information is populated from the user profile record.
-
Firstname
-
LastName
-
Email (Business)
-
JobTitle
-
Task 2: Create new fields
Edit the default layout in your application or questionnaire to add a new Engage section containing fields and a custom object required to publish.
-
Open the default layout in the application or questionnaire you want to publish.
-
From the menu, click
> Application Builder > Applications.
-
Select the application or questionnaire.
-
-
Click the Designer tab.
-
On the Default Layout, to create a new section for the Engage fields, do the following:
-
In the Objects pane, from the Layout Object section, select Section and drag and drop it where you want it to appear on the layout.
-
Enter a section name, such as Engage Details.
-
Click Save.
-
-
Repeat the following step for each field described in the table below.
In the Objects pane, from the Data Fields section, click Add New.
-
Select the field type.
-
Enter the field name.
-
Click Create Field.
-
Drag and drop new fields from the Objects Panel to the Layout Builder where you want them to appear in the new section.
-
Click Save.
-
Task 3: Create a new Engage layout
Create a separate layout on the application or questionnaire that contains only the fields and objects you want to publish to the Engage portal.
Important: You must enable Advanced Workflow to allow multiple layouts on an application or questionnaire, but you do not have to configure the workflow.
-
In your application or questionnaire, go to the Advanced Workflow tab, click Create Workflow, and then click the Designer tab. Confirm that you are on the Default Layout.
-
Click the Layout menu, select Copy Current, type in a name, and click Copy Layout.
-
In the Properties panel,
-
Enter the layout name and description.
-
Click
to enter the full screen view. Locate and document the ID. This is your LayoutID.
-
-
(Optional) In the Layout Builder, remove any fields or sections that do not belong in the Engage record, including unsupported field types. The Engage layout only needs to contain the fields you want in the Engage record. However, if you leave unsupported fields on the layout, the system ignores them during the publishing process.
-
On the Objects panel, click
to enter the full screen view.
-
Click
and select ID. Locate and document the field IDs for the following fields:
-
Additional Guidance
-
Requesting Party Email Address
-
Requesting Party Name
-
Due Date
-
Engage Status
-
Publish Message
-
Company Name
-
Engage Contacts
-
History Field (Optional)
-
IdentifierFieldId (Optional)
-
Publish Language (Optional)
-
Portal Request URL (Optional)
-
Visible Fields (Optional)
-
Engage Progress (Optional)
-
Required Fields Remaining (Optional)
-
-
Click Save.
Task 4: (Optional) Collect Field IDs from the History Field sub-form
Note: Only E4BU supports the history log.
To configure the custom object, you need the Field IDs for several fields on your questionnaire. This task walks you through how to obtain them.
-
(Optional) Obtain the field IDs for your history field sub-form.
-
From the menu, click
> Applications, select your history field sub-form, and click the Designer tab.
-
In the Objects panel, click
to enter the full screen view.
-
Click
and select ID. Locate and document the field IDs for the following Archer fields.
-
Action By (text field)
-
Action (text field)
-
Action Date (date and time field)
-
-
Note: To send this questionnaire to multiple recipients at once, go to Publishing records in bulk using a data feed after completing these first 4 tasks.
Task 5: Configure the custom object code
If you use the provided custom object code, you must edit it to ensure that the code is referencing correct field IDs. Before you configure the code, you must have the field and layout IDs from the Contacts application, the application or questionnaire that you want to publish content from, and the optional history sub-form. You gathered these field IDs in previous steps.
The field IDs entered in custom object are also used to populate invitation emails. These values are the only customizable objects within the email template.
In this custom object code, the identifier field is the default key field for the application or questionnaire. To use a different field, configure the IdentifierFieldId within the custom object. This field supports text, numeric, date, and tracking ID field types. Masks for text field are not supported.
If your record contains calculated fields and you publish before the Engage and Archer complete synchronization, the published calculated fields are blank.
-
To create the custom object on the layout that represents a Publish button, do the following:
-
From the Add New Layout Object drop-down menu in the left pane, select Add Custom Object and drag and drop it where you want it to appear in the new section.
-
Enter a name for the custom object, such as Publish Button.
-
In the Code field, paste the custom object code obtained from the community. Modify this custom object code based on your setup according to the updates in the following file:
-
(Optional) For existing customers already using the custom object.
If you want the custom object Publish button label to be in sync with the Portal status, do the following:
-
Download the latest custom object code from the community, open this file, and copy everything starting from the <style> tag.
-
Open the custom object code file that you are locally using on your machine and locate the <style> tag.
-
Replace all the custom object code in Task 5 Step 1d(ii) starting from the <style> tag with the custom object code you copied in Task 5 Step 1d(i).
-
Update the instanceName as per your setup in the following line of the custom object code:
let instanceName ="Archer";
-
-
Click OK.
-
-
Edit the custom object code, as follows:
-
In the Layouts tab, select Default Layout.
-
Click the Designer tab.
-
In the Engage Detail section, click the arrow next to the name of the custom object, for example, Publish Button.
-
Select Edit Custom Object Properties.
-
Do one of the following:
-
In the Code field, locate the jsonRequestBody. This is the same code you copied in step 1.
-
Update the ID for each application or questionnaire where your custom object is applied. For example, update the numerical value after LayoutID with the value you collected in task 3.
Important: The Contact section can be populated with a Contact, User/Group, or Record Permission. If you use a Contact cross-reference, all of the field ID names in the Contact section must be accurate. If you use a User/Group or Record Permission, only the ContactFieldId needs to be populated with the field ID of the User/Group or Record Permission.
-
(Optional) Update the fields for the History Log.
Note: If the History sub-form is not used, set the value of HistoryFieldId to 0 in the custom object or delete all the History sub-form fields from the custom object.
-
Update the ProductIdentifier with either E4V or E4BU depending upon the product you are using.
-
(Optional) If you want to send notifications through Engage, ensure IsEngageNotificationRequired is set to true.
-
(Optional) If you want to enable comments through Engage, ensure IsCommentsEnabled is set to true.
-
-
Review the JSON data file to ensure all IDs are valid.
-
After updating the values, click OK.
-
Save the application.
-
Task 6: (On-Premises Only) Configure the directory location in the custom object code
By default, Archer is installed in the Archer directory under Default Web Site in Microsoft Internet Information Services (IIS). If you installed Archer in a different sub-directory, you must configure the custom object code to reflect the location of your Archer installation.
Important: The URL must reflect the value you set while configuring the Server Farm.
For more information, see Publish URLs.
For example, if you installed Archer in the MySite sub-directory, you must revise the line in the custom object code as follows:
Default (from the example Custom Object): const portalURL = '/engage/api/questionnaire/Publish';
Default Installation Location: const portalURL = '/Archer/engage/api/questionnaire/Publish';
Revised Installation Location: const portalURL = '/MySite/engage/api/questionnaire/Publish';
Note: The sub-directory name is case sensitive.
In both of the above examples:
-
Open the custom object code.
-
In the Code field, locate the following text:
const portalURL ='/engage/api/questionnaire/Publish';
-
(Optional) specify a specific API version in the url: portalURL = '/engage/api/v1/questionnaire/Publish';
Current version is v1
-
-
Update the code as needed.
-
Click OK.
-
Save the application.
Task 7: Create data driven events
We recommended that you create data driven events (DDEs) to hide the custom object until all required fields are populated to prevent users from reaching an error state. For example, you might create a new calculated field, "Required Engage Fields Populated," that returns a Yes or No response, depending on whether all of the required fields you created have been populated. You could then create a "Show Publish Button" DDE that displays the Publish Button when the value of "Required Engage Fields Populated" is Yes.
For more information, see "Data Driven Events" in the Archer Platform Help.