Child eForm Setup

Introduction

To add a child FieldFX eForm, complete these tasks in order.

  • Before you begin, review the eForm Guidelines first.

  • You must create a parent eForm before you can create a child eForm.

You can set up child FieldFX eForms to record information related to another eForm.

Before you can add a child eForm, the Job Share Trigger field must be added by following [EnableJobShareTrigger]. It is needed for the form to only download the related records that pertain to that object.

Example 1. Wireline logging tickets

If an eForm records details for wireline logging tickets, add a child eForm to record the measurements made during each logging run.

Child FieldFX eForms have a master-detail relationship with a parent eForm.

Customers should review the terms and conditions of the Software Subscription and Support Agreement (including the SFDC Supplemental Terms) to understand the rights and restrictions that Customers have regarding creating custom objects.

Add a Custom Object

Click to expand

Start by adding a custom object for the FX Form.

  1. From Setup, enter schema in the Quick Find box, then select Schema Builder.

  2. Click the Elements tab.

  3. Drag Object from the Elements panel onto the grid.

    Screenshot of dragging an object to the Elements panel
  4. Complete the following:

    Field Action Example

    Label

    Enter a name for the FX Form

    JSA

    Plural Label

    Enter a plural name for the FX Form

    JSAs

    Starts With

    Select "Consonant" or "Vowel"

    Description

    Enter an object description.

    This object is for Job Safety Audits

    Data Type

    Select "Text"

  5. Select Allow Reports.

  6. Click Save.

    JSA Object
    Figure 1. Start of JSA__c Object
  7. Select Add Google Docs, Notes, Attachments, related list to default page layout.

Add the Master-Detail and SyncId fields

Click to expand
  1. Add the Master-Detail field:

    You must add a Master-Detail field to every Child FX Form and Child eForm.
    1. Drag Master-Detail from the Elements panel onto the child FX Form or a FieldFX eForm object.

    2. Configure the following:

      Field Name Options

      Field Label &
      Field Name:

      Description

      Enter JSA Object for Job

      Related To:

      The same thing is filled in on the Child Relationship Name field.

    3. Click Save.

      The JSA Object linked to the Job Object
      Figure 2. The JSA Object linked to the Job Object
  2. Add the SyncId field (required if for an eForm):

    You must add a SyncId field to every Child FX Form or Child eForm.
    1. Drag Text from the Elements panel onto the child FX Form object.

    2. Complete these fields:

      Field Name Action

      Field Label

      Enter SyncId.

      The Field Label and Field Name fields are case-sensitive, so you must enter SyncId correctly.

      Field Name

      Length

      Enter 50.

      Unique

      Select checkbox.

      Is Case Sensitive

      Select Treat "ABC" and "abc" as duplicate values (case-insensitive).

      External ID.

      Select checkbox.

    3. Click Save.

      JSA Object with SyncId field
      Figure 3. JSA Object with SyncId Field

Add fields to collect data

Click to expand
  1. Drag a field type from the Elements panel onto the FX Form/FieldFX eForm object.

  2. Enter field attributes.

    Don’t give a custom field the same name as a field on a FieldFX object.
  3. Click Save.

  4. To add more fields, repeat these steps.

    See Typical JSA Form fields for suggestions on the fields to include tailored to your org and industry.

Continue with Define the Layout.

Define the Layout

Click to expand
  1. Click the gear icon on the FX Form or FieldFX eForm object and select View Page Layouts.

    Screenshot of selecting the View Page Layouts option
  2. Under Page Layouts, click Edit next to the default page layout.

  3. Drag fields onto the page layout to create the FX Form or the FieldFX eForm.

  4. On the toolbar, click Related Lists.

  5. Drag Notes & Attachments into the Related Lists section.

  6. Click Save.

  7. Add a Related List to page layouts:

    1. From Setup, enter object in the Quick Find box, then select Objects.

  8. If the FX Form or FieldFX eForm is for:

  9. Under Page Layouts, click Edit next to a page layout for FieldFX Back Office.

  10. On the toolbar, click Related Lists.

    • For eForms only, find the object you created for the eForm and drag it down to the Related Lists section.

      The eForm object appears in the Related Lists section.

  11. Drag the FX Form or FieldFX eForm into the Related Lists section.

  12. Click Save.

  13. Click Yes.

  14. Repeat these steps if other page layouts are needed.

  15. Complete one of the following:

Continue with Add a Report Template.

Add a Report Template

Click to expand
  1. While still in Setup and Object Manager, select the object and choose Triggers.

  2. Ensure there is a trigger called <form name>Trigger_FX5Auto.

    Form_Name and <form name> is the name of your form.

    If there is a Job_Share__c field, the trigger is automatically created.

Add a Visualforce Page for the Report Version

Click to expand

Add a Visualforce page for the report version of the child FieldFX eForm.

  1. From Setup, enter pages in the Quick Find box, then select Visualforce Pages.

  2. Click New.

  3. In Label, enter the name of the child FieldFX eForm.

  4. In Name, enter the name of the child FieldFX eForm with underscores for spaces.

  5. Copy the following code:

    <apex:page standardController="ObjectName" extensions="FX5.ReportTemplateExtension">
      <apex:includeScript value="{!$Resource.FX5__jquery1102minjs}"/>
      <style type="text/css">
        div.apexp {
          margin-left:-10px;
        }
        body {
          margin-left:0px !important;
        }
        a {
          text-decoration:none;
        }
      </style>
      <script type="text/javascript">
        $('td.labelCol.empty').remove();
        $('td.dataCol.empty').css('width','50%');
        $('td.labelCol.first').css('vertical-align', 'bottom');
        $('td.dataCol.first').css('vertical-align', 'bottom');
        $('input[type=submit]').appendTo('td.dataCol.empty');
        function jsOpenReport(entityId, templateId, objectTypeId, namespace)
        {
          var pagePath ='apex';
          var ctrl = document.querySelectorAll("[id$='reportPagePath']")[0];
          var customUrl='';
          if(ctrl!=null)
          {
            pagePath = ctrl.innerText;
            if(pagePath && pagePath.toLowerCase()!='apex')
            {
              customUrl='&customUrl=' + pagePath;
            }
          }
          var href = '/' + pagePath + '/' + namespace + 'Reporting?templateId='+ templateId + '&objectId=' + entityId + '&objectType=' + objectTypeId + customUrl;
          window.open(href, '_blank');
          window.top.location=window.top.location;
        }
      </script>
      <div style="display:none;">
        <apex:outputText id="reportPagePath" value="{!PagePath}" />
      </div>
      <apex:dynamicComponent componentValue="{!form}" id="dynamic"/>
    </apex:page>
  6. Replace the code on the Visualforce Markup tab by pasting over it with the code you copied.

  7. In the first line of the code, replace "ObjectName" with the API name of the child FieldFX eForm object.

    <apex:page standardController="Logging_Run__c" extensions="FX5.ReportTemplateExtension">
  8. Click the Version Settings tab.

  9. Click -- Select to Add Installed Package -- and select "FieldFX Base Package".

  10. Click Save.

Continue with Update Page Layouts.

Update Page Layouts

Click to expand

See page layouts for more information.

  1. From Setup, enter object in the Quick Find box, then select Objects.

  2. Open the FieldFX eForm object.

  3. Under Page Layouts, click Edit next to a page layout for FieldFX Back Office.

  4. On the toolbar, click Visualforce Pages.

  5. Drag Section from the toolbar to a suitable location on the layout.

  6. In Section Name, enter Reports.

  7. Under Layout, select 1-Column.

  8. Click OK.

  9. Drag the Visualforce page for the FieldFX eForm report into the Reports section.

  10. Click Save on the toolbar.

  11. Repeat for other page layouts as needed..

Continue with Add a Workflow Rule.

Add a Workflow Rule

Click to expand

You can add a workflow rule so that FX Forms sync to FieldFX Mobile or for an Audit Log for email notifications.

  1. From Setup, enter workflow rules in the Quick Find box, then select Workflow Rules.

  2. Click New Rule.

  3. In Object,

    Type Action

    For FX Forms or eForms

    Select the FX Form or eForm object.

    For Audit Logs (Email Notifications),

    Select Audit Log.

  4. Click Next.

  5. Complete the following:

    Field Action

    For FX Forms & eForms

    Rule Name

    Enter Sync Id Assignment

    Evaluate the rule when a record is

    Select created

    Run this rule if the following

    1. Select formula evaluates to true

    2. Enter the following formula:

    ISBLANK (SyncId__c)

    For Audit Log (Email Notifications)

    Rule Name

    Enter Sync Upload Error.

    Description

    Enter Email notification for sync upload errors.

    Evaluate the rule when a record is

    Select created.

    Rule Criteria

    1. In Run this rule if the following:, select created.

    2. Under Field:, select Audit Log: Type

    3. Under Operator: Select equals

    4. Under Value: Select SyncUploadError
      Screen shot of Rule Criteria selections

  6. Click Save & Next.

  7. Click Add Workflow ActionNew Field Update.

  8. Complete the following:

    Field Action

    For FX Forms and eForms

    Name

    Enter Sync Id.

    Field to Update

    Select "SyncId".

    Text Options

    1. select Use a formula to set the new value.

    2. Enter the following formula:

    CASESAFEID(Id)
  9. Click Save and then click Done.

  10. Click Activate.

Continue with Grant Permissions.

Grant Permissions

These permissions are required to use the child FieldFX eForm.

Click to expand
  1. From Setup, enter permission in the Quick Find box, then select Permission Sets.

  2. Open a permission set.

    If the permission has a Namespace of FX5, it is part of the FieldFX Managed Package and is locked and can’t be edited.
  3. Under Apps, click Object Settings.

  4. Open the FieldFX eForm object.

  5. Click Edit.

  6. Under Record Type Assignments, select the record types.

  7. Under Object Permissions, select Read, Create, and Edit

    For FX Forms, if you didn’t select Unique when adding the SyncId field, grant View All permission for the FX Form object.
  8. Under Field Permissions, grant Read and Edit permission for every field.

  9. Click Save.

  10. At the top of the page, click the arrow next to Object Settings and select Visualforce Page Access.

  11. Click Edit.

  12. Add the Visualforce page for the FX Form or Child eForm to Enabled Visualforce Pages.

  13. Click Save.

  14. Repeat these steps for other permission sets as needed.

Configure Sharing Settings and Inline Help

Finished adding a Child eForm

You’ve completed adding a Child FieldFX eForm.